user/{cbindgen,ripgrep,xsv,zola}: stray 'usr/.crates2.json'
Per #1089 (closed), some stray and conflicting files exist in our Rust packages.
The root cause is that they were built without the cargo install --no-track
flag, which, when omitted, can create unwanted files.
From https://doc.rust-lang.org/cargo/commands/cargo-install.html:
--no-track
By default, Cargo keeps track of the installed packages with a metadata file stored in the installation root directory. This flag tells Cargo not to use or create that file. With this flag, Cargo will refuse to overwrite any existing files unless the
--force
flag is used. This also disables Cargo’s ability to protect against multiple concurrent invocations of Cargo installing at the same time.
As an example, we also do not need to remove user/.crates.toml
manually:
diff --git a/user/ripgrep/APKBUILD b/user/ripgrep/APKBUILD
index be18ce2e1..68b4c0732 100644
--- a/user/ripgrep/APKBUILD
+++ b/user/ripgrep/APKBUILD
@@ -124,8 +124,7 @@ check() {
package() {
export CARGO_HOME="$srcdir/cargo-home"
- cargo install --features pcre2 --path . --root="$pkgdir"/usr
- rm "$pkgdir"/usr/.crates.toml
+ cargo install --no-track --features pcre2 --path . --root="$pkgdir"/usr
}
_zshcomp() {
See also: