Skip to content

Enlighten GenerateTrustInfo task for multithreaded mode #13619

@jankratochvilcz

Description

@jankratochvilcz

Enlighten GenerateTrustInfo task for multithreaded mode

Parent: #11834

Context

GenerateTrustInfo has two implementations via conditional compilation:

  • NETFRAMEWORK: reads BaseManifest.ItemSpec and writes TrustInfoFile.ItemSpec — both file I/O with potentially relative paths
  • .NET (non-Framework): inherits from TaskRequiresFramework and just returns false with an error

The cwd-dependence is in the NETFRAMEWORK path: FileSystems.Default.FileExists(BaseManifest.ItemSpec), trustInfo.ReadManifest(BaseManifest.ItemSpec), and trustInfo.Write(TrustInfoFile.ItemSpec).

Approach

  1. Mark both GenerateTrustInfo classes with [MSBuildMultiThreadableTask] (Inherited=false requires it on each concrete class)
  2. Implement IMultiThreadableTask on the NETFRAMEWORK version with path absolutization for BaseManifest.ItemSpec and TrustInfoFile.ItemSpec
  3. The .NET version only needs the attribute (no file ops)
  4. Use OriginalValue in error messages (Sin 2)

Acceptance criteria

  • Both GenerateTrustInfo classes decorated [MSBuildMultiThreadableTask]
  • NETFRAMEWORK version implements IMultiThreadableTask with path absolutization
  • .NET version: attribute-only (no IMultiThreadableTask needed)
  • Error messages use original paths (Sin 2)
  • All existing tests pass
  • No new compiler warnings

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: MultithreadedArea: TasksIssues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions