-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
A-environment-variablesArea: environment variablesArea: environment variablesC-tracking-issueCategory: A tracking issue for something unstable.Category: A tracking issue for something unstable.
Description
RUSTC_WORKSPACE_WRAPPER was added in #7533, primarily for clippy support, but could be useful for others.
Differences from RUSTC_WRAPPER
:
- Only runs for workspace members.
- Path is included in the filename hash (which ensures these artifacts are cached separately from usage without the wrapper).
You can test drive this with cargo clippy -Zunstable-options
on the latest nightly.
One of the primary benefits is that now cargo clippy
can share the same cache with cargo check
for non-workspace members.
Before stabilizing, some things to consider:
- Is this the right design?
- This doesn't help with wrapping only specific crates (like just the "primary" ones). Sometimes people want to only have clippy lints for the "root" crate, or for specific crates specified on the command-line (Limit to specific package in workspace, also excluding its dependencies rust-clippy#3025). With this change for clippy,
cargo clippy -p NAME
only works for workspace members.- Cargo previously had an undocumented
CARGO_PRIMARY_PACKAGE
environment variable, perhaps something like that could be used? - How should tools like clippy handle
-p non-member
?
- Cargo previously had an undocumented
- RUSTC_WORKSPACE_WRAPPER doesn't currently work with sccache. How difficult would this be to fix?
- Some tools may want to use arguments with the wrapper. For example,
my-tool wrapper
would pass the "wrapper" argument tomy-tool
to tell it is in wrapper mode. Currently the env vars do not allow passing in arguments. Alternatively, Cargo could set some special env var to inform the executable that it is being used as a wrapper.
cc @yaahc
Metadata
Metadata
Assignees
Labels
A-environment-variablesArea: environment variablesArea: environment variablesC-tracking-issueCategory: A tracking issue for something unstable.Category: A tracking issue for something unstable.
Type
Projects
Status
Done