cabal haddock: imply dependencies, but gentler, i.e. don't override config/project settings #11002
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 is a WIP to fix #8725 as outlined in #8725 (comment). It's not working yet and I'd appreciate suggestions on why this is the case.
High-level idea. Project configuration is built out of two pieces: config/project file settings and command-line flags:
projectConfig <> cliConfig
.The way "cabal haddock implying --enable-documentation" (#8259 #8330) was implemented is it modified the latter (CLI flags). But that made the resulting code ignore anything from config/project files (flags are a
Last
monoid).The idea here is instead of modifying CLI flags, add command-specific "default settings" (can differ between
cabal
's subcommands) that are prepended to the result, so:defaultConfigPerCommand <> projectConfig <> cliConfig
.I hope the high-level idea makes sense but I invite comments. The low-level implementation, as noted above, isn't there yet: I need to figure out where to push these new default settings exactly, as the one (or two) place(s) I tried so far didn't give me the same result as the one we get with the previous approach based on CLI flags (thankfully, there's a test for it #8259).
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significant
in the changelog file.