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

extra-link-arg: support all link types #9416

Closed

Conversation

davidhewitt
Copy link

This commit adds support for the remaining link types to -Zextra-link-arg:

rustc-link-arg-tests
rustc-link-arg-benches
rustc-link-arg-examples

This would be useful in PyO3, where users writing Python extension modules (which do link against libpython) want to run cargo tests for extension module. As executables, these tests need to link against libpython.

@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 @ehuss (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 Apr 26, 2021
@ehuss
Copy link
Contributor

ehuss commented Apr 29, 2021

Thanks for the PR!

One question I had is for examples. It looks like this only applies the flags for executable examples. I was wondering if it would make sense to also pass the flags for cdylib examples? Those are probably very rare, but that's the kind of thing that is difficult to change afterwards due to backwards compatibility.

Can you also update unstable.md with the new additions?

@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 17, 2021
@bors
Copy link
Contributor

bors commented May 24, 2021

☔ The latest upstream changes (presumably #9486) made this pull request unmergeable. Please resolve the merge conflicts.

@davidhewitt
Copy link
Author

Sorry for the long delay, I hope to pick this PR up very soon.

I just saw #9562. Is that also relevant to these flags? It was looking potentially quite elegant for PyO3 to push these flags downstream automatically from its build.rs, but I think we can happily find alternative ways to help users add them in their own build.rs if needed.

@ehuss
Copy link
Contributor

ehuss commented Aug 6, 2021

I'm gonna close this due to inactivity. Feel free to reopen or create a new PR when you've got time to work on this again. Thanks!

@ehuss ehuss closed this Aug 6, 2021
bors added a commit that referenced this pull request Jan 30, 2022
extra-link-arg-etc: support all link types (credit @davidhewitt)

This commit adds support for the remaining link types to `-Zextra-link-arg-etc`:
`
rustc-link-arg-tests
rustc-link-arg-benches
rustc-link-arg-examples
`
This would be useful in PyO3, where users writing Python extension modules (which do link against libpython) want to run cargo tests for extension module. As executables, these tests need to link against libpython.

This is a follow up of #9416 by `@davidhewitt`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants