[hadrian] Rebuild programs on dynamicGhcPrograms/ghcProfiled change
Currently, when you change dynamicGhcPrograms
or ghcProfiled
flavour parameters, rebuilding is not triggered, since programContext
doesn't set up a dependency on those values.
Exposing these values via an oracle does set the dependency and properly triggers the rebuild of binaries.
I made several attempts to factor out these actions which ended up in cyclic dependency here or there. I'm not absolutely happy with this variant either, but at least it works.
Issue repro:
In UserSettings.hs:
dbgDynamic = defaultFlavour { name = "dbg-dynamic"
, dynamicGhcPrograms = pure True,
... }
dbgStatic = defaultFlavour { name = "dbg-static"
, dynamicGhcPrograms = pure False
... }
Then in console:
$ hadrian/build.sh -j --flavour=dbg-dynamic
... does the build
$ hadrian/build.sh -j --flavour=dbg-static
... does nothing, considers binaries up to date