feat: make binary download (theseus) opt-in rather than a default feature - #257
Draft
eljefedelrodeodeljefe wants to merge 1 commit into
Draft
eljefedelrodeodeljefe wants to merge 1 commit into
eljefedelrodeodeljefe wants to merge 1 commit into
Conversation
Remove `theseus` from the default feature set of both `postgresql_embedded` and `postgresql_archive`. With defaults, the crate previously downloaded and executed PostgreSQL binaries from GitHub releases at runtime — a behaviour a consumer should have to ask for, not one they get for free. Two reasons this belongs in the default set rather than in a consumer's own `default-features = false`: 1. Cargo feature unification. A consumer that disables the feature is silently overridden the moment any other crate in their dependency graph pulls this one with default features. A disabled default is a "works today" property; a non-default feature is a guarantee. 2. Runtime download-and-execute of binaries is a supply-chain surface, and `api.github.com` is unauthenticated-rate-limited — under CI or a shared egress it fails late with an HTTP 403 that reads like an outage rather than a configuration problem. Making it explicit means the consumer who enables it also knows to expect that. Migration: consumers who relied on default downloading add `"theseus"` to their feature list. `bundled`, `zonky`, and `github` are unaffected — they were never default.
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.
Summary
Removes
theseusfrom the default feature set ofpostgresql_embeddedandpostgresql_archive. With default features, the crates currently download and execute PostgreSQL binaries from GitHub releases at runtime. This change makes that behaviour explicit opt-in.Two lines of
Cargo.tomleach, plus a changelog entry. No code changes;theseusitself is untouched and works exactly as before when enabled.Why
1.
default-features = falsecannot serve as a guarantee. Cargo feature unification means that if any crate in a consumer's dependency graph pulls inpostgresql_embeddedwith default features, the downloader is re-enabled for every consumer in that graph — silently, with no diagnostic. A consumer who has deliberately disabled it has no way to defend against this except auditing every transitive dependency on every update. Only a non-default feature gives that consumer an actual guarantee.2. Runtime download-and-execute of binaries is a supply-chain surface a consumer should have to ask for. This isn't a judgement on
theseus— it's the right default for a getting-started experience, and nothing here removes it. It's a judgement on defaults: fetching and running an executable from the network is the kind of thing that should appear in a consumer'sCargo.tomlwhere a reviewer can see it.3. It fails badly in the environments where it most often runs unexpectedly.
api.github.comis unauthenticated-rate-limited. Under CI, or behind a shared egress IP, a consumer who never intended to download anything gets an HTTP 403 partway through an unrelated test run, reading like an outage. Making the download explicit means the consumer who enabled it also knows to expect that failure mode.Migration
Consumers relying on default downloading add
"theseus"to their feature list:bundled,zonky, andgithubare unaffected — none were default.Context
We run this crate as the embedded store for a self-hosted service and needed the downloader provably absent from the compiled binary, not merely disabled. We've verified the change compiles both with defaults (no archive provider) and with
theseusexplicitly enabled, on bothmainandv0.20.2. Happy to adjust the changelog wording, split the two crates into separate PRs, or add anything else that would make this easier to take.