-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
C-bugCategory: bugCategory: bugCommand-packageCommand-publishS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Description
Problem
Cargo trips over an unreadable directory in the root instead of ignoring is like other irrelevant directories. This causes both cargo and downstream tools such as maturin to fail in an otherwise buildable project (PyO3/maturin#2777).
Steps
Create a project with an unreadable directory - Say one created by a docker container running as root. foo is the unreadable directory, bar is the readable control:
mkdir proj
cd proj
cargo init --vcs none --lib
mkdir foo
chmod 000 foo
mkdir bar
Unlike other directories, foo is included in the file list:
$ cargo package --list
warning: manifest has no description, license, license-file, documentation, homepage or repository
|
= note: see https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info
Cargo.lock
Cargo.toml
Cargo.toml.orig
foo
src/lib.rs
This subsequently fails builds, both for cargo and downstream for maturin:
$ cargo package
warning: manifest has no description, license, license-file, documentation, homepage or repository
|
= note: see https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info
Packaging proj v0.1.0 (/home/konsti/projects/proj)
error: failed to prepare local package for uploading
Caused by:
failed to open for archiving: `/home/konsti/projects/proj/foo`
Caused by:
Permission denied (os error 13)
There's a separate issue where cargo's cargo package git integration fails with such a directory, while the git CLI only warns, but that's a separate problem.
Possible Solution(s)
No response
Notes
No response
Version
$ cargo --version
cargo 1.92.0 (344c4567c 2025-10-21)
$ cargo +nightly --version
cargo 1.94.0-nightly (b54051b15 2025-12-30)
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bugCommand-packageCommand-publishS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.