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 multiple version of dependencies for global allocations #429

Closed
avanhatt opened this issue Aug 16, 2021 · 0 comments · Fixed by #430
Closed

Fix multiple version of dependencies for global allocations #429

avanhatt opened this issue Aug 16, 2021 · 0 comments · Fixed by #430
Assignees
Labels
[C] Bug This is a bug. Something isn't working.

Comments

@avanhatt
Copy link
Contributor

avanhatt commented Aug 16, 2021

A few times now, we've seen Cargo RMC fail when dependent crates rely on two different versions of some dependency. You can work around this by deleting one of the resulting GotoC outputs, but this isn't sound if the two versions actually have semantic differences.

We should, like Cargo, figure out how to use the version itself in the mangled symbol name and resolve the right versions of functions.

https://stephencoakley.com/2019/04/24/how-rust-solved-dependency-hell

https://github.com/rust-lang/cargo/blob/8df842f5941f7e6c34db608c9bde4c5dcebfde01/src/cargo/core/compiler/context/compilation_files.rs#L18

/// The `Metadata` is a hash used to make unique file names for each unit in a build.
/// For example:
/// - A project may depend on crate `A` and crate `B`, so the package name must be in the file name.
/// - Similarly a project may depend on two versions of `A`, so the version must be in the file name.
/// In general this must include all things that need to be distinguished in different parts of
/// the same build. This is absolutely required or we override things before
/// we get chance to use them.
@avanhatt avanhatt added the [C] Bug This is a bug. Something isn't working. label Aug 16, 2021
@avanhatt avanhatt self-assigned this Aug 17, 2021
@avanhatt avanhatt changed the title RMC should, like Cargo, allow multiple version of dependencies Fix multiple version of dependencies for global allocations Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Bug This is a bug. Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant