-
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
Solver: Enforce dependencies on libraries (fixes #779). #5304
Conversation
…ries. This change allows the solver quickcheck tests to test all types of components. Previously, the tests generated the components in the solver DSL, but the code that converted the packages to GenericPackageDescriptions removed some of the components, i.e., it filtered out benchmarks and foreign libraries and merged internal libraries with the main library.
The solver DSL previously always added a default library component.
This commit generalizes the fix for issue haskell#4781 (e86f838) by tracking dependencies on components instead of dependencies on executables. That means that the solver always checks whether a package contains a library before using it to satisfy a build-depends dependency. If a version of a package doesn't contain a library, the solver can try other versions. Associating each dependency with a component also moves towards the design for component-based dependency solving described in issue haskell#4087.
Thanks for doing this! @fgaz, I think this is relevant to your GSoC project. |
Looks good from what I can tell, please feel free to merge unless @kosmikus objects. |
Merged, thanks! Can you please also add a changelog note? |
Superficially looks good to me as well, but I haven't looked at the changes in very much detail. Thanks. |
Thanks! I updated the changelog in #5316. |
@grayjay is this expected to fix issues like with the following situation where
where I'd expect the cabal solver to backtrack, and find the solution with |
No, this change only checks whether the library stanza exists. Checking that the library is buildable will probably require implementation of the "Component on/off" variable from #4087 (comment). |
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!
The first two commits only modify the tests:
Solver DSL: Support benchmarks, internal libraries, and foreign libraries.
This change allows the solver quickcheck tests to test all types of components.
Previously, the tests generated the components in the solver DSL, but the code
that converted the packages to GenericPackageDescriptions removed some of the
components, i.e., it filtered out benchmarks and foreign libraries and merged
internal libraries with the main library.
Solver DSL: Support packages without libraries.
The solver DSL previously always added a default library component.
Solver: Enforce dependencies on libraries (fixes #779).
This commit generalizes the fix for issue #4781
(e86f838) by tracking dependencies on
components instead of dependencies on executables. That means that the solver
always checks whether a package contains a library before using it to satisfy a
build-depends dependency. If a version of a package doesn't contain a library,
the solver can try other versions. Associating each dependency with a component
also moves towards the design for component-based dependency solving described
in issue #4087.
/cc @kosmikus