Skip to content

Bootstrapping GHC with _build linked to a tmpfs results in panic

Summary

Following the instructions to build GHC on Nix:

nix develop github:alpmestan/ghc.nix
./boot && configure_ghc
hadrian/build -j --flavour=quickest

Works normally. However, when I first run mkdir /tmp/ghc_build; ln -s /tmp/ghc_build _build, in order to keep my frequent rebuilds off of my main drive, the stage 0 GHC panics when I start to build stage 1, with the message Platform constants not available!. (/tmp is a tmpfs on my system, though I didn't test to see if that makes a difference. It's large enough to hold the entire build with plenty of GB left over.)

I tried to figure out how exactly this is failing but I gave up trying to figure out how the build system produces the header file that apparently the platform constants are read from.

Steps to reproduce

See above.

Expected behavior

Build normally, probably? This might just be a ‘don't do that’ situation, but I was surprised that this didn't just work and maybe you are too.

Environment

  • GHC version used: 9.6.2, 9.8.1-alpha2, master

Optional:

  • Operating System: Linux (NixOS)
  • System Architecture: x86_64
Edited by Ryan Hendrickson
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information