Skip to content

Commit

Permalink
fix: do not set dynamic loader path
Browse files Browse the repository at this point in the history
Our binaries are properly linked

Fixes #90
  • Loading branch information
Kha committed Apr 23, 2023
1 parent f853319 commit eb39aae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/elan-cli/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ pub fn lean_version(toolchain: &Toolchain) -> String {
cmd.stdin(Stdio::null());
cmd.stdout(Stdio::piped());
cmd.stderr(Stdio::piped());
toolchain.set_ldpath(&mut cmd);

// some toolchains are faulty with some combinations of platforms and
// may fail to launch but also to timely terminate.
Expand Down
16 changes: 2 additions & 14 deletions src/elan/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl<'a> Toolchain<'a> {
}

fn set_env(&self, cmd: &mut Command) {
self.set_ldpath(cmd);
self.set_path(cmd);

// Because elan and leanpkg use slightly different
// definitions of leanpkg home (elan doesn't read HOME on
Expand All @@ -283,19 +283,7 @@ impl<'a> Toolchain<'a> {
cmd.env("ELAN_HOME", &self.cfg.elan_dir);
}

pub fn set_ldpath(&self, cmd: &mut Command) {
let new_path = self.path.join("lib");

#[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, vec![new_path.clone()], cmd);

pub fn set_path(&self, cmd: &mut Command) {
// Prepend ELAN_HOME/bin to the PATH variable so that we're sure to run
// leanpkg/lean via the proxy bins. There is no fallback case for if the
// proxy bins don't exist. We'll just be running whatever happens to
Expand Down

0 comments on commit eb39aae

Please sign in to comment.