Description
Continuing a conversation from #655 (comment)
we should only force things to be included that affect the outputs and allow for users to explicitly request that additional environment variables get used.
I think that's a reasonable approach - given that, what should this actually look like for env vars?
Should we have an allowlist in
crate_universe_resolver
(requiring changes torules_rust
to allowthings)?
Should we have a user-supplied allowlist in thecrate_universe
rule (potentially requiring every repo to duplicate the same data)?
Should we have both of the above, so that we have a shared list, but also users can augment it if they need?
Should we ignore or warn or error if you haveCARGO_
env vars set which we will ignore, because you may get surprising different results building the same code incargo
andbazel
?This may be my lack of familiarity with cargo's dependency resolution but I feel it's not quite correct to have the version factor into the hash of the lockfile. Can two versions of cargo not generate the same set of dependencies when given the same lockfile?
Given the same
Cargo.toml
, two versions of cargo can resolve different deps, yeah. e.g. in 1.52 rust-lang/cargo#9255 will be released, and in the next edition the default resolver is going to switch from 1 to 2.