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

Fix ambiguous native dependencies in proc_macros and staticlibs #1611

Merged
merged 4 commits into from
Oct 29, 2022

Conversation

scentini
Copy link
Collaborator

rustc doesn't know how to deal with native dependencies that have the same name (specifying the full path to the native library does not currently work). rules_rust deals with this issue in bin and cdylib crate types by appending a hash to the different dependencies, so instead of -lnative-dep -lnative-dep the linking command line ends up being -lnative-dep-{hash1} -lnative-dep-{hash2}. This PR also applies the mechanism to staticlib and proc-macro crate types.

@scentini scentini marked this pull request as ready for review October 27, 2022 12:22
Copy link
Collaborator

@krasimirgg krasimirgg left a comment

Choose a reason for hiding this comment

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

Looks good!

@scentini scentini enabled auto-merge (squash) October 29, 2022 00:15
@scentini scentini merged commit 478fc3a into bazelbuild:main Oct 29, 2022
@scentini scentini deleted the proc_macro_ambiguous_libs branch October 29, 2022 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants