cabal haddock: imply dependencies, but gentler, i.e. don't override config/project settings #11002
+32
−16
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).
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
Lastmonoid).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.
A low-level issue that I currently need input for is described in comments above, and in a nutshell, I want to know if flipping a default for
documentationfromFlag FalsetoNoFlaglooks okay. This asumes thatNoFlagwill turn intoFalseeventually anyways.Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significantin the changelog file.