Skip to content

System-level cargo directory requires root permissions for all commands #2475

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

Closed
z0w0 opened this issue Jun 1, 2012 · 0 comments · Fixed by #2489
Closed

System-level cargo directory requires root permissions for all commands #2475

z0w0 opened this issue Jun 1, 2012 · 0 comments · Fixed by #2489

Comments

@z0w0
Copy link
Contributor

z0w0 commented Jun 1, 2012

Note: These events might only occur on Linux and not Mac.

The current setup requires cargo to be inited in /usr/local/lib/cargo, which makes cargo require root permissions for every command, regardless of where you are installing the files. Using sudo or any other root granter, which normally works cleanly for any root install commands with other package managers, results in the home directory being in /root/ when you install to user-level. Installing to local-level still requires root and hence produces root-only libraries files. All cargo installs end up requiring you to have root permissions when compiling rust programs. As you can see, it turns out as a terrible mess.

Is there any reason for the default cargo directory to be at the system level? The only reason that I can think of is having the same sources across user accounts, but that is kinda pointless at the moment because there is really no reason to have alternative sources and there's no command to even add alternative sources other than the default listed ones.

Why was the cargo home changed, is there a good reason for it to be system level? Is there a way to change this so I don't need all these root permissions, just to compile a rust program (noting at the outputted executable also becomes sudo'd).

I am willing to commit the --mode, -g and -G command line options for the init and sync commands as well if there really is a reason to have system-level sources, so that by default I don't need to get root permissions just to write a rust program that uses cargo-central libraries.

@z0w0 z0w0 closed this as completed Jun 1, 2012
@z0w0 z0w0 reopened this Jun 1, 2012
@brson brson closed this as completed in 54b8d5f Jun 3, 2012
xFrednet pushed a commit to xFrednet/rust that referenced this issue May 21, 2022
xFrednet pushed a commit to xFrednet/rust that referenced this issue May 21, 2022
Lint `empty_lint_after_outer_attr` on argumentless macros

Reverts the change from 034c81b as it's no longer needed. The test is left just in case. Original issue is rust-lang#2475.

changelog: Lint `empty_lint_after_outer_attr` on argumentless macros again
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
enable rustc lints

Given how many rustc APIs we are using, this is probably a good idea.
Seems like we are lint-clean right now. :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants