Skip to content

perf: build the sqb binary and the extension from one set of compiled dependencies - #1179

Merged
kvlonge merged 5 commits into
mainfrom
perf/unify-build-features
Oct 20, 2026
Merged

kvlonge merged 5 commits into
mainfrom
perf/unify-build-features

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Why

The sqb binary and the extension resolved shared dependencies with different features, so every wheel build and every uv sync compiled polyglot-sql, sqlbuild-analysis, sqlbuild-rules and 34 other crates twice. On macOS, maturin's link flags for the extension forced a full second build as well.

Changes

  • New sqlbuild-build-features crate (no code) that sqlbuild-cli depends on to enable the features the extension build already resolves, for normal and build dependencies.
  • make check-build-features, run by make check-ci, compares both builds' resolved features with cargo tree on all five wheel targets and names any drift.
  • macOS wheel builds pass the extension's -undefined dynamic_lookup link flags to the sqb build so it reuses the same compiled crates; the wheel smoke test still runs sqb and sqlbuild.

Verification

  • One target directory, extension then sqb: 37 recompiled units before, 1 (sqlbuild-cli) after. sqb size unchanged (6.37 MB).
  • Verify dispatches: warm Linux install median 559 s -> 317 s; Windows 716–1,125 s -> 705 s; cold Linux 911 s -> 662 s. Wheel sqb step: Linux 499 s -> 42 s, Windows 629 s -> 7 s, macOS 617–1,265 s -> 4–16 s.
  • make check-ci, entry/parity tests, compiler differential 373/373, cargo test for the touched crates.

The sqb build resolved several dependency features differently from the
extension build, so Cargo compiled polyglot-sql, sqlbuild-analysis,
sqlbuild-rules and their dependencies twice in every wheel and uv sync.
A new code-free sqlbuild-build-features crate enables the missing features
in the sqb build, and make check-build-features fails when the two builds
drift apart again.
@kvlonge
kvlonge enabled auto-merge (squash) October 20, 2026 14:52
@kvlonge
kvlonge merged commit b4620f4 into main Oct 20, 2026
84 of 86 checks passed
@kvlonge
kvlonge deleted the perf/unify-build-features branch October 20, 2026 19:16
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