Contributing report
My experience re-invoking the development environment after a couple months' pause.
I returned to hacking on GHC after a couple months' pause. I eventually had to just create a new worktree and rebuild everything after working through the following list of problems.
First, the latest version of Shake couldn't be found. I needed to run cabal new-update, which still doesn't happen automatically and wasn't suggested. Note: generically printing "Warning: package metadata is out of date" is not the same as suggesting that particular errors could be resolved by running "cabal new-update". :)
A few times, building failed because Cabal could not find the dyn_o version of a module. Cabal gives no indication how or why that might happen, and I didn't know how to proceed. I finally blew away dist-newstyle and rebuilt everything, which solved the problem.
NOTE: This happened a second time, and I got more interesting clues. I had canceled running cabal in order to double check the parameters I gave it, and when I re-ran it, the very last module it had been building turned out to be the one missing a dyn_o. Was I a victim of non-atomicity? In fact, after I removed the other build products for that module, a third run was entirely successful. That would indeed indicate non-atomicity.
The next problem was that my old hadrian/cfg/system.config was not forward-compatible.
[ ... ]
* Raised the exception:
Key 'tables-next-to-code' not found in file 'hadrian/cfg/system.config'
Fair enough. It's a system under development. I figured the easiest thing to do would be to remove the offending file. That triggered the need for a reconfigure, no big deal. But that caused the next problem.
configure: line 154: /nix/store/zl47r98ihllg3694p4f26170v285g7ba-bash-interactive-4.4-p23/bin/bash: No such file or directory
I couldn't find a reference to that exact filepath anywhere in the repository, so I'm not sure where it came from. Maybe my grepping missed some ignored boot files? Anyway, I decided to run ./boot again. That seemed to resolve the issue. Then I arrived at my final problem.
# cabal-configure (for _build/stage0/libraries/ghc-heap/setup-config)
hadrian: ghc-pkg dump failed: dieVerbatim: user error (hadrian:
'/nix/store/k7fc62729rl3s8z0s80wra3mcd4lldiw-ghc-8.6.4/bin/ghc-pkg'
exited with an error:
ghc-pkg: _build/stage0/lib/package.conf.d/package.cache:
GHC.PackageDb.readPackageDb: inappropriate type (Not a valid Unicode code
point!)
)
Error when running Shake build system:
at action, called at src/Rules.hs:71:19 in main:Rules
at need, called at src/Rules.hs:93:5 in main:Rules
* Depends on: _build/stage0/lib/package.conf.d/ghc-heap-8.9.0.20190907.conf
at apply1, called at src/Development/Shake/Internal/Rules/Oracle.hs:159:32 in shake-0.18.3-593067565aafb558d09b4352b8abc327d8911a39a0e9abab2804b002b1ae536e:Development.Shake.Internal.Rules.Oracle
* Depends on: OracleQ (ContextDataKey (Context {stage = Stage0, package = Package {pkgType = Library, pkgName = "ghc-heap", pkgPath = "libraries/ghc-heap"}, way = v}))
at need, called at src/Hadrian/Oracles/Cabal/Rules.hs:53:9 in main:Hadrian.Oracles.Cabal.Rules
* Depends on: _build/stage0/libraries/ghc-heap/setup-config
* Raised the exception:
ExitFailure 1
I had no idea what this might mean. I tried removing all untracked and ignored files. That didn't work. (Maybe I should have done it in all submodules, as well.) I finally gave up and created a pristine new worktree. I am currently building stage0 there [update: ghcid is now running successfully!], which is progressing well enough. I at least have had the free time to write up this experience report. :)