Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 182 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ serialize = []
[dependencies]
camino = { version = "1.1", features = ["serde1"] }
# Used for acquiring and/or deserializing `cargo metadata` output
cargo_metadata = { version = "0.19", default-features = false, optional = true }
cargo_metadata = { version = "0.20", default-features = false, optional = true }
# We need to use a type from this because it use part of the public API of cargo_metadata
# ...but it's not actually in the public API :p
cargo-platform = { version = "0.1", default-features = false, optional = true }
cargo-platform = { version = "0.2", default-features = false, optional = true }
# Used to parse and evaluate cfg() expressions for dependencies
cfg-expr = "0.20"
# Used to create and traverse graph structures
Expand Down
17 changes: 12 additions & 5 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,10 @@ impl Builder {
let index = self.crates_io_index.map(|index| {
index::CachingIndex::new(
index,
packages.iter().map(|(_id, pkg)| pkg.name.clone()).collect(),
packages
.iter()
.map(|(_id, pkg)| pkg.name.to_string())
.collect(),
)
});

Expand Down Expand Up @@ -760,7 +763,7 @@ impl Builder {
.collect();

NodeDep {
name: dn.name,
name: dn.name.to_string(),
pkg: Kid::from(dn.pkg),
dep_kinds,
}
Expand All @@ -771,7 +774,7 @@ impl Builder {
// due to implementation details rather than guaranteed
deps.sort_by(|a, b| a.pkg.cmp(&b.pkg));

let mut features = rn.features;
let mut features: Vec<_> = rn.features.iter().map(|f| f.to_string()).collect();

// Note that cargo metadata _currently_ always outputs these in
// lexicographic order, but I don't know if that is actually
Expand Down Expand Up @@ -1241,7 +1244,11 @@ impl Builder {
// encountered it in testing (eg. the `md-5` crate names its lib target `md5`, and you
// can have a dependency on the `md5` crate, they both get resolved to the same name, but
// then rustc can't compile `md5::compute` because there are two libs that satisfy that name)
dep.source.as_deref().is_none_or(|dsrc| {
dep.source.as_ref().is_none_or(|dsrc| {
// Caution: "It is possible to inspect the repr field, if the need
// arises, but its precise format is an implementation detail and
// is subject to change."
let dsrc = &dsrc.repr;
let psrc = rdep.pkg.source();
if let Some((dgit, pgit)) = dsrc.strip_prefix("git+").zip(psrc.strip_prefix("git+")) {
// The opaque git sources can have the full revision spec at the end, which is not part of
Expand All @@ -1254,7 +1261,7 @@ impl Builder {

dgit == pgit
} else {
dsrc == psrc
dsrc.as_str() == psrc
}
})
})
Expand Down
Loading
Loading