Currently, pre-build rules in build-type: Hooks packages can only really generate Haskell files, because the logic for determining which rules are demanded (and will thus be run) considers that the only root demands are autogenerated Haskell files.
As there is no equivalent to autogenerated modules for extra-sources, I propose to simply consider any "c-sources"/"js-sources"/etc that are in the autogen directory (added in a pre-configure hook) additional demands.
Note that this doesn't work for things like .h files, because they are needed at configure time, so cannot be generated in a pre-build hook if they are declared under includes/autogen-includes.
Several people have asked for this feature, with the latest example being this Reddit post.
Currently, pre-build rules in
build-type: Hookspackages can only really generate Haskell files, because the logic for determining which rules are demanded (and will thus be run) considers that the only root demands are autogenerated Haskell files.As there is no equivalent to autogenerated modules for extra-sources, I propose to simply consider any "c-sources"/"js-sources"/etc that are in the autogen directory (added in a pre-configure hook) additional demands.
Note that this doesn't work for things like
.hfiles, because they are needed at configure time, so cannot be generated in a pre-build hook if they are declared underincludes/autogen-includes.Several people have asked for this feature, with the latest example being this Reddit post.