Skip to content

Install runtimes to DOTNET_GLOBAL_INSTALL_DIR when set#16764

Merged
AndriySvyryd merged 3 commits intomainfrom
copilot/fix-runtimes-installation-path
Apr 29, 2026
Merged

Install runtimes to DOTNET_GLOBAL_INSTALL_DIR when set#16764
AndriySvyryd merged 3 commits intomainfrom
copilot/fix-runtimes-installation-path

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

This is a follow up to #16686

InstallDotNetCore.targets hardcoded the runtime install path to $(RepoRoot).dotnet, so runtimes declared in global.json's tools.runtimes were always installed locally even when DOTNET_GLOBAL_INSTALL_DIR directed the SDK elsewhere. Additionally, the eng/common/dotnet-install.{sh,ps1} wrapper scripts hardcoded the install root to ${RepoRoot}/.dotnet, so even after wiring _DotNetPath into the task's pre-check, runtimes would still be physically installed locally — causing the pre-check to miss them and trigger repeated installs on subsequent builds.

  • Plumb DOTNET_GLOBAL_INSTALL_DIR into the InstallDotNetCore task's DotNetPath, falling back to $(RepoRoot).dotnet when unset.
  • Update eng/common/dotnet-install.sh and eng/common/dotnet-install.ps1 to install runtimes into DOTNET_GLOBAL_INSTALL_DIR when set, falling back to ${RepoRoot}/.dotnet. This matches the existing SDK install path logic in tools.sh/tools.ps1 and ensures the install root matches _DotNetPath so the pre-check correctly identifies already-installed runtimes.

To double check:

Copilot AI and others added 2 commits April 28, 2026 19:00
…me install path

Agent-Logs-Url: https://github.com/dotnet/arcade/sessions/834bab13-74c2-4704-be4e-c66f62f68e0f

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to ensure runtimes specified under global.jsontools.runtimes are installed into DOTNET_GLOBAL_INSTALL_DIR (when set), instead of always installing into the repo-local .dotnet folder.

Changes:

  • Adds an MSBuild _DotNetPath property that prefers $(DOTNET_GLOBAL_INSTALL_DIR) and falls back to $(RepoRoot).dotnet.
  • Wires _DotNetPath into the InstallDotNetCore task via its DotNetPath parameter.

Comment thread src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@AndriySvyryd AndriySvyryd marked this pull request as ready for review April 28, 2026 20:35
@AndriySvyryd AndriySvyryd requested a review from mmitche April 28, 2026 20:36
@AndriySvyryd AndriySvyryd enabled auto-merge (squash) April 29, 2026 01:07
@AndriySvyryd AndriySvyryd merged commit 3ed6c23 into main Apr 29, 2026
13 checks passed
@AndriySvyryd AndriySvyryd deleted the copilot/fix-runtimes-installation-path branch April 29, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants