snowleopard / hadrian

Hadrian: a new build system for the Glasgow Haskell Compiler. Now merged into the GHC tree!
https://gitlab.haskell.org/ghc/ghc/tree/master/hadrian
MIT License
208 stars 39 forks source link

Build failure on OS X when linking _build/stage1/bin/hpc #614

Closed snowleopard closed 5 years ago

snowleopard commented 6 years ago

Our OS X instances currently fail with:

Command: _build/stage0/bin/ghc -Wall -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-db _build/stage1/lib/package.conf.d' '-package-id array-0.5.2.0' '-package-id base-4.12.0.0' '-package-id containers-0.5.11.0' '-package-id directory-1.3.2.3' '-package-id filepath-1.4.2' '-package-id hpc-0.6.0.3' -i -i_build/stage1/utils/hpc/build -i_build/stage1/utils/hpc/build/hpc/autogen -iutils/hpc/. -Iincludes -I_build/generated -I_build/stage1/utils/hpc/build -I/Users/distiller/hadrian/ghc/_build/stage1/lib/x86_64-osx-ghc-8.5.20180612/unix-2.8.0.0/include -I/Users/distiller/hadrian/ghc/_build/stage1/lib/x86_64-osx-ghc-8.5.20180612/time-1.8.0.2/include -I/Users/distiller/hadrian/ghc/_build/stage1/lib/x86_64-osx-ghc-8.5.20180612/bytestring-0.10.8.2/include -I/Users/distiller/hadrian/ghc/_build/stage1/lib/x86_64-osx-ghc-8.5.20180612/base-4.12.0.0/include -I/Users/distiller/hadrian/ghc/_build/stage1/lib/x86_64-osx-ghc-8.5.20180612/rts-1.0/include -I_build/generated -optc-I_build/generated -optP-include -optP_build/stage1/utils/hpc/build/hpc/autogen/cabal_macros.h -optc-fno-stack-protector -odir _build/stage1/utils/hpc/build -hidir _build/stage1/utils/hpc/build -stubdir _build/stage1/utils/hpc/build -no-auto-link-packages -rtsopts -Wnoncanonical-monad-instances -optc-Wno-unknown-pragmas _build/stage1/utils/hpc/build/Main.o _build/stage1/utils/hpc/build/HpcParser.o _build/stage1/utils/hpc/build/HpcCombine.o _build/stage1/utils/hpc/build/HpcDraft.o _build/stage1/utils/hpc/build/HpcFlags.o _build/stage1/utils/hpc/build/HpcLexer.o _build/stage1/utils/hpc/build/HpcMarkup.o _build/stage1/utils/hpc/build/HpcOverlay.o _build/stage1/utils/hpc/build/HpcReport.o _build/stage1/utils/hpc/build/HpcShowTix.o _build/stage1/utils/hpc/build/HpcUtils.o _build/stage1/utils/hpc/build/Paths_hpc_bin.o -o _build/stage1/bin/hpc -O0 -H64m -XHaskell2010 -ghcversion-file=/Users/distiller/hadrian/ghc/_build/generated/ghcversion.h
Exit code: 1
Stderr:
Undefined symbols for architecture x86_64:
  "_findPtr", referenced from:
     -u command line option
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)
)

This seems to be unrelated to https://ghc.haskell.org/trac/ghc/ticket/15207.

snowleopard commented 6 years ago

I think this is related: https://phabricator.haskell.org/D4683

snowleopard commented 6 years ago

I added a comment there: https://phabricator.haskell.org/D4683#133622

ndmitchell commented 5 years ago

The fact this is broken is a little sad... I just had to go in and patch the file manually.

snowleopard commented 5 years ago

There are some relevant comments here: https://phabricator.haskell.org/D4846

snowleopard commented 5 years ago

@alpmestan assigning you to this issue following #678.

alpmestan commented 5 years ago

Got a patch at https://phabricator.haskell.org/D5138 + some CI tweaks in #678 to test the said patch.

alpmestan commented 5 years ago

hadrian can build GHC again on OS X: https://circleci.com/gh/snowleopard/hadrian/451

678 got merged, so I'm closing this ticket.

ndmitchell commented 5 years ago

This doesn't work for people who check out GHC and and build it...

snowleopard commented 5 years ago

Indeed, let's keep this open until @alpmestan's fix is in the GHC HEAD.

snowleopard commented 5 years ago

I think we can now close this: building on OS X should now work without any workarounds.

snowleopard commented 5 years ago

See #690.