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 a couple issues with cyclic features and dev-dependencies #10103

Merged
merged 2 commits into from
Nov 22, 2021

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Nov 20, 2021

This fixes two issues with cyclic features and dev-dependencies:

  • cargo tree would enter an infinite loop for cyclic features.
  • The resolver would return a confusing error if a cyclic dev-dependency attempted to enable a feature on its parent that resulted in a cycle. This fixes it to resolve correctly.

Fixes #10101

There is a convoluted situation where a cyclic dev-dependency attempts
to enable a feature on its parent. It would result in a confusing error
saying a package didn't have a feature.

This check was intended only for CLI features, not features passed
through the dependency graph.
@rust-highfive
Copy link

r? @alexcrichton

(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 Nov 20, 2021
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Nov 22, 2021

📌 Commit 2eee644 has been approved by alexcrichton

@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 Nov 22, 2021
@bors
Copy link
Contributor

bors commented Nov 22, 2021

⌛ Testing commit 2eee644 with merge a2c6ec7...

@bors
Copy link
Contributor

bors commented Nov 22, 2021

☀️ Test successful - checks-actions
Approved by: alexcrichton
Pushing a2c6ec7 to master...

@bors bors merged commit a2c6ec7 into rust-lang:master Nov 22, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 22, 2021
Update cargo

7 commits in ad50d0d266213e0cc4f6e526a39d96faae9a3842..e1fb17631eb1b3665cdbe45b1c186111577ef512
2021-11-17 18:36:37 +0000 to 2021-11-22 16:53:06 +0000
- re-enable lto_build test on 32-bit MSVC (rust-lang/cargo#10110)
- Fix a couple issues with cyclic features and dev-dependencies (rust-lang/cargo#10103)
- Add --message-format for install command (rust-lang/cargo#10107)
- Update curl dependency, remove M1 macOS build error note (rust-lang/cargo#10106)
- Make clippy happy (rust-lang/cargo#10105)
- Give a hard error if `-Zrustdoc-scrape-examples` is missing a flag (rust-lang/cargo#10043)
- silly fix, pointer to the empty slice (rust-lang/cargo#10097)
@ehuss ehuss added this to the 1.58.0 milestone Feb 6, 2022
bors added a commit that referenced this pull request Nov 1, 2023
Add regression test for issue 6915: features and transitive dev deps

Closes #6915.

That issue was fixed without realizing by #10103. In search of test coverage, I looked through `rg '[a-z0-9_-]+ = \["[a-z0-9_-]+/[a-z0-9_-]+"\]' tests/testsuite/` and did not find any existing test that exercises this situation. The tests added by #10103 are focused on cycles and `cargo tree`, which is substantially different from #6915.

Tested by `cargo test --test testsuite -- features::activating_feature_does_not_activate_transitive_dev_dependency`.
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.

Stack overflow in cargo tree -e features
4 participants