Skip to content

Fix multiple version of dependencies for global allocations #429

@avanhatt

Description

@avanhatt

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.

Metadata

Metadata

Assignees

Labels

[C] BugThis is a bug. Something isn't working.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions