Repository navigation
Use default flags only for new-* path - #4657
Conversation
|
@alexbiehl, thanks for your PR! By analyzing the history of the files in this pull request, we identified @23Skidoo, @ezyang and @dcoutts to be potential reviewers. |
|
Ah yeah, that's because command line flags are mappended on top of the ones loaded from the config, so when they're non-mempty from the beginning, they always override whatever was in the config. I think we should just revert 1e90ae4. |
|
|
||
| type Action = GlobalFlags -> IO () | ||
|
|
||
| defaultsCmdWrapper :: ((ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags) -> [String] -> GlobalFlags -> IO ()) |
There was a problem hiding this comment.
I'd be more happy if instead of doing this we applied the defaults directly inside Cmd*.*Action. That'd be a tad more verbose, but also more explicit.
So e.g. for CmdBuild.buildAction you'd have:
buildAction cliFlags@(_configFlags, _configExFlags, _installFlags, _haddockFlags) ... =
let (configFlags, configExFlags, installFlags, haddockFlags) = applyFlagDefaults cliFlags
...
There was a problem hiding this comment.
@23Skidoo we could use ViewPatterns, then it would look like
buildAction (applyFlagDefaults -> (configFlags, configExFlags, installFlags, haddockFlags))EDIT: syntax typo
568f519 to
71131cf
Compare
|
@23Skidoo it's all green! :-) |
Fixes #4581.
With 1e90ae4 flags from the global
configuration would be ignored. This patch makes sure the defaults are
mixed in only for the new-build code path.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!