Skip to content

build.sh SDK bootstrap tells you what's actually missing - #2118

Merged
NickJosevski merged 1 commit into
mainfrom
nj/build-sh-bootstrap-diagnostics
Aug 7, 2026
Merged

build.sh SDK bootstrap tells you what's actually missing#2118
NickJosevski merged 1 commit into
mainfrom
nj/build-sh-bootstrap-diagnostics

Conversation

@NickJosevski

@NickJosevski NickJosevski commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Background

build.sh uses the machine's dotnet if dotnet --version succeeds, and otherwise downloads an
SDK. That fallback shells out to curl and perl.
Neither is guaranteed in our Linux containers, so you get:

./build.sh: line 27: perl: command not found
Process exited with code 127

Changes

  1. Log why the bootstrap ran => on error list SDKs
  2. Use wget when no curl ==> or says if can't find either
  3. Use sed when no perl

Testing

Environment Before After
amazonlinux:2 (curl, no perl) perl: command not found, exit 127 bootstrap completes
debian:12 + wget (no curl) curl: command not found, exit 127 bootstrap completes
neither curl nor wget curl: command not found, exit 127 Unable to download … - neither curl nor wget is available, exit 1
SDK 8 present, global.json pins 10.0.302 exit 127 from a missing tool 'dotnet --version' failed - global.json likely pins an SDK that is not installed (found: 8.0.423)

🤖 Generated with Claude Code

@NickJosevski NickJosevski changed the title Make the build.sh SDK bootstrap diagnosable, and stop assuming curl and perl build.sh SDK bootstrap tells you what's actually missing Aug 6, 2026
@NickJosevski
NickJosevski force-pushed the nj/build-sh-bootstrap-diagnostics branch 2 times, most recently from 7af87ed to c86d38c Compare August 6, 2026 07:10
@NickJosevski
NickJosevski marked this pull request as draft August 6, 2026 08:16
@NickJosevski
NickJosevski marked this pull request as ready for review August 6, 2026 08:42

@zentron zentron 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.

nice, ive seen that once or twice before but not spent enough time looking at it. Thanks Claude @NickJosevski

…nd perl

build.sh uses the machine's dotnet if `dotnet --version` succeeds, and otherwise
downloads an SDK. That fallback shells out to curl and perl, neither of which is
guaranteed in our Linux execution containers, so the first symptom is an opaque
`exit 127` from a missing tool.

That misleads twice over: reaching the fallback at all means `dotnet --version`
failed, which is almost always global.json pinning an SDK the machine does not
have. The "command not found" points away from the cause.

- Log why the bootstrap ran, and list the SDKs that are installed
- Use wget when curl is absent; name the problem when neither exists
- Use sed when perl is absent

Verified with the SDK install stubbed, in the containers that actually broke:
amazonlinux:2 (curl, no perl) and debian:12 +wget (no curl) now complete the
bootstrap instead of exiting 127; with neither downloader present it fails with
a named error; and SDK 8 against a global.json pinning 10.0.302 now reports
"global.json likely pins an SDK that is not installed (found: 8.0.423)".

The sed fallback returns 8.0.419 for this repo's global.json, matching perl. A
machine that already satisfies global.json still skips the bootstrap entirely.

Deliberately out of scope: the hardcoded DOTNET_CHANNEL="8.0" (belongs with the
.NET 10 work), and build.ps1 (Windows ships curl.exe and needs no perl).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@NickJosevski
NickJosevski force-pushed the nj/build-sh-bootstrap-diagnostics branch from c86d38c to 7cf717b Compare August 7, 2026 01:58
@NickJosevski
NickJosevski enabled auto-merge August 7, 2026 01:59
@NickJosevski
NickJosevski merged commit 10f5281 into main Aug 7, 2026
29 checks passed
@NickJosevski
NickJosevski deleted the nj/build-sh-bootstrap-diagnostics branch August 7, 2026 04:25
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