Skip to content

Reconsider using SVH for loading transitive crate dependencies #42677

Open
@alexcrichton

Description

@alexcrichton

When you write extern crate bar in your crate then the compiler will search for and load all crates that are transitive dependencies of bar. Let's say, for example, that bar depended on crate foo. The compiler will look for libfoo.rlib after loading libbar.rlib. Because bar is already compiled the compiler wants to find the precise same libfoo.rlib as before. Each crate has a "strict version hash" historically (SVH) which is used for this. The metadata of bar says that it needs crate foo at a precise SVH. The intention here is to prune duplicates or other crates that look like they could satifsy the request.

Over time, though, the SVH's definition has changed over time and it may no longer be the correct tool for the job here. @nikomatsakis may have more information.

Metadata

Metadata

Assignees

Labels

A-incr-compArea: Incremental compilationA-linkageArea: linking into static, shared libraries and binariesA-metadataArea: Crate metadataT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions