dotnet / dotnet/msbuild

Enlighten GenerateTrustInfo task for multithreaded mode

Open
#13,619 0 comments 0 reactions 0 assignees View on GitHub
Area: Multithreaded Area: Tasks
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

# 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

- Parent epic: #11834
- SKILL: `.github/skills/multithreaded-task-migration/SKILL.md`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.