Make the bundled SQLite an opt-out default feature - #3446
Open
plusky wants to merge 1 commit into
Open
Conversation
libsqlite3-sys's `bundled` feature compiles a private copy of SQLite into the rtk binary. That is the right default for the prebuilt binaries the installer ships, but it is a blocker for Linux distribution packages: a statically linked SQLite has to be tracked and rebuilt separately for every SQLite CVE, and most distribution policies forbid shipping bundled libraries outright. Move it behind a `bundled-sqlite` feature that is on by default, so nothing changes for `cargo build`, `cargo install` or the release workflow, while a packager can build with `--no-default-features` and get a binary that links the system libsqlite3 and inherits the distribution's SQLite security updates.
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.
Packaging rtk for openSUSE, and this is the one change I cannot make cleanly downstream.
rusqlite = { version = "0.31", features = ["bundled"] }statically links a private copy of SQLite into the binary. For the prebuilt binaries the installer ships that is exactly right — zero dependencies is a feature. For a distribution package it is a blocker: a bundled SQLite has to be tracked and rebuilt separately for every SQLite CVE, and most distribution policies (openSUSE, Fedora, Debian) forbid shipping bundled libraries at all.This PR moves it behind a feature that is on by default:
Nothing changes for
cargo build,cargo install,cargo generate-rpmor.github/workflows/release.yml— the default feature set still bundles. A packager builds with--no-default-featuresand gets a binary that links the systemlibsqlite3and inherits the distribution SQLite updates.Verified on openSUSE Tumbleweed (aarch64): built against the system SQLite, full test suite green (2584 passed / 0 failed), and the resulting binary resolves
libsqlite3.so.0from/lib64.Without this I have to carry a downstream patch that deletes the
bundledfeature outright, which has to be rebased on every release. Happy to rename the feature or adjust the wording if you prefer something else.