-
Notifications
You must be signed in to change notification settings - Fork 704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace flag-defaulting hack by proper solution #4886
Conversation
Note to self: this may affect #4879 |
That CI passes is quite deceptive, as with the PR as it stands, |
Can we remove that LANGUAGE ViewPatterns now or is it needed elsewhere? |
@fgaz which one? my patch removes already a couple of those... |
@hvr I looked at CmdInstall and assumed you leaved it on the other modules too, but apparently I picked the exception, not the rule |
@hvr What's the status of this? |
@23Skidoo I've just rebased this, and will try to use it locally and try to observe regressions (which I'll report here in this ticket); but generally I think we want to merge this, and fix |
See haskell#4737 This reverts commit 71131cf.
See haskell#4737 This reverts commit 1e90ae4.
@@ -1627,7 +1620,10 @@ installCommand = CommandUI { | |||
++ " " ++ (map (const ' ') pname) | |||
++ " " | |||
++ " Change installation destination\n", | |||
commandDefaultFlags = (mempty, mempty, mempty, mempty), | |||
commandDefaultFlags = (commandDefaultFlags configureCommand, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is possibly wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind, the commits were in the wrong orde
@@ -1118,7 +1108,10 @@ upgradeCommand = configureCommand { | |||
commandSynopsis = "(command disabled, use install instead)", | |||
commandDescription = Nothing, | |||
commandUsage = usageFlagsOrPackages "upgrade", | |||
commandDefaultFlags = (mempty, mempty, mempty, mempty), | |||
commandDefaultFlags = (commandDefaultFlags configureCommand, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is possibly wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind, the commits were in the wrong order
After brainstorming w/ @alexbiehl it appears like we want (c.f. #4737) something for the haddock flags in the style of resolveSolverSettings :: ProjectConfig -> SolverSettings
resolveBuildTimeSettings :: Verbosity -> CabalDirLayout -> ProjectConfig -> BuildTimeSettings specifically, resolveHaddockSettings :: _ -> ProjectConfig -> HaddockSettings (where EDIT: after some more thought; I'm not so sure about this anymore. It's more tricky |
isRequested _ ExeKind = fromFlag (haddockExecutables haddockFlags) | ||
isRequested _ TestKind = fromFlag (haddockTestSuites haddockFlags) | ||
isRequested _ BenchKind = fromFlag (haddockBenchmarks haddockFlags) | ||
isRequested _ FLibKind = fromFlagOrDefault False (haddockForeignLibs haddockFlags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in my local version I had a comment along the lines of
-- TODO/HACK, we encode some defaults here as new-haddock's logic;
-- make sure this matches the defaults applied in
-- "Distribution.Client.ProjectPlanning"; this may need more work
-- to be done properly
--
-- See also https://github.com/haskell/cabal/pull/4886
which may need to be extended even further to point out that this gives CLI flags unduly importance over per-package cabal.project
settings; which is the thing we'd need to do properly in future work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add the comment
I've merged this as this enables other work to be unblocked (such as #4840) |
This is not finished yet; this is supposed to address issues like #4737 or #5139
/cc @alexbiehl
Regressions:
all
target)