-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don't use external node ids in crate metadata #2419
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
Comments
Nominating for milestone 5, production-ready |
We're calling this "def ID drift" and it's disrupting Servo a lot. |
accepted for production-ready milestone |
Accepted for P-low. |
This does not seem to be a problem for Servo these days. |
Rust now gives better warnings when libraries start to drift out of date, and I haven't observed def id drift in practice for quite some time now. This is still an issue, though. |
A lot has changed in a post-cargo world. Is this still true? Can we get a reproduction? |
We now reference dependencies by-hash, making relying on internal |
I believe one of the reasons linking is so flaky right now is because we encode data about external crates using their external node ids, which are not stable.
For example if crate A uses type foo from crate B, when we write A's metadata we will refer to foo as node 3048 (for example). When B is recompiled foo will probably get a different node ID, while A still refers to the old ID.
When we later link a different crate to crate A the metadata reader runs off the rails chasing bogus node ID's in crate B.
Here's what I think is the easiest way to fix this within the current design:
The text was updated successfully, but these errors were encountered: