-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cargo binaries are not run in pristine environment #2888
Comments
Some of these could probably get trimmed, but I don't think it's really up to Cargo to provide a 100% "pristine environment" to run executables, to do that reliably you'd basically always want to run the executable itself first. |
Messing with |
Note that this is required for correctness with |
So, if we do |
@matematikaadit binaries installed through |
This issue is still causing a number of annoying and unexpected behavior. For example, I got bit by this problem using I understand from rust-lang/rust#28640 that this is not necessarily a trivial problem, but I don't think it is getting the attention it needs. Messing with environment variables does not even seem to be mentioned in the
|
Use DYLD_FALLBACK_LIBRARY_PATH instead of DYLD_LIBRARY_PATH Without this change, --target fails see https://users.rust-lang.org/t/subprocess-and-dynamic-library-linking-problem-interaction/7873 see rust-lang/cargo#2888
Here's a variation of this issue that I've run into. See also rust#36250 and #3366. I've been attempting to build a Rust project using the conda-forge build infrastructure. My project uses The crux of the problem is that when Cargo runs the build script, it's setting
Somehow our
This kills the build script and the build. If I don't understand Cargo well, but I could imagine that the bits that are responsible for |
cargo
pollutes the environment with a lot of stuff, thus potentially skewing the behaviour of binaries run withcargo run
and directly.Most notably, the
$LD_LIBRARY_PATH
may result in binaries not “just” working when run withoutcargo run
, but also susceptible areSSL_*
things. I do not see anybody removing the$LD_LIBRARY_PATH
hack, but ideally all other environment variables would just not exist.The text was updated successfully, but these errors were encountered: