Cargo: "No such file or directory" error when compiling a Rust project

Viewed 3896

I'm trying to build a Rust project with cargo (on Ubuntu 20.04), and it seems I'm running into an error when compiling some of the dependencies.

I run cargo build --release, all of the external crates are downloaded, then it begins compiling some of them, but eventually runs into the error below:

> cargo build --release
Updating crates.io index
Downloaded ansi_term v0.12.1
Downloaded phf_generator v0.7.24
Downloaded cmake v0.1.48
...
Downloaded 95 crates (6.9 MB) in 2.51s (largest was `wabt-sys` at 2.6 MB)
Compiling libc v0.2.112
...
Compiling unicode-width v0.1.9
error: couldn't create a temp dir: No such file or directory (os error 2) at path "/home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-1.0.0/home/user/rustcH0KskO"
...

And I get the exact same error for 15 other packages. It's obvious why the path wouldn't exist, but I'm not sure where to begin fixing this issue.

I've tried uninstalling and reinstalling Rust, but I'm new to the language and not sure what to do beyond that, so help is much appreciated. Thanks!

I linked it above, but the project in question is https://github.com/iden3/circom.

0 Answers
Related