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

Test for bad path overrides with summaries #3336

Merged
merged 1 commit into from
Dec 2, 2016

Conversation

alexcrichton
Copy link
Member

Bad path overrides are currently detected to issue warnings in cases where path
overrides are not suitable and have exhibited buggy behavior in the past.
Unfortunately though it looks like some false positives are being issued,
causing unnecessary confusion about paths overrides.

This commit fixes the detection of these "bad path overrides" by comparing
Summary dependencies (what's written down in Cargo.toml) rather than
comparing the Cargo.toml of the override with Cargo.lock. We're guaranteed
that the package we're overridding has already been resolved into Cargo.lock,
so we know that if the two Cargo.toml files are equivalent we'll continue
with the same crate graph.

I'm not actually entirely sure why I originally thought it'd be better to go
through the Cargo.lock comparison route. Unfortunately that doesn't take into
account optional deps which aren't in Cargo.lock but are in Cargo.toml of
the override, causing the false positive. This method, however, simply ensures
that the two dependency lists are the same.

Closes #3313

Bad path overrides are currently detected to issue warnings in cases where path
overrides are not suitable and have exhibited buggy behavior in the past.
Unfortunately though it looks like some false positives are being issued,
causing unnecessary confusion about `paths` overrides.

This commit fixes the detection of these "bad path overrides" by comparing
`Summary` dependencies (what's written down in `Cargo.toml`) rather than
comparing the `Cargo.toml` of the override with `Cargo.lock`. We're guaranteed
that the package we're overridding has already been resolved into `Cargo.lock`,
so we know that if the two `Cargo.toml` files are equivalent we'll continue
with the same crate graph.

I'm not actually entirely sure why I originally thought it'd be better to go
through the `Cargo.lock` comparison route. Unfortunately that doesn't take into
account optional deps which aren't in `Cargo.lock` but are in `Cargo.toml` of
the override, causing the false positive. This method, however, simply ensures
that the two dependency lists are the same.

Closes rust-lang#3313
@rust-highfive
Copy link

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@brson
Copy link
Contributor

brson commented Dec 1, 2016

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

📌 Commit 772e1a1 has been approved by brson

@bors
Copy link
Collaborator

bors commented Dec 2, 2016

⌛ Testing commit 772e1a1 with merge c99ae7e...

bors added a commit that referenced this pull request Dec 2, 2016
Test for bad path overrides with summaries

Bad path overrides are currently detected to issue warnings in cases where path
overrides are not suitable and have exhibited buggy behavior in the past.
Unfortunately though it looks like some false positives are being issued,
causing unnecessary confusion about `paths` overrides.

This commit fixes the detection of these "bad path overrides" by comparing
`Summary` dependencies (what's written down in `Cargo.toml`) rather than
comparing the `Cargo.toml` of the override with `Cargo.lock`. We're guaranteed
that the package we're overridding has already been resolved into `Cargo.lock`,
so we know that if the two `Cargo.toml` files are equivalent we'll continue
with the same crate graph.

I'm not actually entirely sure why I originally thought it'd be better to go
through the `Cargo.lock` comparison route. Unfortunately that doesn't take into
account optional deps which aren't in `Cargo.lock` but are in `Cargo.toml` of
the override, causing the false positive. This method, however, simply ensures
that the two dependency lists are the same.

Closes #3313
@bors
Copy link
Collaborator

bors commented Dec 2, 2016

☀️ Test successful - status-appveyor, status-travis
Approved by: brson
Pushing c99ae7e to master...

@bors bors merged commit 772e1a1 into rust-lang:master Dec 2, 2016
@alexcrichton alexcrichton deleted the fix-warning branch December 2, 2016 17:42
@ehuss ehuss added this to the 1.15.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.cargo/config path override & crates with optional deps broken
5 participants