dotnet / dotnet/msbuild

Enlighten SignFile task for multithreaded mode

Open
#13,618 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 SignFile task for multithreaded mode

Parent: #11834

## Context

`SignFile` passes `SigningTarget.ItemSpec` to `SecurityUtilities.SignFile()` which performs file I/O. Under multithreaded execution, relative paths would resolve against `Environment.CurrentDirectory` (shared process state) rather than the project directory.

## Approach

1. Mark `SignFile` with `[MSBuildMultiThreadableTask]` and implement `IMultiThreadableTask` with `public TaskEnvironment TaskEnvironment { get; set; } = TaskEnvironment.Fallback;`
2. Absolutize `SigningTarget.ItemSpec` via `TaskEnvironment.GetAbsolutePath()` before passing to `SecurityUtilities.SignFile()`
3. Use `OriginalValue` in error messages to avoid path inflation (Sin 2)

## Acceptance criteria

- [ ] `SignFile` decorated `[MSBuildMultiThreadableTask]` and implements `IMultiThreadableTask`
- [ ] `SigningTarget.ItemSpec` absolutized before `SecurityUtilities.SignFile()` call
- [ ] Error messages use original path strings (Sin 2)
- [ ] No `AbsolutePath` leak into user-visible output (Sin 1)
- [ ] 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

Research direction

Start with the SignFile task and its call to SecurityUtilities.SignFile(), then read .github/skills/multithreaded-task-migration/SKILL.md and the parent issue for migration context. Trace how SigningTarget.ItemSpec is used in signing and error reporting. Done means the stated acceptance criteria pass, including existing tests and a warning-free build.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.