Help with build ordering issue

Hi, @Bodigrim is working on a patch (https://phabricator.haskell.org/D4212) to fix #14170. The build fails because of interface file errors: "bad interface file" for GHC.Natural and "failed to load interface" for GHC.Types. I suspect it is a wired-in module build ordering issue but I haven't been able to help fixing it. If anyone with more insights could help it would be much appreciated! Thanks, Sylvain

Sylvain Henry
Hi,
@Bodigrim is working on a patch (https://phabricator.haskell.org/D4212) to fix #14170.
The build fails because of interface file errors: "bad interface file" for GHC.Natural and "failed to load interface" for GHC.Types.
I suspect it is a wired-in module build ordering issue but I haven't been able to help fixing it. If anyone with more insights could help it would be much appreciated!
Can you paste the full error? What module is failing to compile? Which definition is it loading the interface for? Cheers, - Ben

On 20/02/2018 03:25, Ben Gamari wrote:
Sylvain Henry
writes: Hi,
@Bodigrim is working on a patch (https://phabricator.haskell.org/D4212) to fix #14170.
The build fails because of interface file errors: "bad interface file" for GHC.Natural and "failed to load interface" for GHC.Types.
I suspect it is a wired-in module build ordering issue but I haven't been able to help fixing it. If anyone with more insights could help it would be much appreciated!
Can you paste the full error? What module is failing to compile? Which definition is it loading the interface for?
Cheers,
- Ben
"inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -this-unit-id base-4.11.0.0 -hide-all-packages -i -ilibraries/base/. -ilibraries/base/dist-install/build -Ilibraries/base/dist-install/build -ilibraries/base/dist-install/build/./autogen -Ilibraries/base/dist-install/build/./autogen -Ilibraries/base/include -optP-DOPTIMISE_INTEGER_GCD_LCM -optP-include -optPlibraries/base/dist-install/build/./autogen/cabal_macros.h -package-id rts -package-id ghc-prim-0.5.2.0 -package-id integer-gmp-1.0.1.0 -this-unit-id base -XHaskell2010 -O -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags -Wnoncanonical-monad-instances -odir libraries/base/dist-install/build -hidir libraries/base/dist-install/build -stubdir libraries/base/dist-install/build -dynamic-too -c libraries/base/./GHC/Natural.hs -o libraries/base/dist-install/build/GHC/Natural.o -dyno libraries/base/dist-install/build/GHC/Natural.dyn_o <interactive>:1:1: error: Bad interface file: libraries/base/dist-install/build/GHC/Natural.hi libraries/base/dist-install/build/GHC/Natural.hi: openBinaryFile: does not exist (No such file or directory) It fails in the CoreTidy pass. I also got this one (only after a make clean IIRC): libraries/base/GHC/Exception/Type.hs-boot:1:1: error: Failed to load interface for ‘GHC.Types’ There are files missing in the ‘ghc-prim-0.5.2.0’ package, try running 'ghc-pkg check'. Use -v to see a list of the files searched for. @hvr suggests it could could related to hs-boot files dependencies. Cheers, Sylvain

Sylvain Henry
On 20/02/2018 03:25, Ben Gamari wrote:
Sylvain Henry
writes: Hi,
@Bodigrim is working on a patch (https://phabricator.haskell.org/D4212) to fix #14170.
The build fails because of interface file errors: "bad interface file" for GHC.Natural and "failed to load interface" for GHC.Types.
I suspect it is a wired-in module build ordering issue but I haven't been able to help fixing it. If anyone with more insights could help it would be much appreciated!
Can you paste the full error? What module is failing to compile? Which definition is it loading the interface for?
Cheers,
- Ben
"inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -this-unit-id base-4.11.0.0 -hide-all-packages -i -ilibraries/base/. -ilibraries/base/dist-install/build -Ilibraries/base/dist-install/build -ilibraries/base/dist-install/build/./autogen -Ilibraries/base/dist-install/build/./autogen -Ilibraries/base/include -optP-DOPTIMISE_INTEGER_GCD_LCM -optP-include -optPlibraries/base/dist-install/build/./autogen/cabal_macros.h -package-id rts -package-id ghc-prim-0.5.2.0 -package-id integer-gmp-1.0.1.0 -this-unit-id base -XHaskell2010 -O -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags -Wnoncanonical-monad-instances -odir libraries/base/dist-install/build -hidir libraries/base/dist-install/build -stubdir libraries/base/dist-install/build -dynamic-too -c libraries/base/./GHC/Natural.hs -o libraries/base/dist-install/build/GHC/Natural.o -dyno libraries/base/dist-install/build/GHC/Natural.dyn_o
<interactive>:1:1: error: Bad interface file: libraries/base/dist-install/build/GHC/Natural.hi libraries/base/dist-install/build/GHC/Natural.hi: openBinaryFile: does not exist (No such file or directory)
Hmm, I'm afraid that's not particularly illuminating. It would be helpful to see the output from -ddump-if-trace as this will tell you why GHC is trying to load this interface file. Cheers, - Ben

On 25/02/2018 21:30, Ben Gamari wrote:
Hmm, I'm afraid that's not particularly illuminating.
It would be helpful to see the output from -ddump-if-trace as this will tell you why GHC is trying to load this interface file.
Thanks, it has been helpful. The relevant trace is: Need decl for mkNatural Considering whether to load GHC.Natural {- SYSTEM -} Reading interface for base-4.11.0.0:GHC.Natural; reason: Need decl for mkNatural readIFace libraries/base/dist-install/build/GHC/Natural.hi Now I still don't know why GHC is trying to load the interface of the module it is compiling.

Sylvain Henry
On 25/02/2018 21:30, Ben Gamari wrote:
Hmm, I'm afraid that's not particularly illuminating.
It would be helpful to see the output from -ddump-if-trace as this will tell you why GHC is trying to load this interface file.
Thanks, it has been helpful. The relevant trace is:
Need decl for mkNatural Considering whether to load GHC.Natural {- SYSTEM -} Reading interface for base-4.11.0.0:GHC.Natural; reason: Need decl for mkNatural readIFace libraries/base/dist-install/build/GHC/Natural.hi
Now I still don't know why GHC is trying to load the interface of the module it is compiling.
Keep in mind that GHC may call upon mkNatural while typechecking even without an import as it is known-key. The output of -ddump-tc-trace might also help identify whether this is the case. I would help if there were some way I could reproduce this. Cheers, - Ben

On 26/02/2018 19:19, Ben Gamari wrote:
Sylvain Henry
writes: On 25/02/2018 21:30, Ben Gamari wrote:
Hmm, I'm afraid that's not particularly illuminating.
It would be helpful to see the output from -ddump-if-trace as this will tell you why GHC is trying to load this interface file. Thanks, it has been helpful. The relevant trace is:
Need decl for mkNatural Considering whether to load GHC.Natural {- SYSTEM -} Reading interface for base-4.11.0.0:GHC.Natural; reason: Need decl for mkNatural readIFace libraries/base/dist-install/build/GHC/Natural.hi
Now I still don't know why GHC is trying to load the interface of the module it is compiling. Keep in mind that GHC may call upon mkNatural while typechecking even without an import as it is known-key. The output of -ddump-tc-trace might also help identify whether this is the case.
It must be something like this because I get the same error even when I reduce GHC.Natural module to: {-# LANGUAGE NoImplicitPrelude #-} module GHC.Natural where
I would help if there were some way I could reproduce this.
The failing patch is here: https://phabricator.haskell.org/D4212 Let's continue the discussion there to avoid spamming this list ;) Thanks, Sylvain
participants (2)
-
Ben Gamari
-
Sylvain Henry