-- | Given a 'Target' this 'Action' determines the corresponding argument list
-- and computes its hash. The resulting value is tracked in a Shake oracle,
-- hence initiating rebuilds when the hash changes (a hash change indicates
-- changes in the build command for the given target).
-- Note: for efficiency we replace the list of input files with its hash to
-- avoid storing long lists of source files passed to some builders (e.g. ar)
-- in the Shake database. This optimisation is normally harmless, because
-- argument list constructors are assumed not to examine target sources, but
-- only append them to argument lists where appropriate.
trackArgsHash :: (ShakeValue c, ShakeValue b) => Target c b -> Action ()
trackArgsHash t = do
    let hashedInputs  = [ show $ hash (inputs t) ]
        hashedTarget = target (context t) (builder t) hashedInputs (outputs t)
    void (askOracle $ ArgsHash hashedTarget :: Action Int)
trackArgsHash :: (ShakeValue c, ShakeValue b) => Target c b -> Action ()
trackArgsHash t = do
    let hashedInputs  = [ show $ hash (inputs t) ]
        hashedTarget = target (context t) (builder t) hashedInputs (outputs t)
    void (askOracle $ ArgsHash hashedTarget :: Action Int)
trackArgsHash t = do
    let hashedInputs  = [ show $ hash (inputs t) ]
        hashedTarget = target (context t) (builder t) hashedInputs (outputs t)
    void (askOracle $ ArgsHash hashedTarget :: Action Int)