Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCargo binaries are not run in pristine environment #2888
Comments
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
Messing with |
This comment has been minimized.
This comment has been minimized.
|
Note that this is required for correctness with |
This comment has been minimized.
This comment has been minimized.
matematikaadit
commented
Nov 10, 2016
|
So, if we do |
This comment has been minimized.
This comment has been minimized.
|
@matematikaadit binaries installed through |
casey
referenced this issue
Dec 4, 2016
Open
Linker error on a crates that link with system frameworks and add library search paths #36250
lilith
referenced this issue
Feb 9, 2017
Closed
Works under cargo test, but not when harness is executed directly? #575
sfackler
referenced this issue
Feb 9, 2017
Open
Cargo appears to leak SSL_CERT_FILE and SSL_CERT_DIR to subprocesses #3676
dchammond
referenced this issue
Mar 17, 2017
Closed
Creating an Array throws an "Unknown Error" #105
This comment has been minimized.
This comment has been minimized.
dchammond
commented
Mar 17, 2017
•
|
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
|
alexcrichton
referenced this issue
May 7, 2017
Closed
`cargo run` spills additional variables into the environment #4002
carols10cents
added
A-linkage
A-documenting-cargo-itself
A-environment-variables
C-bug
Command-run
labels
Sep 26, 2017
MarcusCalhoun-Lopez
added a commit
to macports/macports-ports
that referenced
this issue
Mar 30, 2018
This comment has been minimized.
This comment has been minimized.
|
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 |
nagisa commentedJul 17, 2016
cargopollutes the environment with a lot of stuff, thus potentially skewing the behaviour of binaries run withcargo runand directly.Most notably, the
$LD_LIBRARY_PATHmay result in binaries not “just” working when run withoutcargo run, but also susceptible areSSL_*things. I do not see anybody removing the$LD_LIBRARY_PATHhack, but ideally all other environment variables would just not exist.