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: Skip problematic cyclic dev-dependencies #16871

Merged
merged 1 commit into from Mar 18, 2024

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Mar 18, 2024

Implements a workaround for #14167, notably it does not implement the ideas surfaced in the issue, but takes a simpler to implement approach (and one that is more consistent).

Effectively, all this does is discard dev-dependency edges that go from a workspace library target to another workspace library target. This means, using a dev-dependency to another workspace member inside unit tests will always fail to resolve for r-a now, (instead of being order dependent and causing problems elsewhere) while things will work out fine in integration tests, benches, examples etc. This effectively acknowledges package cycles to be okay, but crate graph cycles to be invalid:

Quoting #14167 (comment)

Though, if you have “package cycle” in integration tests, you’d have “crate cycle” in unit test.

We disallow the latter here, while continuing to support the former

(What's missing is to supress diagnostics for such unit tests, though not doing so might be a good deterrent, making devs avoid the pattern altogether)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 18, 2024
@Veykril Veykril changed the title Skip problematic cyclic dev-dependencies fix: Skip problematic cyclic dev-dependencies Mar 18, 2024
@Veykril
Copy link
Member Author

Veykril commented Mar 18, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 18, 2024

📌 Commit 76fb73a has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Mar 18, 2024

⌛ Testing commit 76fb73a with merge 59b9cc1...

@bors
Copy link
Collaborator

bors commented Mar 18, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 59b9cc1 to master...

@bors bors merged commit 59b9cc1 into rust-lang:master Mar 18, 2024
11 checks passed
@Veykril Veykril deleted the dev-dependency-cycles branch March 19, 2024 08:02
@Veykril
Copy link
Member Author

Veykril commented Mar 19, 2024

Well, this obviously didn't work out as I expected. Not sure why I thought this would be a good solution, one does quite often crate dev-only dependencies in their own workspace (r-a is an example of that). Guess we'll need to be a bit smarter about this after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants