Open turion opened 2 years ago
I think the underlying problem is that x86_64-darwin erlang doesn't work under Rosetta 2, which means it's probably an upstream bug.
# on an M1 Mac Mini
❯ $(nix-build -A erlang --argstr system x86_64-darwin)/bin/erl
zsh: segmentation fault $(nix-build -A erlang --argstr system x86_64-darwin)/bin/erl
Nixpkgs cross and Rossetta 2 are orthogonal systems. Setting --argstr system x86_64-darwin
means that build = host = target = x86_64-darwin
and all dependencies should be from the same package set, so in this case it shouldn't make any difference where dependencies go (at least with strictDeps = false
).
Regarding https://github.com/NixOS/nixpkgs/pull/169684#issuecomment-1107470733
Interestingly,
erlang
is listed underbuildInputs
, but it appears to be pulling in the aarch64-darwin version even when I specify--system x86_64-darwin
. The path to erl is:
/nix/store/nvngkn9yj4gx1b5jxfallzrxk2vi7l21-erlang-24.2/bin/erl
I'm suspicious of this result:
❯ nix-shell -A rabbitmq-server --argstr system x86_64-darwin --run 'command -v erl'
/nix/store/h7krx0a1if4wy562p2h9n8srr3krclnf-erlang-24.2/bin/erl
❯ nix-shell -A rabbitmq-server --argstr system aarch64-darwin --run 'command -v erl'
/nix/store/nvngkn9yj4gx1b5jxfallzrxk2vi7l21-erlang-24.2/bin/erl
Probably,
elixir
anderlang
need to go todepsBuildBuild
, but this doesn't fix the problem entirely.
For nixpkgs cross compilation, this is likely correct.
Does it surprise you that Hydra was green on this job recently? At least this is how I read it: https://hydra.nixos.org/build/174137098
Does it surprise you that Hydra was green on this job recently? At least this is how I read it: https://hydra.nixos.org/build/174137098
If that's a question for me, then no, not at all. The suspected failure is x86_64-darwin erlang running under Rosetta 2, but the machine that built rabbitmq-server (f402c2c2
) is native x86_64-darwin. (Slight assumption on my part, based on the hydra machine status page showing it only supporting x86_64-darwin, and having a different naming scheme to the aarch64-darwin machines).
In https://github.com/NixOS/nixpkgs/pull/169684 we noticed that
rabbitmq-server
doesn't build onx86_64-darwin
anymore despite no changes relevant to this.This is probably due to a cross-compilation issue in erlang on darwin. @reckenrode did some valuable research on this: https://github.com/NixOS/nixpkgs/pull/169684#issuecomment-1107470733
Probably,
elixir
anderlang
need to go todepsBuildBuild
, but this doesn't fix the problem entirely.CC @armeenm @NixOS/darwin-maintainers