You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The workspace.members list implicitly includes the root package. But if one tries to put "." in default-members, you get the error:
error: package `/some/path/.` is listed in workspace’s default-members but is not a member.
The complicating problem is that when you put "." into workspace.members, you run into #6745 in the worst way. Putting "." there means workspace.exclude fails to work entirely due to that bug.
I think the default-members check is being overly restrictive here, and should allow "." in non-virtual workspaces without requiring it to appear in members explicitly. This would at least enable a workaround for this problem until the other bug is fixed.
Steps
./Cargo.toml (Package and workspace)
./src/ (Root is a package, not virtual, so this exists)
./included/ (Package to include in workspace)
./nondefault/ (Package that should be included, but not a default-member)
./excluded/ (Package that should be excluded from the workspace)
Expected: cargo build builds the root package and included.
Actual: cargo rejects this config because "." is not in members.
If we add "." to members, then the above works, but:
Expected: cargo build in the excluded package would build independently from the workspace.
Actual:
error: current package believes it's in a workspace when it's not:
current: /some/path/excluded/Cargo.toml
workspace: /some/path/Cargo.toml
this may be fixable by adding `excluded` to the `workspace.members` array of the manifest located at: /some/path/Cargo.toml
This is bug #6745 telling me to add excluded to exclude to fix the problem, but of course it already is.
Possible Solution(s)
I can't find any workaround that works for me. It seems adding a blank [workspace] to excluded's Cargo.toml will fix the issue for single package, but I've got a whole test suite of packages I didn't want to update them all.
I believe a reasonable fix might be as simple as relaxing this check in cargo.
Problem
The
workspace.members
list implicitly includes the root package. But if one tries to put"."
indefault-members
, you get the error:The complicating problem is that when you put
"."
intoworkspace.members
, you run into #6745 in the worst way. Putting"."
there meansworkspace.exclude
fails to work entirely due to that bug.I think the
default-members
check is being overly restrictive here, and should allow"."
in non-virtual workspaces without requiring it to appear inmembers
explicitly. This would at least enable a workaround for this problem until the other bug is fixed.Steps
with
Expected:
cargo build
builds the root package andincluded
.Actual: cargo rejects this config because
"."
is not inmembers
.If we add
"."
tomembers
, then the above works, but:Expected:
cargo build
in theexcluded
package would build independently from the workspace.Actual:
This is bug #6745 telling me to add
excluded
toexclude
to fix the problem, but of course it already is.Possible Solution(s)
I can't find any workaround that works for me. It seems adding a blank
[workspace]
toexcluded
'sCargo.toml
will fix the issue for single package, but I've got a whole test suite of packages I didn't want to update them all.I believe a reasonable fix might be as simple as relaxing this check in cargo.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: