env not available on osx
Closed this issue · 9 comments
In a recent commit, this tool's shebang line switched from a hardcoded bash path to using env to find bash. Unfortunately, env doesn't ship on osx.
That cnange was introduced by commit 31d0340, and that made the program working even on FreeBSD. Unluckily I don't have a mac to test with on, I think @theory did nevertgheless.
In the meantime, a bad workardoun would be to execute the script thru a bash explicit call:
bash ~/.pgenv/bin/pgenv check
To fix this I suspect we need to re-hard code the bash location into the she-bang and asks users to link the bash to the path we are going to use. Or using a "tramplone" script to execute a standardshell (Bourne?) and exec the script immediatly with the curreny installed bash.
Any suggestion is welcome.
We just follow the examples of rbenv and plenv for this.
@theory : not clear what you mean. Are thinking to move the main script to a libexec
directory to use a trampoline?
I mean follow precedents as best we can. I don’t know what they are (I’m away at the moment).
But it’s try that env works fine on my Mac; I’ve used it for years.
Odd, the only 'env' executable I have on my mbp is from installing gnu coreutils via homebrew:
ReturnOfTheMac:~ root# find / -name env -print 2>/dev/null
/usr/local/Cellar/coreutils/8.30/libexec/gnubin/env
ReturnOfTheMac:~ root#
Is there something I need to install?
@hunleyd env
is a part of coreutil, I guess it is so common to get it installed that is a rare exception you don't have it. Could you pllease provide some more info about your enrironment?
Just for the record: my version of coreutils is 8.26, you mention 8.30!
@theory We should at this point list env
as a dependency, I think.
what info you want @fluca1978 ? this is macos high sierra 10.13.6
and like i said, the only env
is because i installed gnu coreutils via homebrew (for another piece of software). And as homebrew itself tells you:
Warning: Putting non-prefixed coreutils in your path can cause gmp builds to fail.
So env
is relegated to /usr/local/Cellar/coreutils/8.30/libexec/gnubin
and not /usr/local/bin
like most homebrew apps
I have to say I'm a little confused. If I get it right from here Homebrew/legacy-homebrew#19238 coreutils are installed in an alternative path (and with alternative names) to not mask-out already existing binaries. But env
itself seems to be a BSD utility and so it should be already installed in OSX since it uses FreeBSD userland and
man env
....
HISTORY
The env command appeared in 4.4BSD.
Again, I don't have a mac OSX to test against, but seems to a local configuration problem.
While not able to solve the problem at this stage, at least explicitly listing the dependency on env
could help debugging similar problems.
Checked a coworker's mbp since they are all identical and centrally managed. He has /usr/bin/env
so clearly this is my issue, not yours. Sorry for the noise.