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

Cargo tries to access ignored files, resulting in errors if unreadable #8092

Closed
Restioson opened this issue Apr 10, 2020 · 0 comments · Fixed by #8095
Closed

Cargo tries to access ignored files, resulting in errors if unreadable #8092

Restioson opened this issue Apr 10, 2020 · 0 comments · Fixed by #8095
Assignees
Labels
C-bug Category: bug

Comments

@Restioson
Copy link

Problem
When a build.rs is present, a non-owned and ill-permissioned directory in a Cargo project can cause Cargo to fail, even if it is in the .gitignore and in the package.exclude section.

Expected behaviour: cargo ignores the file/directory and checks the project correctly.
Observed behaviour: the following error:

error: cannot read "reprod/undelveable"

Caused by:
  Permission denied (os error 13)

Steps
Run the following script to reproduce:

#!/bin/sh

cargo new reprod
cd reprod
echo "fn main() {}" >> build.rs
mkdir undelveable
echo "undelveable/" >> .gitignore
sed -i 's/edition = "2018"/edition = "2018"\nexclude = ["undelveable"]/' Cargo.toml
chmod 0711 undelveable
touch undelveable/unreadable
sudo chown root:root undelveable
cargo check

Notes

  • cargo 1.42.0 (8633429 2020-01-31)
  • Pop!_OS Ubuntu-based Linux distribution
  • Stable cargo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants