Ah yes, that's it. If I recall correctly, the reason I didn't want to
do that is that building all files is a bit of a bigger deal for a
large complicated build system with many targets than for a small one
with only one target.
> My personal feeling here is that GHC has bugs with moving modules, and
> the real solution is to fix GHC, not try and have the build system
> clean up files that GHC shouldn't be looking at. With ghcid I bump
> into the problem quite regularly, but I see it with normal ghc too. As
> you say, tracking down the bugs into reliable test cases is a pain,
> and each instance can be trivially worked around, so I can see why the
> incentives haven't aligned to cause anyone to track it down yet. I can
> slightly tip the incentives by offering a beer to anyone who reports
> such an issue!
Maybe the problem is that all the people who spend their time tracking
down recompilation problems have been driven to harder stuff :) I
reported the "somewhere below me" bug on trac many many years ago but
as you say no one has really looked into it.
But then, I'll be soon going to a new job where I'll be doing build
infrastructure for a haskell-oriented company, so maybe I'll suddenly
get some motivation. The thing is, while each case can be worked
around manually, I'd think this would scuttle any attempt to have
reliable CI, unless you want to include the hack of "if it doesn't
link, rm -rf * and try again." The
tweag.io guys are doing stuff with
Bazel, and I gather you've had at least a bit of communication with
them, do you know if they run into the same ghc issues? If you want
to do mono-repo style builds you definitely need a solid incremental
build.
I don't even know how they work around ghc not being totally
deterministic quite yet. Hm, maybe that's related to why it seems
hard to reproduce.