Make the version suffix a valid semver pre-release identifier - #123
Open
Arshia001 wants to merge 1 commit into
Open
Make the version suffix a valid semver pre-release identifier#123Arshia001 wants to merge 1 commit into
Arshia001 wants to merge 1 commit into
Conversation
EDGE_VERSION_SUFFIX was a bare 7-char short SHA. When that SHA happens to be all digits with a leading zero, it is a *numeric* semver pre-release identifier, and semver forbids leading zeros on those — so the string is not merely unusual, it is invalid. This fired for the first time on 0692402 (#121), whose short SHA is 0692402. publish-nightly reached `wasmer publish` — the first time it had ever got that far, after 37b039c fixed the ./etc manifest bug — and was rejected at argument parsing: error: invalid value '0.0.0-0692402' for '--version <PACKAGE_VERSION>': invalid leading zero in pre-release identifier Re-running cannot help, since the same commit always yields the same SHA. It needs the short SHA to be all digits *and* start with zero, roughly 1 commit in 270, which is why every previously published version (0.0.0-ad307e3, 0.0.0-8f4b341, 0.0.0-5ad7db6, 0.0.0-20bd0b8) got away with it. Prefix the suffix with "g", following the git-describe convention, so it is always alphanumeric and can never be parsed as a numeric identifier. Fixing it here rather than sanitizing in the workflow keeps process.versions.edge itself valid semver — both nightly workflows derive the published version from that value, and EDGE_DEFAULT_WASMER_PACKAGE (src/edge_compat_exec.cc) pins wasmer/edgejs@=EDGE_VERSION_STRING from the same macro, so the published version and the runtime pin shift together. Versions now read 0.0.0-g<sha> instead of 0.0.0-<sha>. No test asserts the old shape. Verified against wasmer 7.2.0, the version CI installs: 0.0.0-0692402 -> rejected, invalid leading zero 0.0.0-g0692402 -> accepted 0.0.0-gf1d02e4 -> accepted and by running the edited CMake block, which yields SUFFIX=-gf1d02e4. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The bug
EDGE_VERSION_SUFFIXis a bare 7-char short SHA (CMakeLists.txt:35). When that SHA happens to be all digits with a leading zero, it parses as a numeric semver pre-release identifier — and semver forbids leading zeros on those. The version isn't merely unusual, it's invalid.This fired for the first time on 0692402 (#121), short SHA
0692402.publish-nightlyreachedwasmer publish— the first time it had ever got that far, after 37b039c fixed the./etcmanifest bug — and was rejected at argument parsing:Re-running can't help: the same commit always yields the same SHA. It needs the short SHA to be all digits and start with zero — roughly 1 commit in 270 — which is why every previously published version (
0.0.0-ad307e3,0.0.0-8f4b341,0.0.0-5ad7db6,0.0.0-20bd0b8) got away with it.The fix
Prefix with
g, git-describe convention, so the identifier is always alphanumeric and can never be parsed as numeric.Fixing it in CMake rather than sanitizing in the workflow keeps
process.versions.edgeitself valid semver. That matters because it's the single source of truth in three places:test-and-build-quickjs.yml:302,test-and-build.yml:302)EDGE_DEFAULT_WASMER_PACKAGE(src/edge_compat_exec.cc:28) pinswasmer/edgejs@=EDGE_VERSION_STRINGfrom the same macroSo the published version and the runtime pin shift together and stay consistent.
Behavior change
Versions now read
0.0.0-g<sha>instead of0.0.0-<sha>. No test asserts the old shape. The registry will carry both forms across the cutover; already-published versions are untouched.Test
Against wasmer 7.2.0 — the version CI installs — reproducing the parse-time rejection offline:
And running the edited CMake block against the current tree:
Context
Third distinct blocker in the chain that has kept nightlies red since 2026-06-30 — after the
./etcmanifest bug (#120) and the gatsby external-fetch flake (#121). Note that #122 landing already givesmaina letter-containing SHA (f1d02e4), so the next nightly would publish regardless. This PR is what stops it recurring on some future unlucky commit.🤖 Generated with Claude Code