hadrian: Rebuild detection is not relocatable
Witness the following session. The main focus is on Build completed in X
below.
$ cd pristine
$
$ echo 'main = putStrLn "hi"' > test.hs
$ _build/stage1/bin/ghc -O2 test.hs -v0 && ./test
hi
$ hadrian/build --freeze1 ...
Up to date
Build completed in 6.17s
$
$ cd ..
$ cp -r pristine worktree && cd worktree
$
$ echo 'main = putStrLn "hi"' > test.hs
$ _build/stage1/bin/ghc -O2 test.hs -v0 && ./test
hi
$ hadrian/build --freeze1 ...
... a whole lot of rebuilding tests and relinking I presume ...
Build completed in 4m17s
First off, it's awesome that I can simply copy and re-use the git repository (thanks, git) as well as the build artifact like that! That's already a huge improvement since just a few years ago when I tried this the last time. Huge kudos on all those involved with hadrian, making this workflow possible in the first place!
In this ticket I want to track the improvement of those 4m17s
: Can we make that rebuild detection faster, getting closer to 6.17s
(which I still find a bit redicoulous, and apparently might have gotten worse since #19195, which is blocked on #19209 (comment 414691))?