Skip to content

fix(release): stamp Cargo.toml's version from the release tag - #83

Merged
kylehgc merged 1 commit into
developfrom
fix/stamp-version-from-tag
Aug 1, 2026
Merged

kylehgc merged 1 commit into
developfrom
fix/stamp-version-from-tag

Conversation

@kylehgc

@kylehgc kylehgc commented Aug 1, 2026

Copy link
Copy Markdown
Owner

The first fork RC published as fork-dev-0.1.0-rc.9 and shipped:

rtk-0.42.4-1.x86_64.rpm
rtk_0.42.4-1_amd64.deb

Cargo.toml on develop carries whatever release-please last wrote on master, and nothing updates it for an RC. So rtk --version reports 0.42.4, telemetry records 0.42.4, and both packages are named for it.

Why this matters more for a fork

Upstream behaves identically — their dev-0.44.2-rc.344 ships the same rtk_0.42.4-1_amd64.deb filename. For them it's confusing. For us it's a collision: our artifact's name and version are byte-identical to upstream's own RC artifact, so two different binaries share one package identity. The fork- tag prefix exists precisely to prevent that, and the packages were left colliding.

Fix

CARGO_PKG_VERSION feeds --version, telemetry, cargo-deb, and cargo-generate-rpm. Stamping it once before each build fixes all four, rather than patching each consumer.

fork-dev-0.1.0-rc.9 → 0.1.0-rc.9, which is valid semver.

Verified

scripts/version-from-tag.sh --test    all 5 tag forms derive correctly
stamp diff                            line 3 only; clap = "4", serde = "1" untouched
cargo metadata                        rtk 0.1.0-rc.9  — cargo accepts the prerelease
grep --locked .github/workflows/      none, so the stale lockfile self-heals
Cargo.toml deb/rpm assets             not version-templated

Not verified locally: the resulting .deb/.rpm filenames — that needs cargo-deb on Linux. The next RC's published assets will show them, and that's the check worth watching after merge.

Classification

Original fix, not Fork Infrastructure — upstream has the same bug and can hold the fix. The Upstream PR is deferred by maintainer decision to avoid flooding upstream while the benchmark PR is in review. Recorded as owed in CONTEXT.md under "Deferred Upstream PRs" and tracked separately, so it does not silently become permanent divergence.

Deliberately not done

Renaming the package to rtk-fork. It would fix identity but break the drop-in-replacement property that is the fork's whole pitch — a visitor should install this instead of rtk, not alongside it.

The first fork RC published as fork-dev-0.1.0-rc.9 and shipped:

  rtk-0.42.4-1.x86_64.rpm
  rtk_0.42.4-1_amd64.deb

Cargo.toml on develop carries whatever release-please last wrote on master, and
nothing updates it for an RC — so `rtk --version` reports 0.42.4, telemetry
records 0.42.4, and both packages are named for it.

Upstream behaves identically (their dev-0.44.2-rc.344 ships the same 0.42.4
filenames), but for a fork it is worse than cosmetic: our artifact's name and
version are byte-identical to upstream's own RC artifact, so two different
binaries share one package identity. The fork- tag prefix was chosen precisely
to prevent that, and the packages were left colliding.

CARGO_PKG_VERSION feeds --version, telemetry, cargo-deb and cargo-generate-rpm,
so stamping it once before each build fixes all four.

Verified rather than assumed:
- all five tag forms derive correctly (scripts/version-from-tag.sh --test)
- the stamp rewrites only line 3; clap = "4" and serde = "1" are untouched
- cargo metadata reports `rtk 0.1.0-rc.9`, so cargo accepts the prerelease form
- no workflow uses --locked, so the stale lockfile self-heals during the build
- the deb/rpm asset paths are not version-templated

Not verified locally: the resulting .deb/.rpm filenames, which need cargo-deb on
Linux. The next RC's published assets will show them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kylehgc kylehgc mentioned this pull request Aug 1, 2026
1 of 3 tasks
@kylehgc
kylehgc merged commit aa0bc39 into develop Aug 1, 2026
11 checks passed
@kylehgc
kylehgc deleted the fix/stamp-version-from-tag branch August 1, 2026 08:46
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.

1 participant