Skip to content

Run gzip directly in BuildDockerImages instead of through pwsh - #2154

Merged
NickJosevski merged 1 commit into
mainfrom
nj/docker-gzip-without-pwsh
Sep 8, 2026
Merged

Run gzip directly in BuildDockerImages instead of through pwsh#2154
NickJosevski merged 1 commit into
mainfrom
nj/docker-gzip-without-pwsh

Conversation

@NickJosevski

@NickJosevski NickJosevski commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Build: Docker images failing... but why now...

BuildDockerImages launched pwsh for one thing — running gzip on the OCI tar. The agent's pwsh is a dotnet global tool needing .NET 10, while build.sh bootstraps a .NET 8-only SDK into .nuke/temp/dotnet-unix and puts it on PATH:

App: /root/.dotnet/tools/pwsh
Framework: 'Microsoft.NETCore.App', version '10.0.0' (x64)
.NET location: .../.nuke/temp/dotnet-unix
The following frameworks were found:
  8.0.30

Why it started failing on 2026-09-07: the nautilus-linux agent image changed between the last green build (24081109, Sep 3) and the first red one (24122436, Sep 7) — bash 5.1.4 -> 5.2.21, and the system SDK it reports went 6.0.428 -> 10.0.400. Both logs show the same ./build.sh BuildDockerImages and the same net8 SDK bootstrap, BuildDockerImages.xml is untouched in the settings diff between the two builds, and no Calamari commit landed in that window. The agent's pwsh is the only variable that moved.

So: call gzip directly. This was the build's only use of PowerShellTasks.

Also stops a silent failure — pwsh -Command exits 0 regardless of the native exit code, so a failed gzip used to surface later as a missing artifact in PublishArtifacts. A Nuke Tool asserts a zero exit code.

Verified locally /usr/bin/gzip from PATH, -k still keeps the .tar next to the .gz, and a forced failure throws ProcessException: Process 'gzip' exited with code 1.

🤖 Generated with Claude Code

BuildDockerImages launched PowerShell for exactly one thing: running
`gzip -k -9 -f` on the OCI tar. That made the step depend on whichever .NET
runtime the agent's `pwsh` global tool was built against, and on main's build
agent those no longer line up:

    App: /root/.dotnet/tools/pwsh
    Framework: 'Microsoft.NETCore.App', version '10.0.0'
    .NET location: .../.nuke/temp/dotnet-unix
    The following frameworks were found:
      8.0.30

The agent's `pwsh` needs .NET 10, and the only runtime on offer is the .NET 8
SDK that build.sh bootstraps into .nuke/temp and puts on PATH. Calling gzip
directly removes pwsh from the equation. This was the build's only use of
PowerShellTasks, so nothing else in the build cares about the agent's pwsh now.

Failures also surface properly. `pwsh -Command` exits 0 regardless of the
native exit code, so a failed gzip used to show up later as a confusing
missing-artifact error from PublishArtifacts. A Nuke Tool asserts a zero exit
code, so it now fails at the gzip call with gzip's stderr attached.

Verified with a throwaway target: resolves /usr/bin/gzip from PATH, arguments
pass through intact, -k keeps the .tar alongside the .gz, and a deliberate
failure raises `ProcessException: Process 'gzip' exited with code 1`.

Not addressed here: reaching the SDK bootstrap at all means `dotnet --version`
failed, so the agent no longer satisfies global.json's 8.0.419 pin. That costs
every build a full SDK download and belongs with the .NET 10 work.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@APErebus APErebus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a much better way of invoking it. I didn't have enough Nuke knowledge to know how to invoke tools directly

@NickJosevski
NickJosevski merged commit edee954 into main Sep 8, 2026
29 checks passed
@NickJosevski
NickJosevski deleted the nj/docker-gzip-without-pwsh branch September 8, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants