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

Install fails on Apple DTK #4058

Closed
shepting opened this issue Sep 23, 2020 · 8 comments · Fixed by #4243
Closed

Install fails on Apple DTK #4058

shepting opened this issue Sep 23, 2020 · 8 comments · Fixed by #4243

Comments

@shepting
Copy link

shepting commented Sep 23, 2020

Describe the bug
The install script fails on the Apple DTK (Developer Transition Kit). This is on macOS 11 Beta 8.

Screen Shot 2020-09-23 at 2 26 38 PM

This isn't an issue due to Big Sur, as that has already been fixed (#3853).

Steps To Reproduce

  1. Open Terminal.app
  2. Paste curl -L https://nixos.org/nix/install | sh
  3. See error

Expected behavior
I expected the install to begin on my DTK. Alternately, I would have expected at least an informative message explaining that "We don't yet support Nix on macOS using the ARM architecture...", etc.

nix-env --version output
zsh: command not found: nix-env

@shepting shepting added the bug label Sep 23, 2020
@shepting
Copy link
Author

It looks like the more full-featured request for support of ARM Macs is here: #3853

This bug could be solved with a simple log message explaining that support is being worked on.

@edolstra
Copy link
Member

Nix on Apple Silicon is not currently supported. Not sure if anybody is actively working on it at the moment.

@Kloenk
Copy link
Member

Kloenk commented Sep 24, 2020

I would like to work on it, but don't have an DTK, and I'm also a student, so only limited time available.

@abathur
Copy link
Member

abathur commented Nov 10, 2020

It seems like a win to at least fix the error message here.

@shepting Can you confirm what /bin/sh -c "uname -m" returns? (hopefully arm64?)

@thefloweringash
Copy link
Member

It returns arm64 for me. We should use the x86_64 binary until we have we have native support.

abathur added a commit to abathur/nix that referenced this issue Nov 10, 2020
Throwing @thefloweringash under the bus if this doesn't work, but it
sounds like Apple Silicon devices can use the x86_64 binary for now.

Fixes NixOS#4058
@domenkozar
Copy link
Member

@Kloenk
Copy link
Member

Kloenk commented Nov 14, 2020

Thanks. I ordered the Mac book Pro, so will have one shortly. My exams are soon, so probably not to bad to just wait, and then have time with own hardware.

@angerman
Copy link
Contributor

@abathur's change 4864df6 does work.

(assuming a patched install script as per the change above)

sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume

will successfully install an x86_64 nix, that works via rosetta.

nix-build -I nixpkgs=https://github.com/nixos/nixpkgs/archive/master.tar.gz -E '(import <nixpkgs> {}).hello.overrideAttrs (_: { HELLO = "WORLD"; })'

will then build a working hello executable.

➜  ~ nix-build -I nixpkgs=https://github.com/nixos/nixpkgs/archive/master.tar.gz -E '(import <nixpkgs> {}).hello.overrideAttrs (_: { HELLO = "WORLD"; })'
➜  ~ file ./result/bin/hello
./result/bin/hello: Mach-O 64-bit executable x86_64
➜  ~ ./result/bin/hello
Hello, world!
➜  ~ echo $(uname -s).$(uname -m)
Darwin.arm64

domenkozar pushed a commit that referenced this issue Nov 20, 2020
Throwing @thefloweringash under the bus if this doesn't work, but it
sounds like Apple Silicon devices can use the x86_64 binary for now.

Fixes #4058

(cherry picked from commit 4864df6)
Signed-off-by: Domen Kožar <domen@dev.si>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants