Repository navigation
perf: keep the build identity out of sqlbuild-rules so edits stop rebuilding it - #1510
Merged
Merged
Conversation
…uilding it The source hash that keys local caches was a compile-time constant in sqlbuild-rules, whose build script hashes every workspace crate. Any source edit therefore rebuilt sqlbuild-rules and every crate above it, and the constant changed the same codegen units of the extension on every build. The hash now lives in a leaf crate, sqlbuild-build-identity, behind one non-inlined accessor. sqb and the extension install it into sqlbuild-rules at startup through sqlbuild-cli; reading it before then fails instead of falling back. Cache keys and BUILD_IDENTITY keep the same value.
kvlonge
enabled auto-merge
November 16, 2026 05:59
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 16, 2026
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.
Why
The source hash that keys local caches and rule fingerprints was a compile-time constant in
sqlbuild-rules. Its build script hashes every workspace crate, so any source edit rebuiltsqlbuild-rules, thensqlbuild-python-base,sqlbuild-cliandsqlbuild-python. The constant was also inlined into a few extension codegen units that changed on every build, and thin-local LTO then re-optimised about 100 of 256 objects for a one-line edit. Each later binding-crate split would add to it.Changes
sqlbuild-build-identity: the unchanged build script plus one#[inline(never)]accessor. Onlysqlbuild-clidepends on it;sqlbuild-pythonreaches it throughsqlbuild-cli.sqlbuild-rulesholds the identity in a process-wide cell.sqb(run_launcher) and the_nativemodule install it at startup. Reading it before then panics with the reason, never a default; empty or conflicting installs are refused._native.BUILD_IDENTITYkeep the same value.No DuckShop case applies: only how the build identity reaches the rules engine changes, not compiler behaviour.
Verification
Incremental rebuild after a one-literal edit in
sqlbuild-python(cargo build -p sqlbuild-python --profile fast), main and this branch alternating on one 8-core machine, 3 edit locations × 2 runs, load 3.7–5.5:_nativeobjects rebuiltcargo -vnow rebuilds onlysqlbuild-build-identity,sqlbuild-cliandsqlbuild-python.sqlbuild-rules,sqlbuild-build-identity,sqlbuild-cli,sqlbuild-pythonlib; rule engine and macro bridge Python tests.fensu check, layering, build-features and boundary checks, clippy;make testandmake check-ci.