Skip to content
  • Artem Pyanykh's avatar
    [hadrian] Rebuild programs on dynamicGhcPrograms/ghcProfiled change · d0c2f3a2
    Artem Pyanykh authored and Marge Bot's avatar Marge Bot committed
    Currently, if you change these ^ 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 a rebuild of binaries.
    
    Several attempts to factor out these actions 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
    ```
    d0c2f3a2