dandavison / delta

A syntax-highlighting pager for git, diff, grep, and blame output
https://dandavison.github.io/delta/
MIT License
23.17k stars 382 forks source link

🐛 Can’t install version v0.18.1 due to `log` crate build error #1836

Open hood opened 2 months ago

hood commented 2 months ago

Getting this error when trying to update running cargo install git-delta to update to v0.18.1 from v0.17.0 on OSX:

   Compiling log v0.4.22
   Compiling serde_json v1.0.127
error: couldn't read /Users/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/log-0.4.22/src/serde.rs: Operation not permitted (os error 1)
   --> /Users/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/log-0.4.22/src/lib.rs:395:1
    |
395 | mod serde;
    | ^^^^^^^^^^

error: could not compile `log` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `git-delta v0.18.1`, intermediate artifacts can be found at `/var/folders/f1/gs08vvcn5k5_jcjkr3f19f5w0000gp/T/cargo-installYPYI1p`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

System info:

cargo 1.80.1 (376290515 2024-07-16)
rustc 1.80.1 (3f5fd8dd4 2024-08-06)
Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
th1000s commented 2 months ago

FTR, usually these weird build errors on install can be fixed by using cargo install --locked git-delta. This makes cargo use the exact version numbers of the used libraries, and not use semver to find more-or-less compatible versions.

But this looks like a local problem: serde.rs: Operation not permitted (os error 1). Try deleting log-0.4.22 or even the entire registry folder in .cargo. Or see why you don't have permission to read files in your own home folder.