Skip to content

Enable ILLink task for MSBuild multithreaded execution - #138231

Open
sbomer wants to merge 5 commits into
mainfrom
sbomer/illink-task-multithreading
Open

sbomer wants to merge 5 commits into
mainfrom
sbomer/illink-task-multithreading

Conversation

@sbomer

@sbomer sbomer commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

This opts the ILLink task into MSBuild's multithreaded execution mode with [MSBuildMultiThreadableTask]. Without the attribute, -mt builds run the task out of process in a TaskHost. The task now reads DOTNET_HOST_PATH and resolves paths through TaskEnvironment instead of process-global state. The shared invocation cache behind CachedToolTask also takes its environment variables (ILLINK_EXPERIMENTAL_CACHE*, XDG_CACHE_HOME, HOME) and base directory from the task environment.

TaskEnvironment requires MSBuild 18.7.1, which is the version the VMR root already uses. This bumps the repo's MicrosoftBuild*Version properties from 17.11.48 to 18.7.1 and updates the related toolset dependency versions to match. The PackageDownloadAndReference items move from ref/net8.0 to ref/net10.0. Other tasks that share these properties, such as WasmAppBuilder, also pick up the newer reference.

Like Roslyn's Csc migration (dotnet/roslyn#84701), relative paths in the ILLink command line are passed through unchanged. ToolTask starts the tool in the project directory under -mt, so they resolve the same way as before. The invocation cache key now includes that working directory instead of the process current directory.

Note

This PR description was drafted with assistance from GitHub Copilot.

sbomer and others added 3 commits October 2, 2026 16:58
Use task-local environment and project paths while preserving task parameter types. Update shared MSBuild references and their toolset dependencies to the supported 18.7.1 minimum, preserving the .NET 8 workload-task references.

Assisted-by: GitHub Copilot CLI:gpt-6-astra
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5fab3b2c-1cfb-4a7f-985d-d133d4a47f99
…ltithreading

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5fab3b2c-1cfb-4a7f-985d-d133d4a47f99
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5fab3b2c-1cfb-4a7f-985d-d133d4a47f99
@github-actions github-actions Bot added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Nov 24, 2026
@dotnet-policy-service dotnet-policy-service Bot added the linkable-framework Issues associated with delivering a linker friendly framework label Nov 24, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/illink
See info in area-owners.md if you want to be subscribed.

Match Roslyn's Csc migration (dotnet/roslyn#84701): leave relative paths in
the ILLink command line unchanged, since ToolTask starts the tool in the
project directory under -mt. Include the tool's working directory in the
invocation cache key instead of the process current directory.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5fab3b2c-1cfb-4a7f-985d-d133d4a47f99

@jtschuster jtschuster left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache and ILLink changes look good to me.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5fab3b2c-1cfb-4a7f-985d-d133d4a47f99

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Tools-ILLink .NET linker development as well as trimming analyzers linkable-framework Issues associated with delivering a linker friendly framework

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants