Skip to content

run-make-support: set rustc dylib path for cargo wrapper #140745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025

Conversation

jchecahi
Copy link

@jchecahi jchecahi commented May 7, 2025

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:

fn setup_common() -> Command {
let mut cmd = Command::new(rustc_path());
set_host_compiler_dylib_path(&mut cmd);
cmd
}

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 #140738

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
@rustbot
Copy link
Collaborator

rustbot commented May 7, 2025

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 7, 2025
@rustbot
Copy link
Collaborator

rustbot commented May 7, 2025

The run-make-support library was changed

cc @jieyouxu

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, thanks

@jieyouxu
Copy link
Member

jieyouxu commented May 7, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 7, 2025

📌 Commit cd2dc67 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 7, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request May 7, 2025
…llaumeGomez

Rollup of 8 pull requests

Successful merges:

 - rust-lang#140234 (Separate dataflow analysis and results)
 - rust-lang#140614 (Correct warning message in restricted visibility)
 - rust-lang#140671 (Parser: Recover error from named params while parse_path)
 - rust-lang#140700 (Don't crash on error codes passed to `--explain` which exceed our internal limit of 9999 )
 - rust-lang#140706 ([rustdoc] Ensure that temporary doctest folder is correctly removed even if doctests failed)
 - rust-lang#140734 (Fix regression from rust-lang#140393 for espidf / horizon / nuttx / vita)
 - rust-lang#140741 (add armv5te-unknown-linux-gnueabi target maintainer)
 - rust-lang#140745 (run-make-support: set rustc dylib path for cargo wrapper)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request May 7, 2025
…llaumeGomez

Rollup of 8 pull requests

Successful merges:

 - rust-lang#140234 (Separate dataflow analysis and results)
 - rust-lang#140614 (Correct warning message in restricted visibility)
 - rust-lang#140671 (Parser: Recover error from named params while parse_path)
 - rust-lang#140700 (Don't crash on error codes passed to `--explain` which exceed our internal limit of 9999 )
 - rust-lang#140706 ([rustdoc] Ensure that temporary doctest folder is correctly removed even if doctests failed)
 - rust-lang#140734 (Fix regression from rust-lang#140393 for espidf / horizon / nuttx / vita)
 - rust-lang#140741 (add armv5te-unknown-linux-gnueabi target maintainer)
 - rust-lang#140745 (run-make-support: set rustc dylib path for cargo wrapper)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5e5043d into rust-lang:master May 8, 2025
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 8, 2025
Rollup merge of rust-lang#140745 - jchecahi:run-make-support-cargo-rustc-dylib, r=jieyouxu

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-L43

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
@rustbot rustbot added this to the 1.88.0 milestone May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants