Allow pre-build rules to generate autogen extra sources files#11573
Open
sheaf wants to merge 1 commit intohaskell:masterfrom
Open
Allow pre-build rules to generate autogen extra sources files#11573sheaf wants to merge 1 commit intohaskell:masterfrom
sheaf wants to merge 1 commit intohaskell:masterfrom
Conversation
22fc5c6 to
91b3755
Compare
With this commit, the SetupHooks API now considers all extra source files placed in the autogen directory for the component to be additional demands on pre-build rules. For example, a pre-build rule that generates a C or JavaScript source file (putting it in the appropriate autogen module for the component) will now be run, while it used to not be run before (as it used to be considered "not demanded").
91b3755 to
3b46b10
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #11607, making it possible to write pre-build rules that generate source files other
than Haskell files.
Because there is no counterpart to
autogen-modulesfor non-Haskell sourcefiles, authors of pre-build rules will need to proceed in two steps:
In a per-component pre-configure hook, the files the author desires to generate
must be added to the relevant fields, e.g. the
cSourcesfield ofBuildInfo.These files must be relative to
autogenCompModulesDir.Pre-build rules generating these files will now be demanded. This avoids
getting an error message "The following pre-build rules are not demanded
and will not be run".
Note that include files (such as
.hfiles) are a bit different: any fileslisted under
includes/autogen-includesare required at configure time.This gives
SetupHooksauthors two choices: either list the include files inautogen-includesbut generate them in a pre-configure hook, or don't list themthere and generate them in a pre-build rule, relying on the files getting picked
up from included directories (this may be brittle).
Template Α: This PR modifies behaviour or interface
significance: significantin the changelog file.