zstd-rs
zstd-rs copied to clipboard
Cargo build fails with os_error 1
Contents of Cargo.toml
zstd = "0.4"
$cargo build
Downloaded zstd-sys v1.4.13+zstd.1.4.3
error: Operation not permitted (os error 1)
System info:
Ubuntu 18.04.3 LTS
Cargo version
cargo 1.37.0 (9edd08916 2019-08-02)
Rust version
rustc 1.37.0 (eae3437df 2019-08-13)
Hi, and thanks for the report!
It seems you may have some permission issues? Maybe you got some root-owned files by mistake in your ~/.cargo
or your current repository?
Or maybe the problem is the build script? Some filesystem may prevent setting the executable bit, so it's possible the build script may not be run.
Can you try again with cargo build -v
?
hi - i am also getting the same error and breaking my head. is there any fix? [root@USTNCOL-BHU01-RHELDMZHUB01 .cargo]# rustc --version info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' info: latest update on 2023-04-20, rust version 1.69.0 (84c898d65 2023-04-16) error: command failed: 'rustc': Operation not permitted (os error 1) [root@USTNCOL-BHU01-RHELDMZHUB01 .cargo]# dnf upgrade Updating Subscription Management repositories. Last metadata expiration check: 0:55:15 ago on Sun 14 May 2023 07:25:08 PM CDT. Dependencies resolved. Nothing to do. Complete! [root@USTNCOL-BHU01-RHELDMZHUB01 .cargo]# cargo build -v info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' info: latest update on 2023-04-20, rust version 1.69.0 (84c898d65 2023-04-16) error: command failed: 'cargo'
Caused by: Operation not permitted (os error 1) [root@USTNCOL-BHU01-RHELDMZHUB01 .cargo]#
Your rustc/cargo installation is malfunctioning.
Please consider switching to a non-root user, use rustup to install rust, clone your repository in anywhere but .cargo, and tries building again.
hi thanks for the response. Currently I am not even building my code and i am trying to set the rustc to work correctly. when i execute the rustc --version --verbose, i am getting the following error
[root@USTNCOL-BHU01-RHELDMZHUB01 .cargo]# rustc --version --verbose info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' info: latest update on 2023-04-20, rust version 1.69.0 (84c898d65 2023-04-16) error: command failed: 'rustc'
Caused by: Operation not permitted (os error 1) [root@USTNCOL-BHU01-RHELDMZHUB01 .cargo]#
and if i run rustup toolchain list, i am getting the below toolchain.
[root@USTNCOL-BHU01-RHELDMZHUB01 .cargo]# rustup toolchain list stable-x86_64-unknown-linux-gnu (default) [root@USTNCOL-BHU01-RHELDMZHUB01 .cargo]#
similarly if if i execute the below, i am getting rustc did not installed.
info: checking for self-update [root@USTNCOL-BHU01-RHELDMZHUB01 .cargo]# rustup default stable-x86_64-unknown-linux-gnu info: using existing install for 'stable-x86_64-unknown-linux-gnu' info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'
stable-x86_64-unknown-linux-gnu unchanged - (rustc does not exist)
[root@USTNCOL-BHU01-RHELDMZHUB01 .cargo]#
@divaisthewonder Please switch to a non-root account, using root is so dangerous since you can do anything and destroy your OS without noticing.
thank you. appreciate. I am trying this and will update shortly the outcome.