Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install .NET SDKs as specified by repo's global.json files #11090

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

brettfo
Copy link
Contributor

@brettfo brettfo commented Dec 10, 2024

This PR adds new behavior behind the experiment flag nuget_install_dotnet_sdks. This experiment is not yet enabled anywhere.

The NuGet updater currently has 2 installed .NET SDKs, 8.0.404 and 9.0.100.

This PR crawls the directories specified in the job file to install the exact SDKs required by the target repo. It also adds a new helper method to run dotnet commands as a subprocess and before starting the process, it removes all MSBuild* environment variables. This is done because when a dotnet program is running, including the updater tool, it sets some variables indicating where MSBuild came from, but we don't want that in case the user has a global.json file; we instead want dotnet to rediscover the correct values. This will prevent, e.g., a 9.x SDK from trying to load 7.x MSBuild binaries.

@github-actions github-actions bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label Dec 10, 2024
@brettfo brettfo force-pushed the dev/brettfo/nuget-install-dotnet-sdks branch 3 times, most recently from e984586 to 95033a6 Compare December 11, 2024 18:01
@brettfo brettfo marked this pull request as ready for review December 11, 2024 18:24
@brettfo brettfo requested a review from a team as a code owner December 11, 2024 18:24
@brettfo brettfo force-pushed the dev/brettfo/nuget-install-dotnet-sdks branch from 95033a6 to 75e779a Compare December 16, 2024 17:31
@randhircs randhircs force-pushed the dev/brettfo/nuget-install-dotnet-sdks branch from 75e779a to 4ebd9ba Compare December 16, 2024 19:04
@randhircs randhircs merged commit be2d4c8 into main Dec 16, 2024
70 checks passed
@randhircs randhircs deleted the dev/brettfo/nuget-install-dotnet-sdks branch December 16, 2024 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants