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

running make -C just install requires sudo #34

Closed
noahehall opened this issue Sep 1, 2021 · 2 comments
Closed

running make -C just install requires sudo #34

noahehall opened this issue Sep 1, 2021 · 2 comments

Comments

@noahehall
Copy link

noahehall commented Sep 1, 2021

env

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.04
Release:        21.04
Codename:       hirsute

when following the setup in just/readme.md
the cmd make -C just install fails

make: Entering directory '/home/poop/git/foss/justjs/just/just'
mkdir -p /usr/local/bin
cp -f just /usr/local/bin/just
cp: cannot remove '/usr/local/bin/just': Permission denied
make: *** [Makefile:123: install] Error 1
make: Leaving directory '/home/poop/git/foss/justjs/just/just'

but it does work with sudo...

poop@spaceship:~/git/foss/justjs/just$ sudo !!
sudo make -C just install
make: Entering directory '/home/poop/git/foss/justjs/just/just'
mkdir -p /usr/local/bin
cp -f just /usr/local/bin/just
make: Leaving directory '/home/poop/git/foss/justjs/just/just'

related

@mkvalor
Copy link

mkvalor commented Nov 6, 2022

Hello @noahehall I am not a dev in this repo. Running 'make install' in almost any project will fail because the build system assumes you want to install into system-controlled directories, not to directories in the user's home. So 'sudo' is normally expected if one runs 'make install' with no modifications. However, this is also usually able to be overridden by changing an ENV variable.

I opened the Makefile for this project and noticed that it uses ENV variable 'INSTALL' as the prefix path for where the binary will be installed. If you take a look yourself, you'll see that this does indeed default to a system-controlled path. If you want to be able to install it locally, add an ENV variable assignment to with your make command like so:
$ INSTALL=~/bin; make install
and then it will use the path you specify as the installation dir. Of course you can do things to make this permanent (including editing the Makefile to use your preferred default INSTALL value) if you want.

@billywhizz
Copy link
Contributor

thanks @mkvalor!

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

3 participants