Closed j6e closed 1 year ago
It's a bit unfortunate that stack
can't repeat the failed section at the bottom, it's hard to find.
The relevant lines are right near the top:
regex-pcre > Cabal-simple_SvXsv1f__3.0.1.0_ghc-8.8.4: The program 'pkg-config' version
regex-pcre > >=0.9.0 is required but it could not be found.
The regex-pcre library needs you to have a system dependency (i.e. a C library not managed by stack).
You could get it from whatever package manager you use on your macos system, e.g. homebrew: https://formulae.brew.sh/formula/pkg-config
thanks, it worked but now I get a different error:
Building all executables for `duckling' once. After a successful build of all of them, only specified executables will be rebuilt.
duckling> build (lib + exe)
Preprocessing library for duckling-0.2.0.0..
Building library for duckling-0.2.0.0..
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: ignoring file /opt/homebrew/Cellar/pcre/8.45/lib/libpcre.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Preprocessing executable 'duckling-expensive' for duckling-0.2.0.0..
Building executable 'duckling-expensive' for duckling-0.2.0.0..
Linking .stack-work/dist/x86_64-osx/Cabal-3.0.1.0/build/duckling-expensive/duckling-expensive ...
ld: warning: ignoring file /opt/homebrew/Cellar/pcre/8.45/lib/libpcre.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
"_pcre_compile", referenced from:
_LcclY_info in libHSregex-pcre-0.95.0.0-2ET47luPseYCyxUKIqxikm.a(Wrap.o)
"_pcre_exec", referenced from:
_LccBZ_info in libHSregex-pcre-0.95.0.0-2ET47luPseYCyxUKIqxikm.a(Wrap.o)
_LccO3_info in libHSregex-pcre-0.95.0.0-2ET47luPseYCyxUKIqxikm.a(Wrap.o)
_LccQr_info in libHSregex-pcre-0.95.0.0-2ET47luPseYCyxUKIqxikm.a(Wrap.o)
_LccRN_info in libHSregex-pcre-0.95.0.0-2ET47luPseYCyxUKIqxikm.a(Wrap.o)
"_pcre_fullinfo", referenced from:
_LccA5_info in libHSregex-pcre-0.95.0.0-2ET47luPseYCyxUKIqxikm.a(Wrap.o)
_LccLg_info in libHSregex-pcre-0.95.0.0-2ET47luPseYCyxUKIqxikm.a(Wrap.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
Error: [S-7282]
Stack failed to execute the build plan.
While executing the build plan, Stack encountered the following errors:
[S-7011]
While building package duckling-0.2.0.0 (scroll up to its section to see the error) using:
/Users/user/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_SvXsv1f__3.0.1.0_ghc-8.8.4 --verbose=1 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.0.1.0 build lib:duckling exe:custom-dimension-example exe:duckling-example-exe exe:duckling-expensive exe:duckling-regen-exe exe:duckling-request-sample --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Hmm. I know what's happening here, but I'm unsure how to fix it:
libpcre
, which makes sense on an M1The solutions are to either:
I might be able to work this out, but I'm not much of an expert on this layer of the stack so cc @chessai who might know the solution straightaway
I have managed to build the code! As you said I had to download the x86_64 version of libpcre.
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
arch -x86_64 /usr/local/bin/brew install pcre
stack build
Thanks!
I've been trying to build this project but it fails on my mac M1 Pro. I'm not a Haskell user so I'm not really sure how to fix the error, I've tried but couldn't figure it out.
This is the log output of the stack build.
Any ideas?