-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustdoc prefers dynamic linking #16358
Comments
What does this mean? When is rustdoc creating binary artifacts? |
When it compiles doctests. |
Yes, rustdoc passes I agree that rustdoc should probably have an opt-out for this (not turned on by default in my opinion). Out of curiosity, what were the problems you were seeing? |
If there are name conflicts this will show up in dynamic linking. For example, rust-foo which links libfoo.a and generates libfoo.so. We had a lot of this in Servo and it took some time to fix all of them. After I had done so, the test prorams would then sometimes fail even though everything else linked fine. There was no indication of why the problem happened, it would just say it couldn't find the library. |
Why would this only show up during dynamic linking, and not when linking an executable with rlibs? When linking with rlibs we still just pass |
I don't know the answer. But I found the that if I forced rlibs only to be generated, the problems went away. Eventually, after discussion with you, I switched to using kind="static" and doing it correctly. |
While this is certainly a bug and should be implemented, it sounds like it may not necessarily fix the issues you've been seeing (conflicting names of native/rust libraries). For those conflicts the recommended solution is |
That is exactly what I've done as I've discovered the issues. |
@alexcrichton FYI, @mrobinson has been running into this and it's causing us to disable rustdoc on a bunch of our modules. Is there any ETA for a fix? |
Is there a more minimal reproduction for this issue other than "cargo doc in servo" ? |
Without a reproduction, we can't fix this. @metajack let us know if you have one! |
I'm not aware of a more minimal repro than "cargo doc in servo." |
…h-macros, r=Veykril Deduplicate references when some of them are in macro expansions EDIT: I wonder if this is a regression, I'll try to investigate. Commit 6a06f6f (Deduplicate reference search results, 2022-11-07) deduplicates references within each definition. Apparently our descend_into_macros() stanza returns one definition for each time a name is used in a macro. Each of those definitions has the same set of references. We return them all, leading to many redundant references. Work around this by deduplicating definitions as well. Perhaps there is a better fix to not produce duplicate definitions in the first place. I discovered this working with the "bitflags" macro from the crate of the same name. Fixes rust-lang#16357
rustdoc chooses to link dynamically if rlibs are available, which can sometimes cause problems. This seems bizarre since rustc has the opposite behavior.
The text was updated successfully, but these errors were encountered: