Skip to content
This repository was archived by the owner on Jan 18, 2025. It is now read-only.
This repository was archived by the owner on Jan 18, 2025. It is now read-only.

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

@jnickg

Description

@jnickg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions