Skip to content

Transitive crate dependency resolution ignores metadata #2138

Closed
@brson

Description

@brson

We have crate A, B, and C, A depends on B and B depends on C. When building crate A rustc finds the library for crate B based on the metadata, then it goes through and finds all the dependencies of crate B, etc. Once it recurses and starts resolving dependencies of dependencies it stops doing any metadata matching and just looks for the name of the crate. This could easily result in situations where rustc loads the wrong crate.

To fix this we need to encode all the matched metadata for a crate's dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binaries

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions