"rosetta error: load commands too large" when running test binary
Summary
When attempting to run tests with cabal-install
3.6.2.0 on an M1 MacBook in x86 mode (through rosetta), the test binary can't be run:
$ cabal --builddir=dist/current run test:test
Up to date
rosetta error: /Users/wiggles/mercury-web-backend/dist/current/build/x86_64-osx/ghc-9.2.2/mwb-0/t/test/noopt/build/test/test: load commands too large
fish: Job 1, 'cabal --builddir=dist/current r…' terminated by signal SIGTRAP (Trace or breakpoint trap)
Steps to reproduce
This is a large corporate project so I don't have a minimal/public reproduction yet. However the Google search for "rosetta error" "load commands too large"
returned zero results, so I wanted to file an issue as a marker in case anyone else runs into this bug / to fill in if I get a reproduction later.
Expected behavior
Run the tests successfully.
Environment
- GHC version used: 9.2.2
Optional:
- Operating System: macOS Monterey 12.3.1 (21E258)
- System Architecture: M1
$ uname -a
Darwin helvetica 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:47:26 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T8101 x86_64 i386 MacBookPro17,1 Darwin
$ cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.3.0 of the Cabal library
$ echo $IN_NIX_SHELL
impure
$ cat ~/.config/nix/nix.conf
# ...
system = x86_64-darwin