Re:Cargo: predictable dependency management
by steveklabnik on Thursday May 05, 2016 @09:37PM
(#11641097)
There isn't, it might be an interesting idea! Not allowing build.rs would eliminate a lot of crates, and not all build.rs' are nondeterministic... So that's tough.
Re:Cargo: predictable dependency management
by conradev on Thursday May 05, 2016 @09:47PM
(#11641128)
Yeah. Perhaps developers could attribute functions in `build.rs` specifically with "deterministic", so you could see what in the dependency graph isn't deterministic.
Unfortunately, unlike with borrowck, reproducibility is inherently hard to verify, and you'd have to do it manually with a VM or some different build environment.
This is interesting: https://github.com/rust-lang/rust/pull/33296
#[deny(non_deterministic)]
which would error if `build.rs` or similar is present? Also, for usage of things like the `file!` macro, which might mess up determinism based on the build directory.
Theoretically, syntax extensions could be written to be deterministic as well (for a given version, of course).
Is there a tracking issue on this currently?