-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Handle dev-dependency cycles #14475
Handle dev-dependency cycles #14475
Conversation
if cfg!(test) { | ||
panic!("{}", err); | ||
} | ||
tracing::error!("{}", err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've seen a bunch of usage of format strings, but you can reduce this to:
tracing::error!("{}", err); | |
tracing::error!(?err); |
Naive question: is this for only crates that are in the immediate workspace? naively, that feels like a reasonable and fine approach. |
The way its implemented right now is for all dev-dependencies (declared by workspace members, as dev-dependencies of libraries are irrelevant to the workspace) we will duplicate all their normal (non-build, non-dev) dependencies with the test flags. This would be completely correct as a dev depedency could re-export something from their normal dependencies that depends on the An alternative heuristic way would be to only duplicate dependencies in dev-dependency that point to workspace members and use the "non dev-version" for the rest. This will most likely cover the majority of cases. |
☔ The latest upstream changes (presumably #14490) made this pull request unmergeable. Please resolve the merge conflicts. |
Gotcha, thanks for explaining :) |
@Veykril pointed me at this issue from a post I made at users.rust-lang. I've built RA from source and have it running on vscode and I'd like to see if this change fixes the problem I'm seeing. I'll give it a try if someone would kindly fix the merge conflicts :) |
1fa6d5f
to
56de543
Compare
Okay, I've changed it to now only duplicate workspace members. This cuts down the cyclic deps errors in the |
Unfortunately this manifests a problem now, given we have two crates for some files we will basically duplicate some things in IDE features ... (symbol search etc), I am not sure how to best deal with that |
Okay, actually we fortunately ignore anything but the first module we find for a file so most things should work if we prefer the duplicated crates. (symbol search and so on will still dupe, but I guess that is the price people will have to pay for now for adding a dev-dependency like that) Let's merge this next monday |
FYI, I tested my workspace and there are no longer any errors. Txs!!!! |
☔ The latest upstream changes (presumably #14599) made this pull request unmergeable. Please resolve the merge conflicts. |
I verified it in my local, it works!! |
@bors r+ |
Handle dev-dependency cycles cc #14167 This should fix cycles errors mostly (it fixes the one on rome/tools at least, but not on rustc. Though there it might just be because of rustc workspace being rustc workspace). Unfortunately this will effectively duplicate all crates currently, since if we want to be completely correct we'd need to set the test cfg for all dev dependencies and the transitive dependencies of those, something I worry we should try to avoid.
💔 Test failed - checks-actions |
@bors r+ |
☀️ Test successful - checks-actions |
Something went terribly wrong with the rebase it seems, the metrics don't look good... |
Revert "Handle dev-dependency cycles" Reverts #14475 I managed to fix the problem that causes the metric failures, but this still severely degrades IDE features in a way that makes the user experience ***worse*** than before. I am not sure how to address this, I wonder what the jetbrains plugin is doing in these cases.
Yes, this PR fixed cycle deps issues, but seems has a bug. The hover tip for Repo: https://github.com/nervosnetwork/ckb FYI. |
Yes, this PR in general causes a bunch of issues which are inherent to the fact that we now have a bunch of items come from two different crates that are semantically the same which breaks features everywhere. The approach in this PR doesn't seem to work out so it will be reverted. |
cc #14167
This should fix cycles errors mostly (it fixes the one on rome/tools at least, but not on rustc. Though there it might just be because of rustc workspace being rustc workspace). Unfortunately this will effectively duplicate all crates currently, since if we want to be completely correct we'd need to set the test cfg for all dev dependencies and the transitive dependencies of those, something I worry we should try to avoid.