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

Fix optional deps in multiple sections #5480

Merged
merged 1 commit into from
May 4, 2018
Merged

Conversation

alexcrichton
Copy link
Member

This commit fixes an issue where an optional dependency was listed multiple
times in a manifest (multiple sections). This regression was introduced by #5415
and happened because in the resolver we didn't record a Dependency as it was
accidentally deduplicated too soon.

The fix here was to ensure that all Dependency annotations make their way into
Resolve now that we rely on the listed Dependency values for correctness.

Closes #5475

@rust-highfive
Copy link

r? @matklad

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

Copy link
Member

@matklad matklad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me with typos(?) fixed

if !reqs.deps.is_empty() {
let unknown = reqs.deps.keys().map(|s| &s[..]).collect::<Vec<&str>>();
let features = unknown.join(", ");
// Any entries in `reqs.dep` which wrent' used are bugs in that the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/wrent'/weren't/

);
let p = p.build();

// assert_that(p.cargo("run"), execs().with_status(0).with_stdout("0\n"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out? We probably should uncomment or delete it?

@alexcrichton
Copy link
Member Author

@bors: r=matklad

Indeed, typos!

@bors
Copy link
Contributor

bors commented May 4, 2018

📌 Commit 5f0bf04 has been approved by matklad

@bors
Copy link
Contributor

bors commented May 4, 2018

⌛ Testing commit 5f0bf0472af01ae891e55d53bc3d844d55d45962 with merge 4993ff1dcaacfb722acdcd0135858a4ccbf9bf6f...

@bors
Copy link
Contributor

bors commented May 4, 2018

💔 Test failed - status-travis

This commit fixes an issue where an optional dependency was listed multiple
times in a manifest (multiple sections). This regression was introduced by rust-lang#5415
and happened because in the resolver we didn't record a `Dependency` as it was
accidentally deduplicated too soon.

The fix here was to ensure that all `Dependency` annotations make their way into
`Resolve` now that we rely on the listed `Dependency` values for correctness.

Closes rust-lang#5475
@alexcrichton
Copy link
Member Author

@bors: r=matklad

@bors
Copy link
Contributor

bors commented May 4, 2018

📌 Commit 2f88a70 has been approved by matklad

@bors
Copy link
Contributor

bors commented May 4, 2018

⌛ Testing commit 2f88a70 with merge 5986492...

bors added a commit that referenced this pull request May 4, 2018
Fix optional deps in multiple sections

This commit fixes an issue where an optional dependency was listed multiple
times in a manifest (multiple sections). This regression was introduced by #5415
and happened because in the resolver we didn't record a `Dependency` as it was
accidentally deduplicated too soon.

The fix here was to ensure that all `Dependency` annotations make their way into
`Resolve` now that we rely on the listed `Dependency` values for correctness.

Closes #5475
@bors
Copy link
Contributor

bors commented May 4, 2018

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

@bors bors merged commit 2f88a70 into rust-lang:master May 4, 2018
bors added a commit that referenced this pull request May 5, 2018
FIx false positive warning

We warn if a feature was specified corresponding to a dependency which
is not optional. However, a dependency can be both optional and
required, and we shouldn't warn in that case.

cc #5480

r? @alexcrichton
@alexcrichton alexcrichton deleted the fix-regr branch May 10, 2018 19:17
@ehuss ehuss added this to the 1.27.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 stopped including optional dependencies into build scripts
5 participants