Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(cargo) requires root permissions and writes to /usr/local/lib/? #2451

Closed
killerswan opened this issue May 26, 2012 · 1 comment
Closed

(cargo) requires root permissions and writes to /usr/local/lib/? #2451

killerswan opened this issue May 26, 2012 · 1 comment

Comments

@killerswan
Copy link
Contributor

Why does cargo write to /usr/local/, requiring root permission even for a user-level or local package install? After #1756 I thought it would build and install in ./ by default, and with -g in ~/, and with -G in /usr/local/, but here we are:

$ cargo install rustx
rust: upcall fail 'can't make_dir /usr/local/lib/cargo/sources', /code/rust/src/cargo/cargo.rs:176
rust: domain main @0x1382e80 root task failed
rust: upcall fail 'killed', /code/rust/src/libcore/task.rs:454
$ cargo -g install rustx
rust: upcall fail 'can't make_dir /usr/local/lib/cargo/sources', /code/rust/src/cargo/cargo.rs:176
rust: domain main @0x15dde80 root task failed
rust: upcall fail 'killed', /code/rust/src/libcore/task.rs:454

Furthermore, once I use sudo:

$ sudo cargo install rustx
info: Installing with git from https://github.com/killerswan/rustx...
Cloning into '/code/temp/.cargo/work/69TAjwAxxJkM7WQn'...
remote: Counting objects: 45, done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 45 (delta 17), reused 42 (delta 14)
Unpacking objects: 100% (45/45), done.
warning: Copying /code/temp/.cargo/work/69TAjwAxxJkM7WQn/build/rustt to /code/temp/.cargo/bin failed
warning: Copying /code/temp/.cargo/work/69TAjwAxxJkM7WQn/build/rustx to /code/temp/.cargo/bin failed
warning: Copying /code/temp/.cargo/work/69TAjwAxxJkM7WQn/build/_rustx to /code/temp/.cargo/bin failed
$ ls -alR
.:
total 12
drwxrwxr-x  3 kevin kevin 4096 May 26 07:51 .
drwxr-xr-x 17 kevin kevin 4096 May 26 07:37 ..
drwx------  6 kevin kevin 4096 May 26 07:51 .cargo

./.cargo:
total 24
drwx------ 6 kevin kevin 4096 May 26 07:51 .
drwxrwxr-x 3 kevin kevin 4096 May 26 07:51 ..
drwx------ 2 root  root  4096 May 26 07:51 bin
drwx------ 2 root  root  4096 May 26 07:51 gpg
drwx------ 2 root  root  4096 May 26 07:51 lib
drwx------ 3 root  root  4096 May 26 07:51 work
ls: cannot open directory ./.cargo/bin: Permission denied
ls: cannot open directory ./.cargo/gpg: Permission denied
ls: cannot open directory ./.cargo/lib: Permission denied
ls: cannot open directory ./.cargo/work: Permission denied
@killerswan
Copy link
Contributor Author

I think @brson and I have resolved this, and my fix is here: #2454.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant