Skip to content

Enlighten SignFile task for multithreaded mode #13618

@jankratochvilcz

Description

@jankratochvilcz

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

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