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

wrong current directory in workspace #172

Closed
andrewbanchich opened this issue Apr 30, 2021 · 4 comments
Closed

wrong current directory in workspace #172

andrewbanchich opened this issue Apr 30, 2021 · 4 comments

Comments

@andrewbanchich
Copy link

I just did a cargo install cargo-watch to update and running cargo watch -c -x "run" from a workspace directory will run the workspaces default-members binary instead.

Workspace Cargo.toml:

[workspace]
default-members = ["foo"]

members = [
    "foo",
    "bar/baz",
]

If I cd into ./bar/baz and run cargo watch -c -x "run", foo will run. If I run cargo run from the same directory, baz runs.

@andrewbanchich
Copy link
Author

Downgrading to 7.7.0 works. Looks like 7.7.1 introduced the change.

@passcod
Copy link
Member

passcod commented May 1, 2021

Mmm. I'm not sure which way is the expected behaviour.

Context: the behaviour change is because the code that changes the directory was looking for the first parent with a Cargo.toml, and that got changed to read the manifests and find the real cargo root instead.

However, when the code was originally written, workspaces weren't a thing, and the intent was indeed to run from the root. The code was literally named fn cargo_root().

I think remaking the effective behaviour is probably the right thing to do.

@passcod passcod closed this as completed in 86c09a4 May 1, 2021
@passcod
Copy link
Member

passcod commented May 1, 2021

Fixes in 7.8.0

@andrewbanchich
Copy link
Author

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants