Skip to content
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

Add cargo:rustc-link-arg-bin flag. #9486

Merged
merged 4 commits into from
May 24, 2021
Merged

Conversation

Dirbaio
Copy link
Contributor

@Dirbaio Dirbaio commented May 14, 2021

This PR implements a cargo:rustc-link-arg-bin command to specify per-binary link args from build scripts. This follows the suggestion from the tracking issue #9426.

Syntax is cargo:rustc-link-arg-bin=BIN_NAME=ARG

This was previously possible to do using the #[link_args=".."] attribute, but it was removed in rust-lang/rust#83820 in favor of the Cargo extra-link-args feature, which can currently not specify different link args for different bins in the same crate. This PR adds back the ability to do that.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Eh2406 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 14, 2021
@ehuss
Copy link
Contributor

ehuss commented May 20, 2021

r? @ehuss

This looks good, thanks! Can you add a test, somewhere in build_script_extra_link_arg.rs? And update unstable.md.

@rust-highfive rust-highfive assigned ehuss and unassigned Eh2406 May 20, 2021
@ehuss ehuss added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 20, 2021
@Dirbaio
Copy link
Contributor Author

Dirbaio commented May 20, 2021

@ehuss done!

@ehuss ehuss removed the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label May 21, 2021
@ehuss
Copy link
Contributor

ehuss commented May 24, 2021

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented May 24, 2021

📌 Commit daffd0a has been approved by ehuss

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 24, 2021
@bors
Copy link
Contributor

bors commented May 24, 2021

⌛ Testing commit daffd0a with merge e931e47...

@bors
Copy link
Contributor

bors commented May 24, 2021

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing e931e47 to master...

@bors bors merged commit e931e47 into rust-lang:master May 24, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request May 26, 2021
Update cargo

7 commits in 070e459c2d8b79c5b2ac5218064e7603329c92ae..e931e4796b61de593aa1097649445e535c9c7ee0
2021-05-11 18:12:23 +0000 to 2021-05-24 16:17:27 +0000
- Add `cargo:rustc-link-arg-bin` flag. (rust-lang/cargo#9486)
- Add a cargo-doc.browser config option (rust-lang/cargo#9473)
- Fix bug when with resolver = "1" non-virtual package was allowing unknown features (rust-lang/cargo#9437)
- Add GitHub link to contributor guide. (rust-lang/cargo#9493)
- Add temporary fix for rustup on windows in CI. (rust-lang/cargo#9498)
- 3 typos and some capitalization (rust-lang/cargo#9495)
- fix 6 typos (rust-lang/cargo#9484)
JohnTitor added a commit to JohnTitor/rust that referenced this pull request May 26, 2021
Update cargo

7 commits in 070e459c2d8b79c5b2ac5218064e7603329c92ae..e931e4796b61de593aa1097649445e535c9c7ee0
2021-05-11 18:12:23 +0000 to 2021-05-24 16:17:27 +0000
- Add `cargo:rustc-link-arg-bin` flag. (rust-lang/cargo#9486)
- Add a cargo-doc.browser config option (rust-lang/cargo#9473)
- Fix bug when with resolver = "1" non-virtual package was allowing unknown features (rust-lang/cargo#9437)
- Add GitHub link to contributor guide. (rust-lang/cargo#9493)
- Add temporary fix for rustup on windows in CI. (rust-lang/cargo#9498)
- 3 typos and some capitalization (rust-lang/cargo#9495)
- fix 6 typos (rust-lang/cargo#9484)
@ehuss ehuss added this to the 1.54.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants