Summary
The automatic version bumping added in #707 re-introduces the global.json pickup problem that #601 and #614 previously eliminated for the nuget target.
|
const result = await spawnProcess( |
|
NUGET_DOTNET_BIN, |
|
['setversion', newVersion], |
|
{ cwd: rootDir }, |
|
{ enableInDryRunMode: true } |
|
); |
We've deliberately used DOTNET_SPAWN_OPTIONS = { cwd: '/' } elsewhere in this file to avoid this until now. I don't think that can work with setversion though, because it operates on files in cwd.
Prior occurrences
So this re-surfaces whenever the SDK pinned in global.json is newer than (or otherwise absent from) the image Craft runs on.
See linked issue in sentry-dotnet repo:
Brainstorming
- Skip
dotnet-setversion and use the existing XML-edit fallback already implemented in the same method. It doesn't shell out to dotnet at all, so global.json becomes irrelevant.
- Temporarily move
global.json aside for the duration of the dotnet setversion call (can't use cwd: '/' here because the tool operates on the cwd).
Related
Downstream tracking issue:
Summary
The automatic version bumping added in #707 re-introduces the
global.jsonpickup problem that #601 and #614 previously eliminated for thenugettarget.craft/src/targets/nuget.ts
Lines 77 to 82 in ca38805
We've deliberately used
DOTNET_SPAWN_OPTIONS = { cwd: '/' }elsewhere in this file to avoid this until now. I don't think that can work with setversion though, because it operates on files in cwd.Prior occurrences
dotnet push#601 — first hit ondotnet nuget push. Fixed by spawning withcwd: '/'soglobal.jsonisn't picked up.global.jsonwhen running alldotnetcommands #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.So this re-surfaces whenever the SDK pinned in
global.jsonis newer than (or otherwise absent from) the image Craft runs on.See linked issue in sentry-dotnet repo:
craft preparepicks up pinned SDK via global.json sentry-dotnet#5250Brainstorming
dotnet-setversionand use the existing XML-edit fallback already implemented in the same method. It doesn't shell out todotnetat all, soglobal.jsonbecomes irrelevant.global.jsonaside for the duration of thedotnet setversioncall (can't usecwd: '/'here because the tool operates on the cwd).Related
Downstream tracking issue:
craft preparepicks up pinned SDK via global.json sentry-dotnet#5250