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

Beam modules throw bus error in aarch64-darwin on macOS 14 Sonoma #258100

Closed
cornedor opened this issue Sep 29, 2023 · 7 comments
Closed

Beam modules throw bus error in aarch64-darwin on macOS 14 Sonoma #258100

cornedor opened this issue Sep 29, 2023 · 7 comments
Labels
0.kind: bug Something is broken

Comments

@cornedor
Copy link
Contributor

Describe the bug

This is related to #257880

Aside from older Erlang version, beam modules are also not working. I currently cannot find a workaround for this issue.

Steps To Reproduce

Steps to reproduce the behavior:
On a darwin-aarch64 system run:

  • nix-shell -p erlfmt.out --run erlfmt
  • nix-shell -p erlang-ls.out --run erlang_ls

Expected behavior

The program runs

Screenshots

N/A

Additional context

Add any other context about the problem here.

Notify maintainers

@ankhers @Br1ght0ne @happysalada @minijackson @yurrriq

Metadata

nix-shell -p nix-info --run "nix-info -m"
these 2 paths will be fetched (0.01 MiB download, 0.11 MiB unpacked):
  /nix/store/82w7k2rr446hjhi29kd8ckbpgbiykpiw-DarwinTools-1
  /nix/store/pj9fq9np0333iihkbkkx7qys2qjnw5gf-nix-info
copying path '/nix/store/82w7k2rr446hjhi29kd8ckbpgbiykpiw-DarwinTools-1' from 'https://cache.nixos.org'...
copying path '/nix/store/pj9fq9np0333iihkbkkx7qys2qjnw5gf-nix-info' from 'https://cache.nixos.org'...
 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.0.0, macOS 14.0`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.17.0`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
@cornedor cornedor added the 0.kind: bug Something is broken label Sep 29, 2023
@happysalada
Copy link
Contributor

Hey thanks for reporting. I dont have enough darwin experience to be of any help here. Will keep an eye on things to see if a solution appears.

@zoedsoupe
Copy link

Same issue here. Beam packages built with erlangR26 works fine, however some packages doesn’t support it yet like elixir-ls. workaround for now is disabling jit on the erlang building!

@nifoc
Copy link
Contributor

nifoc commented Oct 5, 2023

This appears to not be nixpkgs specific and is tracked upstream: erlang/otp#7687

@alexpearce
Copy link

workaround for now is disabling jit on the erlang building!

For those wondering what that might look like:

# Choose your Erlang version here, e.g. R25 or R26.
erlang = pkgs.beam.interpreters.erlangR25.override {
  configureFlags = ["--disable-jit"];
};
# Access BEAM packages via beamPackages,
# e.g. `beamPackages.elixir` or `beamPackages.elixir-ls`.
beamPackages = beam.packagesWith erlang;

@c4710n
Copy link
Contributor

c4710n commented Oct 16, 2023

@cornedor This should be fixed in master branch, you can test it.

@cornedor
Copy link
Contributor Author

I guess it is fixed. When running using nix-shell I still get the error, but using nix shell nixpkgs#erlfmt it's fine.

nix on  main [!?]
❯ nix-shell -p erlfmt.out --run 'erlfmt --version'
/private/tmp/nix-shell-2037-0/rc: line 3:  2045 Bus error: 10           erlfmt --version

nix on  main [!?]
❯ nix shell nixpkgs#erlfmt

nix on  main [!?]
❯ erlfmt --version
erlfmt version 1.2.0

@c4710n
Copy link
Contributor

c4710n commented Oct 17, 2023

Yeah, then it should be good.

A comment

nix-shell and nix shell are using different mechanism for searching nix expressions:

  • nix-shell is using NIX_PATH, which is configured by nix.nixPath.
  • nix shell is using Flake Registry, which is configured by nix.registry.

You can try fine-tuning the NIX_PATH, and it should work as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

6 participants