Repository navigation
feat(image): bake a sha256-pinned prebuilt DuckDB shared library into the Rust sandbox variant - #233
Closed
debuggingfuture wants to merge 2 commits into
Closed
debuggingfuture wants to merge 2 commits into
debuggingfuture wants to merge 2 commits into
Conversation
… the Rust sandbox variant
…LIB_DIR's precedence
Member
Author
|
Folded into #235, which now carries ADR-0007 in full. |
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
WITH_RUSTvariant ofinfra/Dockerfile.sandbox-demo(RunSandbox) ships DuckDB's prebuiltlibduckdb.soand headers under/opt/duckdb, so a consumer that links DuckDB skips the C++ compile that dominates a coldcargo test.ARG DUCKDB_VERSION=v1.5.5pins the release; thelibduckdb-linux-amd64.zipasset is verified withsha256sum -c(digest matches the one GitHub publishes for the asset). Other architectures fail the build.DUCKDB_LIB_DIR/DUCKDB_INCLUDE_DIRare exported, and an/etc/ld.so.conf.d/duckdb.confentry puts the library on the loader path for every exec user, so a linked build both links and runs. The build assertsldconfig -presolveslibduckdb.so.build_linked, compiled under#[cfg(not(feature = "bundled"))]; abundledbuild ignores them. Its linked path emitsrustc-link-searchanddylib=duckdbbut nothing for runtime loading, which the ldconfig entry covers.duckdbwithoutbundledin CI, assert the loaded library version at startup, move the crate pin withDUCKDB_VERSION) is documented on the layer and in the RunSandbox comment inwrangler.jsonc.DUCKDB_LIB_DIRtakes precedence overDUCKDB_DOWNLOAD_LIB=1; a consumer whose crate pin differs fromDUCKDB_VERSIONunsets it in its run command.Spec:
specs/adr/0007-cost-efficient-execution.md, "Prebuilt heavy native dependencies in the image" (#232). The ADR names the lean sandbox image; the layer ships in theWITH_RUSTvariant ofinfra/Dockerfile.sandbox-demoinstead, because RunSandbox is the only class with a Rust toolchain to build a linked consumer, andinfra/Dockerfile.sandboxsetsWITH_RUSTfor no class.Testing:
pnpm install --frozen-lockfile,pnpm lint,pnpm typecheck,pnpm test(205 files, 2814 passed, 1 skipped) pass. The asset digest matches the one GitHub publishes forlibduckdb-linux-amd64.zipv1.5.5, and thelibduckdb-sys1.10505.0build.rsbehavior above is read from the published crate. Not yet run: an image build of the layer and a linkedcargo buildagainst it; no PR CI builds images, so the first build is the deploy onmainunless one runs before merge.