Skip to content

Nondeterministic build failures

Summary

When switching back and forth between a patch I've been working on and its base commit, I encounter situations where the same code produces different build outcomes before and after switching. Specifically, the base commit, which built cleanly before I started working on the patch, fails to build after attempting to build the patch and then reverting back to the base commit.

Steps to reproduce

(Note that I am writing this down from memory; actually executing these steps takes several hours)

  1. Clone the repo at https://gitlab.haskell.org/tdammers/ghc/
  2. Check out the base commit bb141114
  3. Build with hadrian: ./boot && ./configure && ./hadrian/build.sh -j2, leaving everything at defaults. This should build cleanly.
  4. Check out the patch commit 55de5938, verifying that only compiler/coreSyn/CoreOpt.hs is changed.
  5. Do an incremental build: ./hadrian/build.sh -j2. This should fail with a panic (the patch breaks things, this is what I'm trying to figure out in the first place)
  6. Check out the base commit bb141114
  7. Run another incremental build: ./hadrian/build.sh -j2. This fails with the same panic as the build in step 5.

Expected behavior

The build in step 7 should succeed (just like the one in step 3).

Environment

  • GHC version used: 8.6.5

  • Operating System: Debian GNU/Linux

  • System Architecture: x64

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information