Skip to content

Commit

Permalink
Set system-specific dynamic loader env var for command execution
Browse files Browse the repository at this point in the history
  • Loading branch information
inejge committed Jul 20, 2016
1 parent ce50c93 commit e6074c3
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 e6074c3

Please sign in to comment.