-
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
Remove dependency formats from crate metadata #96708
Comments
I was talking to @jsgf about this issue, but I had two questions:
To summarize/get everyone on the same page, the reason that @jsgf took the "hollow .rlib" approach (as described in bazelbuild/rules_rust#228 (comment)) was that BuckV2's rules allows for reusing the generated (On an aside, I've noticed that the approach that Jeremy took incurs about 20-30% more overhead compared to emitting plain metadata, so maybe resolving this issue can hopefully reduce that discrepancy.) |
Currently the crate metadata is shared between all crate types. For dylibs we still need to store the dylib dependency formats. I think the best way is to store it in an additional section of the dylib and then remove it from the main crate metadata. I don't think this interacts with MIR-only rlibs at all. |
Just to make sure we're all talking about the same thing, "dependency format" just means this right? That's only linkages and crate types, so there's no hashes or any other identifiers of specific crates. So @davidbarsky I don't think this is relevant to any of the things we're talking about. |
Correct. |
It only really needs to be stored for dylibs and only the dependency format for said dylib and not for any other crate types also used. It can be stored in a separate section for dylibs. For example
.rsdpfmt
(needs to stay within the 8 char limit for COFF section names). Furthermore omitting it from the crate metadata is necessary for implementing bazelbuild/rules_rust#228 (comment) as otherwise the dependency formats included in the crate metadata of the first compilation wouldn't match the second compilation due to dylibs not being available yet. Not encoding it in the crate metadata may also improve performance a tiny bit although rlib only crates already encode an empty list anyway.The text was updated successfully, but these errors were encountered: