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

Using sudo inside the Makefile doesn't work if Rust is installed through rustup #8

Open
ManifoldFR opened this issue Oct 4, 2018 · 0 comments

Comments

@ManifoldFR
Copy link

Describe the bug

I'm a Rust developer, and have installed Rust through rustup (https://rustup.rs) already, so it's not considered a system utility (it's not inside /usr/bin or /usr/local/bin) and not available inside the default sudo PATH. Rather, it's inside my home at ~/.cargo/bin.

Thus, running the Makefile through make calls sudo cargo, which will not exist inside the sudo'ed PATH.
So you get an error saying cargo doesn't exist.

One has to set the PATH inside a sudo using

sudo PATH=$PATH your-command

So you would have to replace sudo cargo build by sudo PATH=$PATH cargo build inside the Makefile.

An alternative is to remove calls to sudo within the Makefile and instead do a sudo -s before running it, or do sudo PATH=$PATH make install.

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