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

Bug: cargo watch errors out if ignored files are not owned by current user #307

Open
jnickg opened this issue May 23, 2024 · 4 comments
Open

Comments

@jnickg
Copy link

jnickg commented May 23, 2024

Overview

If the current user does not own every file in the current repository, such as artifacts owned by a docker container, cargo watch errors out even if the directory in question is explicitly ignored.

See this repo for reproduction code. Readme of that repo copied below:

Reproduction

Clone the repo linked above. Then, run the following commands:

  1. cargo binstall cargo-watch
  2. docker compose up -d mongodb
  3. cargo watch -- cargo run or just cargo watch

Expected behavior

cargo watch should know to ignore the ignored artifacts, per the documentation in cargo watch --help, which states:

By default, the workspace directories of your project and all local dependencies are watched, except for the target/ and .git/ folders. Your .ignore and .gitignore files are used to filter paths.

Actual behavior

Observe the error: Error: I/O error: Permission denied (os error 13), despite .gitignore ignoring that directory.

Notes

Tested with cargo-watch 8.5.2

Notes

While an argument can be made that users must go through extra steps to ensure that e.g. container artifacts are owned by the current user, and not by the container's root, some users may want to leave behavior default, and regardless cargo watch behavior ought to align with its documented claim

@passcod
Copy link
Member

passcod commented May 31, 2024

Yeah, known issue. Use watchexec for now, which handles this relatively correctly, and will do even better in a future update. Quite busy but I'm planning to bring the improvement over to cargo-watch in Q3/Q4.

@jnickg
Copy link
Author

jnickg commented Jun 7, 2024

@passcod -- Thanks for getting back! Is there a related Issue I can watch for updates on this?

@passcod
Copy link
Member

passcod commented Jun 10, 2024

I'll just keep this one open to track this particular bug.

@jnickg
Copy link
Author

jnickg commented Jun 10, 2024

Thanks again!

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