Make solver able to reject build-type: Custom packages#7802
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 |
| ++ 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.
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.
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!