Closed brianmcgee closed 2 years ago
Can you try with #130 ? I have seen that issue before and I think it has been fixed in nixos-unstable.
Different failure now:
strip is /nix/store/0zcf6wnk2zrpdz6q4rqk4y90yfcw7mvn-clang-wrapper-11.1.0/bin/strip
patching script interpreter paths in /nix/store/mgqgsdsjdvqrb67b7bm8b6mxf6jc9f4a-ormolu-0.1.4.1-data
strip is /nix/store/0zcf6wnk2zrpdz6q4rqk4y90yfcw7mvn-clang-wrapper-11.1.0/bin/strip
patching script interpreter paths in /nix/store/8ai2rsfpx9gc43d5jxawm53wqll13ql5-ormolu-0.1.4.1-doc
strip is /nix/store/0zcf6wnk2zrpdz6q4rqk4y90yfcw7mvn-clang-wrapper-11.1.0/bin/strip
stripping (with command strip and flags -S) in /nix/store/gl2832pyfc7l1pzji6hbckfkqyhqi1qz-ormolu-0.1.4.1-bin/bin
patching script interpreter paths in /nix/store/gl2832pyfc7l1pzji6hbckfkqyhqi1qz-ormolu-0.1.4.1-bin
cycle detected in the references of '/nix/store/gl2832pyfc7l1pzji6hbckfkqyhqi1qz-ormolu-0.1.4.1-bin' from '/nix/store/llpjv8kzb16r8hw19wd8wqx0srcvr5ll-ormolu-0.1.4.1'
cannot build derivation '/nix/store/lzsqfzy8zqgw974z00ap75qlw1sm5cki-devshell-dir.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ddiwqrf2c3h9qg6f5dmwc8719ilv2lp0-treefmt-entrypoint.drv': 1 dependencies couldn't be built
error: build of '/nix/store/ddiwqrf2c3h9qg6f5dmwc8719ilv2lp0-treefmt-entrypoint.drv' failed
Earlier in the compilation I was seeing a lot of this from various packages:
'apple-a7' is not a recognized processor for this target (ignoring processor)`
That's because aarch64-darwin is not quite there yet. You can try nix-shell --system x86_64-darwin
I literally just had a look at the flake and saw the architectures listed and realised it didn't have a aarch64-darwin
.
Tried with x86_64-darwin
but ran into this:
warning: ignoring the user-specified setting 'system', because it is a restricted setting and you are not a trusted user
I'm using Nix Darwin, so I'm trying to figure out how to make my user a trusted user.
That's because aarch64-darwin is not quite there yet. You can try
nix-shell --system x86_64-darwin
As an aside, where can I track the effort to add ARM support?
I was able to activate flake support and successfully built 😄
Is there a way to set x86_64-darwin
as the default system system wide? An env variable or something?
You want to set system = "x86_64-darwin"
in /etc/nix/nix.conf
. In nix-darwin, this can be achieved by adding it to the nix.extraOptions
attribute. See https://github.com/LnL7/nix-darwin/blob/e1a3f7292f085fd588d11f94ed0f47968c16df0c/modules/nix/default.nix#L126-L134
I'm not sure if there is a meta ticket for M1. There is https://github.com/NixOS/nixpkgs/issues/116341 or search for M1 or aarch64-darwin on the issue tracker. I think https://github.com/NixOS/nixpkgs/pull/136049 might be related to the error you were seeing, ormolu is the code formatter for Haskell.
Thanks for this! Just wanted to add that you want to set system = x86_64-darwin
in /etc/nix/nix.conf
without the quotes around x86_64-darwin
😃
I cloned this repo for the first time on aarch64-darwin
, ran direnv allow
upon entering the repo, and the devshell built without issues. nix develop
also works.
Edit:
System info: latest master
, M2 MacBook Air, macOS@12.6.1
FWIW, I already had extra-platforms = x86_64-darwin aarch64-darwin
in my /etc/nix/nix.conf
, managed by a nix-darwin flake.
Yeah this can be closed, I forgot about it 😅
Describe the bug
Unable to enter the the dev shell on an M1 MacBook Pro
To Reproduce
Steps to reproduce the behavior:
nix-shell
from the root of the repository.Expected behavior
System information
Running this from latest
master
on macOS Big Sur 11.4, M1 Chip.