zstd-rs icon indicating copy to clipboard operation
zstd-rs copied to clipboard

Cargo build fails with os_error 1

Open amrx101 opened this issue 4 years ago • 6 comments

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)

amrx101 avatar Nov 20 '19 09:11 amrx101

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?

gyscos avatar Nov 21 '19 21:11 gyscos

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]#

divaisthewonder avatar May 15 '23 01:05 divaisthewonder

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.

NobodyXu avatar May 15 '23 02:05 NobodyXu

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 avatar May 15 '23 03:05 divaisthewonder

@divaisthewonder Please switch to a non-root account, using root is so dangerous since you can do anything and destroy your OS without noticing.

NobodyXu avatar May 15 '23 03:05 NobodyXu

thank you. appreciate. I am trying this and will update shortly the outcome.

divaisthewonder avatar May 15 '23 04:05 divaisthewonder