-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
workspaces: exclude
not working in Rustbuild
#4089
Comments
The longest key takes precedence if there's more than one that matches. Closes rust-lang#4089
ping @alexcrichton - it seems like you have a patch that fixes this, but it never landed. Did it work? |
I created a PR at #4297, got bogged down in review, and @behnam kindly offered to take over when working with #4268 as well. |
Right. Sorry for the delay here. I'm back on cargo issues and will send out a PR for this soon. |
No worries! Just wanted to check in :) |
@nrc, I was looking at the original thread, specially your last comment there: https://github.com/rust-lang/rust/pull/42146/files#r119265362 I'm not sure how to repro the error on my machine. Which paths need to BE members of the workspace, and which ones should NOT be? What command gives you the error you mentioned? The reason I'm trying to repro the error is to see what's desired in this case is actually going to be addressed by the solution I have recommended here. |
@benham these lines should all be |
I got back to this again today and realized the implementation for dealing with workspace configs is a bit too intertwined. I need to spend more time on it, and it may need a bit of refactoring around I also want to confirm the solution: based on the last discussion, the plan is to have |
@behnam refactoring sounds great! I was thinking something like the "longest pattern" wins, but if it's ambiguous we can just pick one |
I'm finally getting to a clear implementation here, that hopefully will be stable for a while. There's only one case that I cannot make a clear cut myself---since I haven't used Let's say we have these: Virtual Root: [workspace]
members = ["foo"]
exclude = ["foo/bar"] Package: [package]
# ...
[dependencies]
"bar" = { version = ..., path = "bar" } Package: [package]
# ... What's happening here is that the workspace root only knows about one direct member, The question is: a) Should the b) AFAIU, the either of these work for the case of rust virtual repo (and the main issue brought up in rust-lang/rust#42146 (comment)). Looking at the docs, it's not clear which one was intended in the design. Any comments, @alexcrichton? |
Actually, I realized that I didn't exactly state the current problem: One problem is that cargo is behaving as (b) when going top-down (when the workspace root manifest is active) and behaving as (a) when going bottom-up (when a member manifest is active and checking if it's a member of the root or not). |
@behnam hm an interesting question... I'd probably expect (a) but if that causes too many complications it seems fine to go with (b), these two strategies some mostly equivalent to me I think? |
[core/workspace] Create WorkspaceRootConfig Create `WorkspaceRootConfig`, which knows its `root_dir` and lists of `members` and `excludes`, to answer queries on which paths are a member and which are not. ---- This is the first step of the fix, that's only a codemod to put together the relevant parts : `workspace.members`, `workspace.excludes`, and the `root_dir` (where `members` and `excludes` are relative to). There's no logic change in this PR to keep review easier. The added tests are commented out, because they fail with the current logic. The next step to get these steps to pass. Tracker: <#4089> Old PR: <#4297>
It doesn't work (see rust-lang/cargo#4089), so wasn't giving us any benefits
It doesn't work (see rust-lang/cargo#4089), so wasn't giving us any benefits
As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it. I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect? The team would be especially grateful if such a comment included details such as:
Thank you for contributing! (The cargo team is currently evaluating the use of Stale bot, and using #6035 as the tracking issue to gather feedback.) If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable! |
Fixed by #4594. |
See rust-lang/rust#42146 (comment)
The text was updated successfully, but these errors were encountered: