-
Notifications
You must be signed in to change notification settings - Fork 697
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
Solver: Check whether components are buildable in the current environment. #5337
Conversation
…ment. This commit handles the most common case of issue haskell#5325 by checking that each component that is required as a dependency is buildable in the current environment, where environment refers to the compiler, os, arch, and global flag constraints. The solver records whether each component is buildable in the package's PInfo during index conversion. Then it checks that each required component is buildable in the validation phase, similar to the check for missing components. The buildable check can give false-positives, because it only considers flags that are set by unqualified flag constraints, and it doesn't check whether the intra-package dependencies of a component are buildable. The check is also incomplete because it is performed before any automatic flags are assigned. It is possible for the solver to later choose a value for a flag that makes the package unbuildable.
/cc @kosmikus |
I used this patch in |
I have dogfooded this for over a week, so I guess @hvr. Herbert: what's your experiences, let's merge this! |
I've dogfooded this and it handles the urgent However, in the meantime I found yet another corner case (which this PR doesn't address):
which results in
is this expected? |
I've talked to @23Skidoo and this clearly represents an improvement for a rather urgent issue. So I'm merging this, and cherry-picking to the 2.2 branch to extend exposition to a larger user-base (via Travis CI) @grayjay ...if you figure out a way to address the less urgent |
Thanks for trying out the PR, and thanks @hvr for cherry-picking the changes onto 2.2! The example probably failed because yesod-0.0.0.2 has an automatic |
@grayjay hrm... so |
The build-depends field isn't under the conditional, so it might work with older versions of cabal that required dependencies for unbuildable components. |
This commit handles the most common case of issue #5325 by checking that each
component that is required as a dependency is buildable in the current
environment, where environment refers to the compiler, os, arch, and global flag
constraints. The solver records whether each component is buildable in the
package's PInfo during index conversion. Then it checks that each required
component is buildable in the validation phase, similar to the check for missing
components.
The buildable check can give false-positives, because it only considers flags
that are set by unqualified flag constraints, and it doesn't check whether the
intra-package dependencies of a component are buildable. The check is also
incomplete because it is performed before any automatic flags are assigned. It
is possible for the solver to later choose a value for a flag that makes the
package unbuildable.
Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!
/cc @hvr @phadej