Closed duvenaud closed 2 years ago
Hmmm, macOS CI was giving those same messages. I assumed it was some stale cache problem and disabled it. It looks like it's still trying to use the old version of llvm-hs. Have you tried nuking the system-wide stack cache at ~/.stack ? I can try debugging on Melis's mac this evening.
I nuked the stack cache, and now make
fails at building the Haskell LLVM library version 9.0.1:
make
clang++ -fPIC -I/usr/local/include -std=c++11 -fno-exceptions -fno-rtti -DDEX_LIVE -c -emit-llvm src/lib/dexrt.cpp -o src/lib/dexrt.bc
stack --stack-yaml=stack-macos.yaml build
llvm-hs> configure
llvm-hs> [1 of 2] Compiling Main ( /private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-ede3e916140be721/llvm-hs-9.0.1/Setup.hs, /private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-ede3e916140be721/llvm-hs-9.0.1/.stack-work/dist/x86_64-osx/Cabal-3.0.1.0/setup/Main.o )
llvm-hs> [2 of 2] Compiling StackSetupShim ( /Users/bmo/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-ede3e916140be721/llvm-hs-9.0.1/.stack-work/dist/x86_64-osx/Cabal-3.0.1.0/setup/StackSetupShim.o )
llvm-hs> Linking /private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-ede3e916140be721/llvm-hs-9.0.1/.stack-work/dist/x86_64-osx/Cabal-3.0.1.0/setup/setup ...
llvm-hs> setup: The program 'llvm-config' version ==9.0.* is required but the version
llvm-hs> found at /usr/local/opt/llvm@12/bin/llvm-config is version 12.0.1
llvm-hs>
Progress 1/2
-- While building package llvm-hs-9.0.1 (scroll up to its section to see the error) using:
/private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-ede3e916140be721/llvm-hs-9.0.1/.stack-work/dist/x86_64-osx/Cabal-3.0.1.0/setup/setup --builddir=.stack-work/dist/x86_64-osx/Cabal-3.0.1.0 configure --user --package-db=clear --package-db=global --package-db=/Users/bmo/.stack/snapshots/x86_64-osx/3d315b4f96ed92d039edbdffbe5c917b8d118542bb335e176474c01c9c849f1b/8.8.4/pkgdb --libdir=/Users/bmo/.stack/snapshots/x86_64-osx/3d315b4f96ed92d039edbdffbe5c917b8d118542bb335e176474c01c9c849f1b/8.8.4/lib --bindir=/Users/bmo/.stack/snapshots/x86_64-osx/3d315b4f96ed92d039edbdffbe5c917b8d118542bb335e176474c01c9c849f1b/8.8.4/bin --datadir=/Users/bmo/.stack/snapshots/x86_64-osx/3d315b4f96ed92d039edbdffbe5c917b8d118542bb335e176474c01c9c849f1b/8.8.4/share --libexecdir=/Users/bmo/.stack/snapshots/x86_64-osx/3d315b4f96ed92d039edbdffbe5c917b8d118542bb335e176474c01c9c849f1b/8.8.4/libexec --sysconfdir=/Users/bmo/.stack/snapshots/x86_64-osx/3d315b4f96ed92d039edbdffbe5c917b8d118542bb335e176474c01c9c849f1b/8.8.4/etc --docdir=/Users/bmo/.stack/snapshots/x86_64-osx/3d315b4f96ed92d039edbdffbe5c917b8d118542bb335e176474c01c9c849f1b/8.8.4/doc/llvm-hs-9.0.1 --htmldir=/Users/bmo/.stack/snapshots/x86_64-osx/3d315b4f96ed92d039edbdffbe5c917b8d118542bb335e176474c01c9c849f1b/8.8.4/doc/llvm-hs-9.0.1 --haddockdir=/Users/bmo/.stack/snapshots/x86_64-osx/3d315b4f96ed92d039edbdffbe5c917b8d118542bb335e176474c01c9c849f1b/8.8.4/doc/llvm-hs-9.0.1 --dependency=Cabal=Cabal-3.0.1.0 --dependency=array=array-0.5.4.0 --dependency=attoparsec=attoparsec-0.13.2.4-AHmlmm44dvnKaiPmUJc2M1 --dependency=base=base-4.13.0.0 --dependency=bytestring=bytestring-0.10.10.1 --dependency=containers=containers-0.6.2.1 --dependency=exceptions=exceptions-0.10.4-6ENJVzINLe28VlhOUrvEZK --dependency=llvm-hs-pure=llvm-hs-pure-9.0.0-1zpu9iorlHyBu5P9Rr9VX1 --dependency=mtl=mtl-2.2.2 --dependency=template-haskell=template-haskell-2.15.0.0 --dependency=transformers=transformers-0.5.6.2 --dependency=utf8-string=utf8-string-1.0.1.1-K3Cc2i5eeGM49mkpXdBKoc -f-debug -f-shared-llvm --exact-configuration --ghc-option=-fhide-source-paths
Process exited with code: ExitFailure 1
make: *** [build] Error 1
--stack-yaml=stack-macos.yaml
Oops! I didn't know there was a stack-macos.yaml
. That'll do it!
Does it work if you copy the llvm lines from stack.yaml
to stack-macos.yaml
?
Haha, yes just noticed the hardcoded reference to apaszke/llvm-hs
. Rebuilding now. Not sure whether to keep the last lines of the old stack-macos.yaml
:
flags:
llvm-hs:
shared-llvm: false
but I'm leaving them in for now, I'll try both ways if it doesn't work.
Probably also need to update the resolver, resolver: lts-18.23
Yes, I copied the updated resolver over, too.
Hmmm, that helps, it's actually building llvm-hs 12.0.0
now, but it seems to choke on compiling one of the cpp files:
.
.
.
[ 99 of 102] Compiling LLVM.Transforms
llvm-hs > [100 of 102] Compiling LLVM.Internal.FFI.PassManager
llvm-hs > [101 of 102] Compiling LLVM.Internal.PassManager
llvm-hs > [102 of 102] Compiling LLVM.PassManager
llvm-hs >
llvm-hs > /private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-626bff90a687736e/llvm-hs-12.0.0/In file included from src/LLVM/Internal/FFI/AssemblyC.cpp:2:0: error:
llvm-hs >
llvm-hs >
llvm-hs > /private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-626bff90a687736e/llvm-hs-12.0.0/In file included from /usr/local/Cellar/llvm@12/12.0.1_1/include/llvm/AsmParser/Parser.h:16:0: error:
llvm-hs >
llvm-hs >
llvm-hs > /private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-626bff90a687736e/llvm-hs-12.0.0/In file included from /usr/local/Cellar/llvm@12/12.0.1_1/include/llvm/ADT/STLExtras.h:19:0: error:
llvm-hs >
llvm-hs >
llvm-hs > /private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-626bff90a687736e/llvm-hs-12.0.0/In file included from /usr/local/Cellar/llvm@12/12.0.1_1/include/llvm/ADT/Optional.h:18:0: error:
llvm-hs >
llvm-hs >
llvm-hs > /private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-626bff90a687736e/llvm-hs-12.0.0/In file included from /usr/local/Cellar/llvm@12/12.0.1_1/include/llvm/ADT/Hashing.h:49:0: error:
llvm-hs >
llvm-hs >
llvm-hs > /private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-626bff90a687736e/llvm-hs-12.0.0//usr/local/Cellar/llvm@12/12.0.1_1/include/llvm/Support/SwapByteOrder.h:98:1: error:
llvm-hs > error: unknown type name 'constexpr'
llvm-hs > |
llvm-hs > 98 | constexpr bool IsBigEndianHost = false;
llvm-hs > | ^
llvm-hs > constexpr bool IsBigEndianHost = false;
.
.
.
fatal error: too many errors emitted, stopping now [-ferror-limit=]
llvm-hs > 4 warnings and 20 errors generated.
llvm-hs > `gcc' failed in phase `C Compiler'. (Exit code: 1)
Progress 121/122
-- While building package llvm-hs-12.0.0 (scroll up to its section to see the error) using:
/private/var/folders/xg/c4_dcmvd2fb8q18hfqy3dgn00000gn/T/stack-626bff90a687736e/llvm-hs-12.0.0/.stack-work/dist/x86_64-osx/Cabal-3.2.1.0/setup/setup --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
make: *** [build] Error 1
Every line of this file throws an error. It's surprising to me that gcc
is being called instead of clang
.
Getting closer at least...
I just made #757 to see if we can get the CI build working with the fixed stack-macos.yaml
CI failed with the same error you're now getting: https://github.com/google-research/dex-lang/runs/5045648459?check_suite_focus=true
Maybe it's an llvm-hs bug at this point? @apaszke , any ideas?
Yeah that looks like an llvm-hs bug, where it doesn't specify -std=c++11
to the C++ files it compiles. Should be easy to fix
EDIT: Seems like it is doing that
Adam's fix seems to work! Just merged #757. @duvenaud , does it work for you now?
Yep, builds fine for me now! Thanks a ton guys.
I updated to LLVM 12, Clang 12, and updated all my paths, as far as I can tell. But when I run
make
on a freshly-downloadedsafer-names-dev
branch, I get this error: