Skip to content

Rebuilding profiled stage2 after building stage3 is broken

The following appears to break,

$ cat <<EOF >mk/build.mk
BuildFlavour = prof
ifneq "$(BuildFlavour)" ""
include mk/flavours/$(BuildFlavour).mk
endif
EOF
$ make stage=2
$ make stage=3
$ touch compiler/stage2/build/Simplify.*
$ make stage=2
...
ghc/GHCi/UI/Info.hs:43:1: error:                                                                                                                                                              
    Could not find module ‘TcHsSyn’                                                                                                                                                           
    Perhaps you haven't installed the profiling libraries for package ‘ghc-8.3’?                                                                                                              
    Locations searched:                                                                                                                                                                       
      ghc/./TcHsSyn.p_hi                                                                                                                                                                      
      ghc/./TcHsSyn.p_hi-boot                                                                                                                                                                 
      ghc/stage2/build/TcHsSyn.p_hi                                                                                                                                                           
      ghc/stage2/build/TcHsSyn.p_hi-boot                                                                                                                                                      
      ghc/stage2/build/ghc/autogen/TcHsSyn.p_hi                                                                                                                                               
      ghc/stage2/build/ghc/autogen/TcHsSyn.p_hi-boot                                                                                                                                          
      /mnt/work/ghc/ghc/compiler/stage3/build/TcHsSyn.p_hi                                                                                                                                    
   |                                                                                                                                                                                          
43 | import           TcHsSyn                                                                                                                                                                 
   | ^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                 
                                            

The problem appears to be that the build system registers the stage3 ghc, which we didn't build in the profiled way, overwriting the stage2 registration. Hopefully Hadrian will do better here.

Trac metadata
Trac field Value
Version 8.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Build System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information