Repository navigation
fix(build): read tip version from tarball VERSION file - #165
Merged
Merged
Conversation
Nightly builds fail because the tip version is parsed by splitting the tarball's top-level directory on hyphens and taking fields 2-4: ghostty-1.3.2-main+5b435d5/build.zig.zon.txt -> 1.3.2-main+5b435d5-build.zig.zon.txt Upstream changed the tip version scheme from `main-<hash>` to semver build metadata `main+<hash>` (Config.zig: .pre = branch, .build = short_hash), so the commit hash merged into the branch field and field 4 became the file name. This cascaded into `cat ghostty-<bogus>/build.zig.zon` failing (leaving ZIG_VERSION empty and Zig skipped) and then `cd ghostty-<bogus>` failing. Ghostty embeds a canonical VERSION file at <tarball-root>/VERSION, so read the version directly from it instead of parsing the directory name. Fail fast if detection yields an empty value, and use --no-wildcards-match-slash so only the top-level VERSION is matched. Failing run: https://github.com/pkgforge-dev/ghostty-appimage/actions/runs/36660278577
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.
Problem
Nightly (tip) builds started failing:
Failing run: https://github.com/pkgforge-dev/ghostty-appimage/actions/runs/36660278577
Root cause
The tip version was parsed by splitting the tarball's top-level directory on hyphens and taking fields 2–4:
Upstream changed the tip version scheme from
main-<hash>to semver build metadatamain+<hash>(Config.zig:.pre = branch,.build = short_hash). The hash merged into the branch field, so field 4 became the file name and produced an invalid version.This cascaded into
cat ghostty-<bogus>/build.zig.zonfailing (leavingZIG_VERSIONempty and printing the misleadingZig is already installed), thencd ghostty-<bogus>failing underset -e.Fix
Ghostty embeds a canonical
VERSIONfile at<tarball-root>/VERSION, so read the version directly from it instead of parsing the directory name. Also fail fast on empty detection, and use--no-wildcards-match-slashso only the top-levelVERSIONis matched (nested files can never leak in).Verification
1.3.2-main+26e64df, matching the extracted directory.VERSIONwrite → extract →cdtarget exists →ZIG_VERSION=0.16.0.sh -nand pre-commit (shellcheck, shfmt) pass.