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

nix install on macos with coreutils on path #7181

Open
ciiqr opened this issue Oct 17, 2022 · 3 comments
Open

nix install on macos with coreutils on path #7181

ciiqr opened this issue Oct 17, 2022 · 3 comments
Labels
feature Feature request or proposal

Comments

@ciiqr
Copy link

ciiqr commented Oct 17, 2022

Is your feature request related to a problem? Please describe.
Just ran into an issue helping someone install nix. the chmod -R ugo-w "$NIX_ROOT/store/" line in the multi user install script was failing without any error messages (running it manually showed an exit code of 1, but even with -v no useful error messages were logged). Turns out they had the coreutils brew package installed and linked into their path, so instead of using the system version of chmod it was the gnu version.

Describe the solution you'd like
Check in the install script that chmod doesn't point to homebrew/coreutils and warn the user about the issue and fail the install.

Describe alternatives you've considered
Could always use /bin/chmod instead of relying on the chmod from the path. 🤷

@ciiqr ciiqr added the feature Feature request or proposal label Oct 17, 2022
@abathur
Copy link
Member

abathur commented Oct 17, 2022

AFAIR this shouldn't be a durable homebrew problem, but a short-term problem with a specific coreutils version or set of versions. Can you see if brew upgrade coreutils gets it working?

More context in:

@ciiqr
Copy link
Author

ciiqr commented Oct 17, 2022

I can check with them later to see if this works. If it is in fact a version specific error though, maybe we can detect the issue by checking the output of chmod --version? Otherwise users are just left with the generic Oh no, something went wrong which can be exceptionally discouraging, especially since a lot of people are already hesitant to use nix at all.

@kkroening
Copy link

kkroening commented Mar 5, 2024

Confirming all of the above. I was stumped by the mysterious "Oh no, something went wrong" error and finally figured out chmod is returning exit code 1, and came across this issue.

Temporarily bypassing coreutils in my bash profile fixed it:

# PATH="${HOMEBREW_PREFIX}/opt/coreutils/libexec/gnubin:$PATH"  # temporarily disabled!

The brew upgrade coreutils approach is probably better, but this is at least a datapoint that changing the installer to use /bin/chmod could be a general fix.

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

No branches or pull requests

3 participants