fix(install): fix nightly digest extraction on macOS#331
Merged
Conversation
The install script's Step 4 used `sed 's/},{/}\n{/g'` to split OCI
manifest layers onto separate lines before extracting the blob digest
with awk. This had two bugs:
1. **macOS (BSD sed)**: `\n` in the replacement string is treated as
a literal backslash + 'n', not a newline. The entire manifest stays
on one line, so awk always matches the config's empty-JSON digest
(`sha256:44136fa...`) instead of the layer digest. This affected
ALL platforms when installing from macOS.
2. **First layer**: Even with GNU sed, the first layer
(`darwin-arm64`) stays on the same line as the config block because
the layers array starts with `[{`, not `},{`. The awk script finds
the config digest first and exits. This affected darwin-arm64 on
all platforms.
The result: downloading a 2-byte empty JSON blob (`{}`) instead of
the ~23 MB binary, causing `gunzip: (stdin): unexpected end of file`.
Fix: Replace the sed+awk pipeline with a single awk pass that tracks
the last-seen `"digest"` value and prints it when the target filename
is found in `"org.opencontainers.image.title"`. This works on both
GNU and BSD awk, requires no sed, and correctly handles all layer
positions.
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Trace
Other
Bug Fixes 🐛Api
Formatters
Install
Setup
Other
Internal Changes 🔧Api
Other
🤖 This preview updates automatically when you update the PR. |
BYK
added a commit
that referenced
this pull request
Mar 4, 2026
## Summary Add fire-and-forget error reporting to the install script via Sentry's envelope API. Uses the CLI's existing public write-only DSN — no new secrets or projects needed. This would have caught the macOS digest extraction bug (#331) automatically. ## Changes - `report_error()` — builds a minimal Sentry envelope and sends it via background `curl` (2s timeout, never blocks installation) - `die()` — replaces all 11 `echo + exit 1` patterns with error reporting + exit - `ERR` trap — catches unexpected `set -e` / `pipefail` exits like the gunzip pipeline failure that triggered #331 - UUID generation with fallback chain: `/proc` → `uuidgen` → `awk` - Opt-out via `SENTRY_CLI_NO_TELEMETRY=1` (same as the CLI binary) Each error event is tagged with `os`, `arch`, `channel`, `step`, `install.version`, and bash version for quick triage.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The nightly install script fails on macOS with:
The OCI manifest digest extraction in Step 4 used
sed 's/},{/}\\n{/g'tosplit layers onto separate lines before awk extracted the digest. This had
two bugs:
\\nas literal characters, not a newline —the manifest stays on one line and awk always finds the config digest
(
sha256:44136fa..., a 2-byte empty{}blob) instead of the binary.block because the array starts with
[{, not},{.The result: downloading 2 bytes of
{}instead of the ~23 MB compressedbinary.
Changes
Fix digest extraction (commit 1)
Replace the
sed+awkpipeline with a singleawkpass that tracksthe last-seen
"digest"value and prints it when the target filenamematches in
"org.opencontainers.image.title". Nosedneeded, workson both GNU and BSD awk.
Add install error telemetry (commit 2)
Reports install failures to the CLI's existing Sentry project so we
catch issues like this automatically. Uses the same public write-only
DSN already baked into every CLI binary.
report_error()— builds a Sentry envelope and fires a backgroundcurl(fire-and-forget, 2s timeout, never blocks installation)die()— replaces allecho + exit 1patterns with error reportingERRtrap — catches unexpectedset -e/pipefailexits (e.g.,the gunzip failure that triggered this issue)
os,arch,channel,step,install.versionSENTRY_CLI_NO_TELEMETRY=1(same as the CLI binary)