Resolve dotnet for runtime-donor build when the SDK is under the user profile (fixes #90) - #100
Merged
Merged
Conversation
…der the user profile prepare-runtime-donors built the exact donors with a bare `dotnet build`, which uses whatever `dotnet` is on PATH. When the .NET SDK is installed under %USERPROFILE%\.dotnet (or ~/.dotnet) and that directory is not on PATH, the donor build failed with "No .NET SDKs were found" even though the main solution had just built with that SDK. This is the third failure reported in issue #90. Resolve dotnet the same way the script already resolves ilspycmd: prefer one on PATH, then fall back to the user-profile install. When the resolved dotnet lives in the profile install, set DOTNET_ROOT to that directory so the host discovers the SDK there, matching what IlspycmdInstaller.cs does for the tool it spawns. Use the resolved path for both donor builds. Mirrored in the shell script for Linux and macOS. Verified on Windows: with dotnet on PATH the script runs end to end and reports "Runtime donors ready", 0 build errors. With dotnet removed from PATH and only a ~/.dotnet install present, the resolver picks the profile dotnet and sets DOTNET_ROOT.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Issue #90 collects three failures from a v0.3.15 install. The csproj source/patch ownership conflict and the duplicated Optimum types (CS0433/CS0117) were already fixed on
mainin #99. This PR covers the remaining one, the runtime-donor packaging failure JimmyMac3 documented.scripts/prepare-runtime-donorsbuilds the exact runtime donors with a baredotnet build, which uses whateverdotnetis onPATH. When the .NET SDK is installed under%USERPROFILE%\.dotnet(or~/.dotnet) and that directory is not onPATH, the donor build fails withNo .NET SDKs were foundeven though the main solution just built with that same SDK. The user's workaround was to setDOTNET_ROOTandPATHbefore launching the installer.Root cause
The
dotnethost discovers SDKs relative to the host executable's own location. Adotnetpicked fromPATH(or absent) does not see an SDK that lives under the user profile. The script already resolvesilspycmdwith a PATH-then-profile fallback, butdotnetwas left as a bare PATH lookup.Fix
Resolve
dotnetthe same way the script resolvesilspycmd: prefer one onPATH, then fall back to the user-profile install. When the resolveddotnetlives in the profile install, setDOTNET_ROOTto that directory so the host discovers the SDK there. This matchesOptimum.Bootstrap.Core/Acquisition/IlspycmdInstaller.cs, which already setsDOTNET_ROOTfor the tool it spawns. Both donor builds use the resolved path. The change is mirrored inprepare-runtime-donors.shfor Linux and macOS.Verification (Windows)
With
dotnetonPATH,scripts/prepare-runtime-donors.ps1runs end to end, builds VSEssentials and VSSurvivalMod, and printsRuntime donors ready under .build/runtime-donorswith 0 build errors. Withdotnetremoved fromPATHand only a~/.dotnetinstall present (the reported environment), the resolver picks the profiledotnetand setsDOTNET_ROOTto~/.dotnet.bash -npasses on the shell mirror.Scope and risk
Two files, the packaging scripts only. No change to the ownership check, the patch pipeline, or the build itself. Behavior is unchanged when
dotnetis already onPATH.Fixes #90