-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Project fails to link when using dylibs without the -Zshare-generics flag #67276
Comments
Nominating for prioritization. |
pre-triage: Explicitly leaving nominated (and not prioritized); lets figure out the priority of this as a group tomorrow. |
Alright, I have identified the cause of this problem. Consider the following subset of the repro's crate graph:
Both
I'm pretty sure that's also the cleanest fix: Re-export all instances from dylibs. |
@michaelwoerister Question: how can this be a stable-to-stable regression when it depends on |
I'll put this on the explicit agenda for tomorrow. |
@pnkfelix, thats my fault for putting in a bad issue title basically in 1.36.0 dylibs will link fine without the generics flag. In 1.37.0 and higher they will only compile with |
@pnkfelix Yes, |
…alexcrichton Make sure that all upstream generics get re-exported from Rust dylibs. This PR contains a fix for #67276. Rust dylibs would not re-export all generic instances when compiling with `-Zshare-generics=on` (=default for debug builds) which could lead to situations where the compiler expected certain generic instances to be available but then the linker would not find them. ### TODO - [x] Write a regression test based on the description [here](#67276 (comment)). - [x] Find out if this also fixes other issues related to #64319. r? @alexcrichton ~~(once the TODOs are done)~~ cc @pnkfelix @alexkornitzer
Now that the PR is merged, will report back once the nightly is live so that I can test on a non toy example. |
Excellent. Thank you. |
Just tried the latest nightly and problem solved, thanks again for sorting it out :D |
That's great to hear. Thanks for the reproduction case, it really helped! |
I have opened this issue under the recommendation of @michaelwoerister who has been helping me track down the linking issues I have been having with dylibs.
As reported in previous issues which I piggybacked, the example provided will build on
1.36.0
but nothing newer: https://github.com/AlexKornitzer/dylib-errors/tree/error/consulTo quote @michaelwoerister, the
-Zshare-generics
flag has potentially been identified as the root cause:Hence when building with
--release
the linking issues go away.This is potentially related to #64319 and was originally being tracked in #64340.
The text was updated successfully, but these errors were encountered: