-
Notifications
You must be signed in to change notification settings - Fork 696
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
Make solver able to reject build-type: Custom packages #7802
Conversation
Could you please add more background on this flag to the commit message? |
@grayjay will do once the idea is in general accepted (along as writing docs and the changelog). |
@phadej to accept the idea in general would probably require a little motivation -- what's the plan for why we'd want this and how it would be used? |
|
Is there a concrete use case for this? Are there consumers of cabal-install we can imagine wanting to turn this on by default in certain of their build systems or the like, or is the motivation more "this should exist" and somewhat speculative? Like the code looks clean to me, and the approach reasonable. I'm just not clear on if there's a general direction of work this is considered a part of or etc? |
Myself. E.g. for GHCJS (or crosscompiling if it worked). |
Thanks, ghcjs was the sort of motivating use case that I was asking about! Being able to rule out plans ghcjs can't use makes perfect sense. |
GHCJS can use |
@@ -344,6 +344,7 @@ convCondTree flags dr pkg os arch cinfo pn fds comp getInfo solveExes@(SolveExec | |||
++ L.map (\e -> D.Simple (LDep dr (Ext e)) comp) (allExtensions bi) -- unconditional extension dependencies | |||
++ L.map (\l -> D.Simple (LDep dr (Lang l)) comp) (allLanguages bi) -- unconditional language dependencies | |||
++ L.map (\(PkgconfigDependency pkn vr) -> D.Simple (LDep dr (Pkg pkn vr)) comp) (pkgconfigDepends bi) -- unconditional pkg-config dependencies | |||
++ [D.Simple (LDep dr (BT (buildType pkg))) comp] |
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 line seems to add the build type constraint to every component and the branches of every conditional. Could the constraint be associated with the whole package instead, similar to UnsupportedSpecVer?
toDep (PackagePropertyInstalled) = Nothing | ||
toDep (PackagePropertySource) = Nothing | ||
toDep (PackagePropertyFlags _) = Nothing | ||
toDep (PackagePropertyStanzas _) = Nothing |
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.
It looks like this file has only whitespace changes.
Cleaning up old PRs. |
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!