Repository navigation
Conversation
…rustflags
Release-like routes (`build`, `run`, `debug`, interop, passthrough `build`)
appended `-Copt-level=3 -Cdebug-assertions=off` (plus overflow-checks /
debuginfo variants) to CARGO_ENCODED_RUSTFLAGS, while `test` leaves the
profile alone. The values equal the release defaults, but different rustflags
change every crate's fingerprint: `cargo oxide test -- --release` followed by
`cargo oxide build` recompiled the whole dependency graph (~680 crates for one
application) and CI caches held two copies of everything.
`CodegenProfilePolicy::pinned_options` is now the single list of pins. They
are set as `CARGO_PROFILE_{RELEASE,DEV,<--profile>}_*`; Cargo fingerprints
resolved profile values, so build and test share every artifact. A pinned
`-C` flag is still appended after incoming rustflags that set the same option
(including `-O`, `-g` and `_` spellings), so the pin keeps winning. Every
release-like policy now pins `overflow-checks = off` explicitly: a passthrough
build without `--release` runs the dev profile, whose overflow-checks default
is on. `cargo oxide debug`'s manual CARGO_PROFILE_RELEASE_DEBUG moved into the
same list. `[profile.*.package.*]` overrides and `--config profile.*` outrank
the environment; the README says so.
Signed-off-by: Alex Khal <joss13@gmail.com>
Signed-off-by: ssoj13 <96214515+ssoj13@users.noreply.github.com>
This branch has not been deployed
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.
Release-like
cargo oxidecommands previously pinned ordinary Cargo profile settings through rustflags. Their flags differed fromcargo oxide test -- --release, invalidating dependency fingerprints and causing the following build to recompile the graph.Fixes #1508.
Move opt-level, debug assertions, overflow checks and debug information into Cargo profile environment settings. Preserve the previous last-word override by appending a
-Cpin when incoming rustflags already set that option. Document how package/build overrides and explicit Cargo config interact with these pins.Port of ansidium/cuda-rust-windows#12, independently rebased onto NVIDIA main
bc46b1ffb.Current verification, pinned nightly-2026-10-11 on Linux/WSL2:
cargo test --locked -p cargo-oxide: 246 passing tests.-D warnings, formatting and SPDX checks pass.The original change was authored by Alex Khal with Claude Code. This transplant and current verification were prepared with Codex; original attribution and DCO are preserved.