Problem
The target directory is not excluded from backups when created with cargo package or cargo publish.
Steps
cargo new foo
cd foo
cargo package --allow-dirty
ls -al target
Possible Solution(s)
There's probably a call to create_dir_all somewhere that is creating the target/package directory without using the normal "create target dir" logic that excludes it from backups.
Notes
No response
Version
cargo 1.93.0-nightly (445fe4a68 2025-11-07)
release: 1.93.0-nightly
commit-hash: 445fe4a68f469bf936b2fd81de2c503b233a7f4f
commit-date: 2025-11-07
host: aarch64-apple-darwin
libgit2: 1.9.1 (sys:0.20.2 vendored)
libcurl: 8.7.1 (sys:0.4.83+curl-8.15.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 3.5.4 30 Sep 2025
os: Mac OS 15.6.1 [64-bit]
Problem
The
targetdirectory is not excluded from backups when created withcargo packageorcargo publish.Steps
cargo new foocd foocargo package --allow-dirtyls -al targetPossible Solution(s)
There's probably a call to
create_dir_allsomewhere that is creating thetarget/packagedirectory without using the normal "create target dir" logic that excludes it from backups.Notes
No response
Version