Skip to content

Migrate ResolveSDKReference to multithreaded execution #13632

@jankratochvilcz

Description

@jankratochvilcz

Background

ResolveSDKReference resolves SDK references against installed Windows / extension SDKs and emits resolved metadata items. It is one of the larger tasks (~75 KB) with substantial caching and Windows-specific logic.

Migration scope

  • Apply [MSBuildMultiThreadableTask]
  • Implement IMultiThreadableTask
  • Absolutize paths via TaskEnvironment.GetAbsolutePath() for: SDKReferences items, References items, Projects items, ResolvedSDKReferences ItemSpecs, RuntimeReferenceOnlySDKDependencies, ProjectName-derived paths
  • Use TaskEnvironment.GetEnvironmentVariable() for: any registry/SDK fallbacks invoked from ToolLocationHelper (review)
  • Use TaskEnvironment.GetProcessStartInfo() for: N/A

Known complexity factors

  • Several static readonly caches/regexes (PlatformAliases, SdkReferenceFormatRegex, s_appxSplitChar, s_defaultTargetPlatformVersion) — confirm all are immutable / thread-safe
  • Calls into ToolLocationHelper and SDK manifest parsing — those helpers may consume process env (PATH, registry) outside TaskEnvironment
  • Windows-only main path; NativeMethodsShared.IsWindows early-out
  • Emits many [Output] ItemGroups derived from ItemSpecs — preserve original-form (Sin 1)

Exit criteria

  • Build clean, no new warnings
  • Existing tests pass
  • No regression in error message paths (Sin 2 audit)
  • No leakage of absolutized paths into [Output] properties (Sin 1 audit)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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