Skip to content

Regression in nuget automatic version bump breaks dotnet releases #819

@jamescrosswell

Description

@jamescrosswell

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

  1. 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.
  2. 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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    Status
    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions