Skip to content

Hadrian build fails after changing the bootstrap compiler

Summary

Using a recent HEAD (8127520e), if GHC is built using Hadrian, and the bootstrap compiler is then changed, an attempt to rebuild GHC fails with an uncaught exception.

Steps to reproduce

  1. git clone --recurse-submodules https://gitlab.haskell.org/ghc/ghc.git fresh-ghc

  2. cd fresh-ghc

  3. git submodule update --init --recursive

  4. ghcup set ghc 8.10.7

  5. ./boot

  6. ./configure

  7. ./hadrian/build -j

  8. ghcup set ghc 9.0.1

  9. ./boot

  10. ./configure

  11. ./hadrian/build -j

Expected behavior

I expected the second build to succeed, but it fails with this output:

Error when running Shake build system:
  at action, called at src/Rules.hs:39:19 in main:Rules
  at apply1, called at src/Development/Shake/Internal/Rules/Oracle.hs:159:32 in shake-0.19.4-14804ff74b1678b050130a6b940d7752bedd32673aae21cd5eae957bb9cfee11:Development.Shake.Internal.Rules.Oracle
* Depends on: OracleQ (PackageDataKey (Package {pkgType = Library, pkgName = "binary", pkgPath = "libraries/binary"}))
  at error, called at libraries/binary/src/Data/Binary/Get.hs:351:5 in binary-0.8.8.0:Data.Binary.Get
* Raised the exception:
Data.Binary.Get.runGet at position 746: not enough bytes

Environment

  • GHC versions used: 8.10.7 and 9.0.1, both installed with ghcup.

Optional:

  • Operating System: Linux, Debian stable (bullseye)
  • System Architecture: x86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information