[error] Automatic version bump failed for "nuget" target: Process "dotnet" errored with code 155
STDERR: dotnet: A compatible .NET SDK was not found.
Requested SDK version: 10.0.203
global.json file: /home/runner/work/sentry-dotnet/sentry-dotnet/global.json
Installed SDKs: 8.0.127, 8.0.206, 8.0.319, 8.0.421, 9.0.117, 9.0.205, 9.0.314, 10.0.108, 10.0.204, 10.0.300
If the GitHub-hosted runner doesn't carry the specific version of .NET we're using (currently 10.0.203 but that shifts frequently) the dotnet host aborts before setversion runs.
Symptom
When the SDK pinned in
global.jsonis newer than (or otherwise absent from) the image Craft runs on, the release workflow fails duringcraft prepare→ automatic version bumping. e.g. run 26224458396 (releasing 6.5.1).Root cause
Craft (v2.26.5) invokes
dotnet setversion <version>withcwd: rootDir(the repo). That picks up ourglobal.json, which pins the .NET version (to ensure deterministic builds).If the GitHub-hosted runner doesn't carry the specific version of .NET we're using (currently
10.0.203but that shifts frequently) the dotnet host aborts beforesetversionruns.Prior occurrences
dotnet pushcraft#601 — first hit ondotnet nuget push. Fixed by spawning withcwd: '/'soglobal.jsonisn't picked up.global.jsonwhen running alldotnetcommands craft#614 — same issue ondotnet --version; thecwd: '/'workaround was applied to alldotnetinvocations insrc/targets/nuget.ts.NugetTarget.bumpVersionspawnsdotnet setversionwithcwd: rootDir, re-introducing the very pattern the previous PRs eliminated, on a new code path.Proposed fix
This really needs to be addressed in
getsentry/craft, but some options:dotnet-setversionand use the existing XML-edit fallback already implemented in the same method. It doesn't shell out todotnetat all, soglobal.jsonbecomes irrelevant. This is the cleanest fix.global.jsonaside for the duration of thedotnet setversioncall (can't usecwd: '/'here because the tool operates on the cwd).Links