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

do not always -Iincludes, addresses #608 #610

Closed alpmestan closed 6 years ago

alpmestan commented 6 years ago

It turns out the ghc-heap we build with stage 0 ends up seeing ./includes before it seems the boot compiler's includes, which causes problems with the recent SRT change that affects the representation of info tables. But when we build the ghc library with the boot compiler, we do need to see ./includes first. Hence this patch, with which I have successfully run ./build.sh -j4 --flavour=quickest.

@snowleopard Should most CI scripts be green if this patch indeed fixes our current problem(s) ?

snowleopard commented 6 years ago

@alpmestan Thanks! I think we expect green CI (modulo time outs).

I'm currently verifying on my Windows machine.

alpmestan commented 6 years ago

OK :) Note that I ended up needing to do ||^ package compiler (the ghc library), not ||^ package ghc (the ghc executable).

snowleopard commented 6 years ago

Yep, I also realised my mistake when building with package ghc :)

snowleopard commented 6 years ago

My build fails with:

Command: _build/stage0/bin/ghc.exe -Wall -hisuf debug_hi -osuf debug_o -hcsuf debug_hc -static -optc-DDEBUG -ticky -DTICKY_TICKY -hide-all-packages -no-user-package-db "-package-db _build/stage1/lib/package.conf.d" "-this-unit-id rts-1.0" -i -i_build/stage1/rts/build -i_build/stage1/rts/build/autogen -irts/. -Iincludes -I_build/generated -I_build/stage1/rts/build -I_build/stage1/rts/build/build -I_build/stage1/rts/build/../includes -I_build/stage1/rts/build/includes -I_build/stage1/rts/build/includes/dist-derivedconstants/header -Irts/build -Irts/../includes -Irts/includes -Irts/includes/dist-derivedconstants/header -I_build/generated -optc-I_build/generated -optP-include -optP_build/stage1/rts/build/autogen/cabal_macros.h -ghcversion-file=_build/generated/ghcversion.h -optc-fno-stack-protector -odir _build/stage1/rts/build -hidir _build/stage1/rts/build -stubdir _build/stage1/rts/build -optc-fno-stack-protector -optc-Iincludes -optc-I_build/generated -optc-I_build/stage1/rts/build -optc-I_build/stage1/rts/build/build -optc-I_build/stage1/rts/build/../includes -optc-I_build/stage1/rts/build/includes -optc-I_build/stage1/rts/build/includes/dist-derivedconstants/header -optc-Irts/build -optc-Irts/../includes -optc-Irts/includes -optc-Irts/includes/dist-derivedconstants/header -Wnoncanonical-monad-instances -optc-Wno-error=inline -c rts/StgCRun.c -o _build/stage1/rts/build/c/StgCRun.debug_o -O0 -H64m -this-unit-id rts -XHaskell98 -ghcversion-file=D:/msys/home/nam83/ghc/_build/generated/ghcversion.h -optc-Irts -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Wundef -optc-fno-strict-aliasing -optc-I_build/stage1/rts/build "-optc-DRtsWay=\"rts_debug\"" -optc-DFS_NAMESPACE=rts -optc-O2 -optc-DDEBUG -optc-DTICKY_TICKY -optc-w -optc-Wno-return-local-addr -optc-DWINVER=0x06000100 -Irts -Wno-deprecated-flags -Wcpp-undef
Exit code: 1
Stderr:
C:\\Users\\nam83\\AppData\\Local\\Temp\\ghc11648_0\\ghc_1.s: Assembler messages:
C:\\Users\\nam83\\AppData\\Local\\Temp\\ghc11648_0\\ghc_1.s:45: Error: CFI instruction used without previous .cfi_startproc
C:\\Users\\nam83\\AppData\\Local\\Temp\\ghc11648_0\\ghc_1.s:46: Error: CFI instruction used without previous .cfi_startproc
C:\\Users\\nam83\\AppData\\Local\\Temp\\ghc11648_0\\ghc_1.s:47: Error: CFI instruction used without previous .cfi_startproc
C:\\Users\\nam83\\AppData\\Local\\Temp\\ghc11648_0\\ghc_1.s:48: Error: CFI instruction used without previous .cfi_startproc
C:\\Users\\nam83\\AppData\\Local\\Temp\\ghc11648_0\\ghc_1.s:49: Error: CFI instruction used without previous .cfi_startproc
C:\\Users\\nam83\\AppData\\Local\\Temp\\ghc11648_0\\ghc_1.s:50: Error: CFI instruction used without previous .cfi_startproc
C:\\Users\\nam83\\AppData\\Local\\Temp\\ghc11648_0\\ghc_1.s:51: Error: CFI instruction used without previous .cfi_startproc
C:\\Users\\nam83\\AppData\\Local\\Temp\\ghc11648_0\\ghc_1.s:52: Error: CFI instruction used without previous .cfi_startproc
C:\\Users\\nam83\\AppData\\Local\\Temp\\ghc11648_0\\ghc_1.s:53: Error: CFI instruction used without previous .cfi_startproc
`gcc.exe' failed in phase `Assembler'. (Exit code: 1)
)

Not sure whether this is related to the include paths. Looks more like a missing warning suppression.

snowleopard commented 6 years ago

Just as an experiment, I tried adding ||^ package rts, but this didn't help.

snowleopard commented 6 years ago

@alpmestan I've raised a separate issue for the Windows error. But there is also a CI error on OSX.

Do you think we shall merge this as is?

alpmestan commented 6 years ago

@snowleopard Looks like things went fine on Linux, but not OS X or Windows? Are the OS X failures known? @angerman knows perhaps? (see here)

bgamari commented 6 years ago

The OS X issues are indeed known. This is #15207. I have a patch; unfortunately it breaks on Linux.

alpmestan commented 6 years ago

Hah, ok. Well, in that case I think we can perhaps go ahead and merge this PR. But to be entirely honest I'm not sure what the Windows error really is about.

snowleopard commented 6 years ago

Agreed. Merged!