You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cargo clean -p does not clean if path contains glob characters #10068
cargo clean -p fails to delete a number of files from target/ if the path to target contains glob characters. This is due to the use of rm_rf_glob used for cleaning, which does not escape glob characters in the path before adding the pattern:
#!/bin/bash
rm -rf glob-in-rm
mkdir glob-in-rm
cd glob-in-rm
fordin'[hello]''hello';do
mkdir "$d"pushd"$d"
cargo new foo
cd foo
cargo check
cargo clean -p foo
popddone
diff -qr '[hello]/foo/target''hello/foo/target'
Only in [hello]/foo/target/debug/.fingerprint: foo-8ca57bdc9f429d2a
Only in [hello]/foo/target/debug/deps: foo-8ca57bdc9f429d2a.d
Only in [hello]/foo/target/debug/deps: libfoo-8ca57bdc9f429d2a.rmeta
Only in [hello]/foo/target/debug/incremental: foo-1qp1vfygk93x
Possible Solution(s)
Escape any non-pattern part of the string passed to glob with glob::Pattern::escape.
Activity
Auto merge of #10072 - russweas:master, r=alexcrichton