0

I try to build my project on M1 Mac (AARCH64) platform with cabal:

cabal --with-compiler="/Users/Me/.stack/programs/x86_64-osx/ghc-9.2.3/bin/ghc" --store-dir=.cabal-store build

and it fails with error:

...
Failed to build bzlib-conduit-0.3.0.2.
Build log ( /Users/Me/.cabal/logs/ghc-9.2.3/bzlb-cndt-0.3.0.2-0a89fc9a.log
):
Configuring library for bzlib-conduit-0.3.0.2..
Preprocessing library for bzlib-conduit-0.3.0.2..
src/Data/Conduit/BZlib/Internal.hsc:8 directive strict_import cannot be handled in cross-compilation mode
Error: cabal: Failed to build bzlib-conduit-0.3.0.2
...

I tried to run cabal command in subshell running as arch -x86_64 zsh, but the result is the same.

How to fix it?

EDIT: I try to get x86_64 executable on this platform.

1 Answer 1

0

After many experiments: unlike stack tool, cabal binary built for x86_64 should be used. Everything else is the same. arch -x86_64 is not required. But GHC binary should be right - built for x86_64 platform as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.