Skip to content

Commit cd2dc67

Browse files
author
Jesus Checa Hidalgo
committed
run-make-support: set rustc dylib path for cargo wrapper
Some run-make tests invoke Cargo via run_make_support::cargo(), but fail to execute correctly when rustc is built without rpath. In these setups, runtime loading of rustc’s shared libraries fails unless the appropriate dynamic library path is set manually. This commit updates the cargo() wrapper to call set_host_compiler_dylib_path(), aligning its behavior with the existing rustc() wrapper: https://github.com/rust-lang/rust/blob/f76c7367c6363d33ddb5a93b5de0d158b2d827f6/src/tools/run-make-support/src/external_deps/rustc.rs#L39 This ensures that Cargo invocations during tests inherit the necessary dylib paths, avoiding errors related to missing shared libraries in rpath-less builds. Fixes part of rust-lang#140738
1 parent 891b852 commit cd2dc67

File tree

1 file changed

+4
-1
lines changed
  • src/tools/run-make-support/src/external_deps

1 file changed

+4
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
use crate::command::Command;
22
use crate::env_var;
3+
use crate::util::set_host_compiler_dylib_path;
34

45
/// Returns a command that can be used to invoke cargo. The cargo is provided by compiletest
56
/// through the `CARGO` env var.
67
pub fn cargo() -> Command {
7-
Command::new(env_var("CARGO"))
8+
let mut cmd = Command::new(env_var("CARGO"));
9+
set_host_compiler_dylib_path(&mut cmd);
10+
cmd
811
}

0 commit comments

Comments
 (0)