feat(build): add defaults-without-telemetry feature alias - #2843
Open
russellb wants to merge 1 commit into
Open
Conversation
Cargo cannot subtract a single default feature, so compiling telemetry out meant `--no-default-features` plus a hand-maintained keep-list of the crate's other defaults. That keep-list was already wrong for operators: telemetry is the only default on openshell-server and openshell-driver-vm, but openshell-sandbox also defaults to `bundled-ca-roots`, so a bare `--no-default-features` silently swapped the supervisor onto the platform trust store. Add a `defaults-without-telemetry` alias to each of the three telemetry- carrying binary crates, enumerating every default except `telemetry`. Telemetry-free builds become `--no-default-features --features defaults-without-telemetry` and stay correct as the default set grows. The alias is a keep-list, not a switch. Enabling it on top of the defaults would otherwise produce a telemetry-on binary that reads as telemetry-free, so each crate root carries a `compile_error!` for the `telemetry` + `defaults-without-telemetry` combination. Add `rust:verify:defaults-without-telemetry` to guard both properties: each alias still equals its crate's defaults minus `telemetry`, and the mutual-exclusion error is wired up. The additive-misuse check matches on the `compile_error!` text rather than a nonzero exit code so it cannot pass vacuously on hosts where openshell-driver-vm fails to build for unrelated reasons. `rust:verify:telemetry-off` now builds through the alias. Signed-off-by: Russell Bryant <rbryant@redhat.com>
russellb
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
August 20, 2026 17:32
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
Adds a
defaults-without-telemetryCargo feature alias to the three binary crates that carry telemetry, so compiling telemetry out no longer means hand-maintaining a keep-list of each crate's other default features. Telemetry-free builds become--no-default-features --features defaults-without-telemetry.Related Issue
No accepted issue yet — raising this for maintainer disposition. It came out of a contributor question about whether
--no-default-featuresis a safe stand-in for "disable telemetry." It is not, and that is already a live correctness bug (see Changes), so this is filed as a PR rather than a spike. Happy to open a feature request issue first if the convention should apply here.Changes
Cargo cannot subtract a single default feature, so the documented way to compile telemetry out is
--no-default-featuresplus every other default re-added by hand. That keep-list is already wrong for operators:default--no-default-featuresalso dropsopenshell-server["telemetry"]openshell-driver-vm["telemetry"]openshell-sandbox["telemetry", "bundled-ca-roots"]bundled-ca-rootsFollowing the README today therefore silently swaps the supervisor from bundled Mozilla roots onto the platform trust store. The alias fixes that and stays correct as the default set grows.
defaults-without-telemetrytoopenshell-server,openshell-sandbox, andopenshell-driver-vm, each enumerating its defaults minustelemetry.compile_error!in each crate root fortelemetry+defaults-without-telemetry. The alias is a keep-list, not a switch — without the guard,--features defaults-without-telemetryon its own (no--no-default-features) would compile a telemetry-on binary that reads as telemetry-free.rust:verify:defaults-without-telemetry(tasks/scripts/verify-defaults-without-telemetry.sh), which asserts viacargo metadatathat each alias still equals its crate's defaults minustelemetry, and that the mutual-exclusion error is wired up. The second check matches on thecompile_error!text rather than a nonzero exit code, so it cannot pass vacuously on hosts whereopenshell-driver-vmfails to build for unrelated reasons.rust:verify:telemetry-offat the alias, so CI builds the artifacts the same way the docs tell operators to.branch-checks.yml.README.mdand the Build Features section ofarchitecture/build.md.openshell-corealso defaults totelemetry, but is left alone: every consumer already depends on it withdefault-features = false, so an alias there would be a no-op.Testing
mise run pre-commitmise run testmise run rust:verify:telemetry-offmise run rust:verify:defaults-without-telemetrymise run rust:verify:system-ca-rootsNegative-controlled the drift check by temporarily setting the sandbox alias to
[]; it failed with the expected diff and exit 1, then passed again on restore.Not run:
mise run e2e. This changes build-time feature wiring, not sandbox runtime behavior, and the telemetry-off guard already inspects the resulting binaries.mise run pre-commitpassesrust:verify:*guards rather than#[test]s; feature-set drift andcompile_error!wiring are not observable from inside a compiled test binaryChecklist