Skip to content

build: pin internal crate versions so releases stop recompiling every crate - #1302

Merged
kvlonge merged 1 commit into
mainfrom
build/pin-internal-crate-versions
Nov 4, 2026
Merged

kvlonge merged 1 commit into
mainfrom
build/pin-internal-crate-versions

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Why

A crate's version is part of its Cargo build identity. Release Please bumped the shared [workspace.package] version, so every release recompiled all 21 crates. That cost was paid after each release by every local checkout and by fresh orb setup.

Changes

  • The workspace version is fixed at 0.0.0. Only sqlbuild-cli and sqlbuild-python carry the release version. Release Please now bumps those two manifests, and the release allowlists in verify.yml and release-please.yml match.
  • Lower crates no longer read CARGO_PKG_VERSION:
    • Built-in Rules use NATIVE_BUILD_IDENTITY as their implementation fingerprint.
    • NATIVE_BUILD_IDENTITY is now the source hash alone. That hash covers the release manifests, so it still changes with every release.
    • The Recall schema version row records a producer_version passed in through DdlOptions.
  • The native layering check now verifies the two release crate versions. It fails if a lower crate reads CARGO_PKG_VERSION.

rules, refactor, project, cli and python still rebuild on each release, because the build identity hashes the release manifests. The other 16 crates stay compiled.

DuckShop needs no case: this changes build and release metadata, not project shapes, data or lifecycles.

Verification

  • Same-orb release bump, 3 alternating runs each: median 220.6s wall / 1101s CPU before, 114.7s / 444s after.
  • make check-ci passes. cargo test -p sqlbuild-recall -p sqlbuild-rules passes. Reverting the Recall row to the crate version fails the new DDL assertion.
  • A simulated release PR, with both crates bumped and the lockfiles refreshed, passes check_native_layering, Verify's metadata-only detection and the release allowlist.
  • sqb --version reports 0.187.3, and the Recall --ddl integration test now checks the installed release version.

… crate

A crate's version is part of its Cargo build identity, so the shared
release version in [workspace.package] recompiled all 21 crates after
every release. Only sqlbuild-cli and sqlbuild-python now carry the
release version; the others inherit a fixed 0.0.0.

Lower crates that read CARGO_PKG_VERSION now take the release from the
release crates: the built-in Rules fingerprint uses the native build
identity, and the Recall schema version row records the producer
version passed in through DdlOptions. The native layering check fails if
a lower crate reads CARGO_PKG_VERSION again.
@kvlonge
kvlonge enabled auto-merge (squash) November 4, 2026 13:24
@kvlonge
kvlonge merged commit 94a5094 into main Nov 4, 2026
84 of 86 checks passed
@kvlonge
kvlonge deleted the build/pin-internal-crate-versions branch November 4, 2026 14:30
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