-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
While cargo gives build scripts the effective runtimes of rustc and rustdoc via environment
variables, programs called by cargo don't get a hint on how to call cargo itself. This is important in cases where cargo is not in $PATH or is not the one the original caller wants to use.
Cargo should provide it's own executable as an environment variable to all executables that get called by it.
A use case for this is this integration test that uses a poor man's version of cargotest in order to test a crate that ends up as a [build-dependency] in other crates: The test's executable gets called by cargo and needs to find a cargo executable to compile a free-standing test crate; this ensures that the build-script included in the crate does what it says. I currently rely on simply calling cargo and hoping for the best.