Skip to content

Commit

Permalink
Merge pull request #600 from inejge/loader-envvar
Browse files Browse the repository at this point in the history
Set system-specific dynamic loader env var for command execution
  • Loading branch information
brson authored Jul 21, 2016
2 parents 05525da + e6074c3 commit b5fc55b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/rustup/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,15 @@ impl<'a> Toolchain<'a> {
pub fn set_ldpath(&self, cmd: &mut Command) {
let new_path = self.path.join("lib");

env_var::prepend_path("LD_LIBRARY_PATH", &new_path, cmd);
env_var::prepend_path("DYLD_LIBRARY_PATH", &new_path, cmd);
#[cfg(not(target_os = "macos"))]
mod sysenv {
pub const LOADER_PATH: &'static str = "LD_LIBRARY_PATH";
}
#[cfg(target_os = "macos")]
mod sysenv {
pub const LOADER_PATH: &'static str = "DYLD_LIBRARY_PATH";
}
env_var::prepend_path(sysenv::LOADER_PATH, &new_path, cmd);

// Append first cargo_home, then toolchain/bin to the PATH
let mut path_to_append = Vec::with_capacity(2);
Expand Down

0 comments on commit b5fc55b

Please sign in to comment.