Hadrian tries building PrimOpWrappers with stage0
Adding a primop to primops.txt.pp
and building with hadrian results in a build failure when building GHC.PrimopWrappers
:
Error when running Shake build system:
at action, called at src/Rules.hs:71:19 in main:Rules
at need, called at src/Rules.hs:93:5 in main:Rules
* Depends on: _build/stage1/lib/package.conf.d/unix-2.7.2.2.conf
* Depends on: OracleQ (ContextDataKey (Context {stage = Stage1, package = Package {pkgType = Library, pkgName = "unix", pkgPath = "libraries/unix"}, way = v}))
* Depends on: _build/stage1/libraries/unix/setup-config
* Depends on: _build/stage1/lib/package.conf.d/time-1.9.3.conf
* Depends on: OracleQ (ContextDataKey (Context {stage = Stage1, package = Package {pkgType = Library, pkgName = "time", pkgPath = "libraries/time"}, way = v}))
* Depends on: _build/stage1/libraries/time/setup-config
* Depends on: _build/stage1/lib/package.conf.d/deepseq-1.4.4.0.conf
* Depends on: OracleQ (ContextDataKey (Context {stage = Stage1, package = Package {pkgType = Library, pkgName = "deepseq", pkgPath = "libraries/deepseq"}, way = v}))
* Depends on: _build/stage1/libraries/deepseq/setup-config
* Depends on: _build/stage1/lib/package.conf.d/ghc-prim-0.6.1.conf
* Depends on: _build/stage1/libraries/ghc-prim/build/libHSghc-prim-0.6.1.a
* Depends on: _build/stage1/libraries/ghc-prim/build/GHC/PrimopWrappers.o
* Depends on: _build/stage1/libraries/ghc-prim/build/GHC/PrimopWrappers.o _build/stage1/libraries/ghc-prim/build/GHC/PrimopWrappers.hi
* Raised the exception:
user error (Development.Shake.cmd, system command failed
Command line: _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' '-this-unit-id ghc-prim-0.6.1' '-package-id rts-1.0' -i -i_build/stage1/libraries/ghc-prim/build -i_build/stage1/libraries/ghc-prim/build/autogen -ilibraries/ghc-prim/. -Iincludes -I_build/generated -I_build/stage1/libraries/ghc-prim/build -I/opt/exp/ghc/ghc-debug/_build/stage1/lib/x86_64-linux-ghc-8.9.0.20190904/rts-1.0/include -I_build/generated -optc-I_build/generated -optP-include -optP_build/stage1/libraries/ghc-prim/build/autogen/cabal_macros.h -outputdir _build/stage1/libraries/ghc-prim/build -Wnoncanonical-monad-instances -optc-Werror=unused-but-set-variable -optc-Wno-error=inline -c _build/stage1/libraries/ghc-prim/build/GHC/PrimopWrappers.hs -o _build/stage1/libraries/ghc-prim/build/GHC/PrimopWrappers.o -O2 -H32m -this-unit-id ghc-prim -XHaskell2010 -ghcversion-file=/opt/exp/ghc/ghc-debug/_build/generated/ghcversion.h -Wno-deprecated-flags -Wno-trustworthy-safe
Exit code: 1
Stderr:
_build/stage1/libraries/ghc-prim/build/GHC/PrimopWrappers.hs:1497:23: error:
Not in scope: ‘GHC.Prim.pauseThread#’
Perhaps you meant one of these:
‘GHC.Prim.labelThread#’ (imported from GHC.Prim),
‘GHC.Prim.killThread#’ (imported from GHC.Prim)
Module ‘GHC.Prim’ does not export ‘pauseThread#’.
|
1497 | pauseThread# a1 a2 = (GHC.Prim.pauseThread#) a1 a2
| ^^^^^^^^^^^^^^^^^^^^^
)
The problem here appears to be that the bootstrap compiler is being used to build PrimOpWrappers
against the stage0 GHC.Prim
.