GHC does not build on macOS+nix
Summary
A recent change to GHC broke my development workflow on a macOS. After a git pull
, I can no longer build GHC. Here's the build system output:
| Run Ghc LinkHs Stage1: _build/stage1/utils/runghc/build/Main.dyn_o => _build/stage1/bin/runghc
Undefined symbols for architecture x86_64:
"_base_GHCziWord_W64zh_con_info", referenced from:
-u command line option
"_base_GHCziWord_W8zh_con_info", referenced from:
-u command line option
"_base_GHCziInt_I64zh_con_info", referenced from:
-u command line option
"_base_GHCziInt_I32zh_con_info", referenced from:
-u command line option
"_base_GHCziStable_StablePtr_con_info", referenced from:
-u command line option
"_base_GHCziInt_I16zh_con_info", referenced from:
-u command line option
"_base_GHCziInt_I8zh_con_info", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_Dzh_con_info", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_Czh_con_info", referenced from:
-u command line option
"_base_GHCziTopHandler_runMainIO_closure", referenced from:
-u command line option
"_base_GHCziTopHandler_flushStdHandles_closure", referenced from:
-u command line option
"_base_GHCziConcziSignal_runHandlersPtr_closure", referenced from:
-u command line option
"_base_GHCziWord_W16zh_con_info", referenced from:
-u command line option
"_base_GHCziPtr_FunPtr_con_info", referenced from:
-u command line option
"_base_GHCziPtr_Ptr_con_info", referenced from:
-u command line option
"_base_GHCziEventziThread_blockedOnBadFD_closure", referenced from:
-u command line option
"_base_GHCziIOziException_cannotCompactFunction_closure", referenced from:
-u command line option
"_base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_Izh_con_info", referenced from:
-u command line option
"_base_GHCziConcziSync_runSparks_closure", referenced from:
-u command line option
"_base_GHCziConcziIO_ensureIOManagerIsRunning_closure", referenced from:
-u command line option
"_base_GHCziTopHandler_runIO_closure", referenced from:
-u command line option
"_base_GHCziIOziException_cannotCompactPinned_closure", referenced from:
-u command line option
"_base_ControlziExceptionziBase_nonTermination_closure", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_Wzh_con_info", referenced from:
-u command line option
"_base_GHCziIOziException_blockedIndefinitelyOnMVar_closure", referenced from:
-u command line option
"_base_GHCziWeak_runFinalizzerBatch_closure", referenced from:
-u command line option
"_base_GHCziWord_W32zh_con_info", referenced from:
-u command line option
"_base_GHCziIOziException_heapOverflow_closure", referenced from:
-u command line option
"_base_ControlziExceptionziBase_nestedAtomically_closure", referenced from:
-u command line option
"_ZCMain_main_closure", referenced from:
_main in ghc_2.o
"_base_GHCziPack_unpackCString_closure", referenced from:
-u command line option
"_base_GHCziIOziException_cannotCompactMutable_closure", referenced from:
-u command line option
"_base_GHCziIOziException_blockedIndefinitelyOnSTM_closure", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_Fzh_con_info", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_False_closure", referenced from:
-u command line option
"_base_GHCziIOziException_stackOverflow_closure", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_True_closure", referenced from:
-u command line option
"_base_ControlziExceptionziBase_absentSumFieldError_closure", referenced from:
-u command line option
"_ghczmprim_GHCziTuple_Z0T_closure", referenced from:
-u command line option
"_base_GHCziTopHandler_runNonIO_closure", referenced from:
-u command line option
"_base_GHCziIOziException_allocationLimitExceeded_closure", referenced from:
-u command line option
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 1)
Error when running Shake build system:
at action, called at src/Rules.hs:69:19 in main:Rules
at need, called at src/Rules.hs:91:5 in main:Rules
* Depends on: _build/stage1/bin/runghc
* Raised the exception:
user error (Development.Shake.cmd, system command failed
Command line: _build/stage0/bin/ghc -Wall -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -hide-all-packages -no-user-package-db '-package-db _build/stage1/lib/package.conf.d' '-package-id base-4.13.0.0' '-package-id directory-1.3.3.2' '-package-id filepath-1.4.2.1' '-package-id process-1.6.5.0' '-package-id unix-2.7.2.2' -i -i_build/stage1/utils/runghc/build -i_build/stage1/utils/runghc/build/runghc/autogen -iutils/runghc/. -Iincludes -I_build/generated -I_build/stage1/utils/runghc/build -I/Users/int-index/Projects/ghc/_build/stage1/lib/x86_64-osx-ghc-8.9.0.20190514/process-1.6.5.0/include -I/Users/int-index/Projects/ghc/_build/stage1/lib/x86_64-osx-ghc-8.9.0.20190514/unix-2.7.2.2/include -I/Users/int-index/Projects/ghc/_build/stage1/lib/x86_64-osx-ghc-8.9.0.20190514/time-1.9.2/include -I/Users/int-index/Projects/ghc/_build/stage1/lib/x86_64-osx-ghc-8.9.0.20190514/bytestring-0.10.9.0/include -I/Users/int-index/Projects/ghc/_build/stage1/lib/x86_64-osx-ghc-8.9.0.20190514/base-4.13.0.0/include -I/Users/int-index/Projects/ghc/_build/stage1/lib/x86_64-osx-ghc-8.9.0.20190514/integer-gmp-1.0.2.0/include -I/Users/int-index/Projects/ghc/_build/stage1/lib/x86_64-osx-ghc-8.9.0.20190514/rts-1.0/include -I_build/generated -optc-I_build/generated -optP-include -optP_build/stage1/utils/runghc/build/runghc/autogen/cabal_macros.h -outputdir _build/stage1/utils/runghc/build -dynamic -optl-Wl,-rpath,@loader_path/../lib/x86_64-osx-ghc-8.9.0.20190514 -no-auto-link-packages -rtsopts -Wnoncanonical-monad-instances -optc-Wno-unknown-pragmas _build/stage1/utils/runghc/build/Main.dyn_o -o _build/stage1/bin/runghc -O0 -H64m -XHaskell2010 -ghcversion-file=/Users/int-index/Projects/ghc/_build/generated/ghcversion.h
Exit code: 1
Stderr:
Undefined symbols for architecture x86_64:
"_base_GHCziWord_W64zh_con_info", referenced from:
-u command line option
"_base_GHCziWord_W8zh_con_info", referenced from:
-u command line option
"_base_GHCziInt_I64zh_con_info", referenced from:
-u command line option
"_base_GHCziInt_I32zh_con_info", referenced from:
-u command line option
"_base_GHCziStable_StablePtr_con_info", referenced from:
-u command line option
"_base_GHCziInt_I16zh_con_info", referenced from:
-u command line option
"_base_GHCziInt_I8zh_con_info", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_Dzh_con_info", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_Czh_con_info", referenced from:
-u command line option
"_base_GHCziTopHandler_runMainIO_closure", referenced from:
-u command line option
"_base_GHCziTopHandler_flushStdHandles_closure", referenced from:
-u command line option
"_base_GHCziConcziSignal_runHandlersPtr_closure", referenced from:
-u command line option
"_base_GHCziWord_W16zh_con_info", referenced from:
-u command line option
"_base_GHCziPtr_FunPtr_con_info", referenced from:
-u command line option
"_base_GHCziPtr_Ptr_con_info", referenced from:
-u command line option
"_base_GHCziEventziThread_blockedOnBadFD_closure", referenced from:
-u command line option
"_base_GHCziIOziException_cannotCompactFunction_closure", referenced from:
-u command line option
"_base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_Izh_con_info", referenced from:
-u command line option
"_base_GHCziConcziSync_runSparks_closure", referenced from:
-u command line option
"_base_GHCziConcziIO_ensureIOManagerIsRunning_closure", referenced from:
-u command line option
"_base_GHCziTopHandler_runIO_closure", referenced from:
-u command line option
"_base_GHCziIOziException_cannotCompactPinned_closure", referenced from:
-u command line option
"_base_ControlziExceptionziBase_nonTermination_closure", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_Wzh_con_info", referenced from:
-u command line option
"_base_GHCziIOziException_blockedIndefinitelyOnMVar_closure", referenced from:
-u command line option
"_base_GHCziWeak_runFinalizzerBatch_closure", referenced from:
-u command line option
"_base_GHCziWord_W32zh_con_info", referenced from:
-u command line option
"_base_GHCziIOziException_heapOverflow_closure", referenced from:
-u command line option
"_base_ControlziExceptionziBase_nestedAtomically_closure", referenced from:
-u command line option
"_ZCMain_main_closure", referenced from:
_main in ghc_2.o
"_base_GHCziPack_unpackCString_closure", referenced from:
-u command line option
"_base_GHCziIOziException_cannotCompactMutable_closure", referenced from:
-u command line option
"_base_GHCziIOziException_blockedIndefinitelyOnSTM_closure", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_Fzh_con_info", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_False_closure", referenced from:
-u command line option
"_base_GHCziIOziException_stackOverflow_closure", referenced from:
-u command line option
"_ghczmprim_GHCziTypes_True_closure", referenced from:
-u command line option
"_base_ControlziExceptionziBase_absentSumFieldError_closure", referenced from:
-u command line option
"_ghczmprim_GHCziTuple_Z0T_closure", referenced from:
-u command line option
"_base_GHCziTopHandler_runNonIO_closure", referenced from:
-u command line option
"_base_GHCziIOziException_allocationLimitExceeded_closure", referenced from:
-u command line option
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 1)
)
Steps to reproduce
cabal v2-install happy
nix-shell https://github.com/alpmestan/ghc.nix/archive/master.tar.gz
./boot
HAPPY=~/.cabal/bin/happy ./configure
hadrian/build.sh --flavour=Quick
Expected behavior
Successful build.
Environment
- GHC version used: HEAD.
- Operating System: macOS Mojave 10.14.4