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 order-dependent feature resolution. #8395

Merged
merged 1 commit into from
Jun 22, 2020

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Jun 22, 2020

There is a situation where if you have pkg/feature syntax, and pkg is an optional dependency, but also a dev-dependency, and the dev-dependency appears before the (optional) normal dependency in the summary, then the optional dependency would not get activated. This is because the feature code used find to get the first entry.

Fixes #8394

@rust-highfive
Copy link

r? @Eh2406

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 22, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Jun 22, 2020

@bors r+ grate find!

@bors
Copy link
Contributor

bors commented Jun 22, 2020

📌 Commit ab73b2c has been approved by Eh2406

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 22, 2020
@bors
Copy link
Contributor

bors commented Jun 22, 2020

⌛ Testing commit ab73b2c with merge b3b25ab...

@bors
Copy link
Contributor

bors commented Jun 22, 2020

☀️ Test successful - checks-azure
Approved by: Eh2406
Pushing b3b25ab to master...

@bors bors merged commit b3b25ab into rust-lang:master Jun 22, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 24, 2020
Update cargo

9 commits in 089cbb80b73ba242efdcf5430e89f63fa3b5328d..c26576f9adddd254b3dd63aecba176434290a9f6
2020-06-15 14:38:34 +0000 to 2020-06-23 16:21:21 +0000
- Adding environment variable CARGO_PKG_LICENSE_FILE (rust-lang/cargo#8387)
- Enable "--target-dir" in "cargo install" (rust-lang/cargo#8391)
- Add support for `workspace.metadata` table (rust-lang/cargo#8323)
- Fix overzealous `clean -p` for reserved names. (rust-lang/cargo#8398)
- Fix order-dependent feature resolution. (rust-lang/cargo#8395)
- Correct mispelling of `cargo`. (rust-lang/cargo#8389)
- Add missing license field. (rust-lang/cargo#8386)
- Adding environment variable CARGO_PKG_LICENSE (rust-lang/cargo#8325)
- Cut down on data fetch from git dependencies (rust-lang/cargo#8363)
@ehuss ehuss added this to the 1.46.0 milestone Feb 6, 2022
apoelstra added a commit to apoelstra/rust-secp256k1 that referenced this pull request Jan 13, 2023
There is a bugfix rust-lang/cargo#8395
which appears in cargo 1.46, after our MSRV of 1.41. This means
that under 1.41, users of the rand-std feature may nondeterministically
see compilation fail.

In particular, users of rust-bitcoin 0.29 seem to have started seeing
failures starting on 2023-01-12, where the 'rand-std' feature would be
enabled in this library but 'rand' was not.

This commit simply makes the 'rand' dependency explicit, to avoid the
nondeterministic bug in cargo's feature resolver.
apoelstra added a commit to rust-bitcoin/rust-secp256k1 that referenced this pull request Jan 13, 2023
66a8c39 backport: fix rand-std feature for old cargo versions (Andrew Poelstra)

Pull request description:

  There is a bugfix rust-lang/cargo#8395 which appears in cargo 1.46, after our MSRV of 1.41. This means that under 1.41, users of the rand-std feature may nondeterministically see compilation fail.

  In particular, users of rust-bitcoin 0.29 seem to have started seeing failures starting on 2023-01-12, where the 'rand-std' feature would be enabled in this library but 'rand' was not.

  This commit simply makes the 'rand' dependency explicit, to avoid the nondeterministic bug in cargo's feature resolver.

  Fixes rust-bitcoin/rust-bitcoin#1546

ACKs for top commit:
  sanket1729:
    code review ACK 66a8c39

Tree-SHA512: 896198dd4050bd8f4a71b345e5691ffddf99f6d5a6fdd2e37bf5032359fcb41ee6c8d966de4f90762e93516b2fc654985a8f25edf113d4ced5b06d9a23742e55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optional features not respected with external registry
4 participants