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.