-
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
Is this a bug in dependency resolver? #2468
Comments
Something is definitely strange. I can reproduce this with |
Oh, I see, the difference between the Without it, the solver selects
The solver doesn't currently check for cycles properly. (My original reasoning was that cycles are "wrong" and shouldn't occur in practice. But this is clearly no longer true.) The sanity check for the install plan catches it, but then it's too late to look for different solutions. So yes, this is related to #1575, but nevertheless one can argue that it's a bug in the solver, and it should probably be fixed in some way. |
I'm actually willing to work on this during the next week. @kosmikus is this too hard to fix? As far as I can see, we should be treating each component(library, executables, tests, benchmarks) as separate things but currently they're considered as one installation unit, did I get it right? |
Well, this bug is, as I said above, actually a solver bug. It shouldn't be too hard to fix (but isn't trivial either). The #1575 bug is about resolving cycles such as this one by allowing the At the same time, there are some changes for the solver and rest of Cabal in the pipeline that are related to this as well, and that probably should be merged first. @edsko has been working on implementing independent goals in the solver (roughly speaking, this allows you to have two goals on a single package to be resolved to different instances under certain circumstances). The primary goal of that work is to allow Setup files to have dependencies that do not interfere with the dependencies of the package itself, but the same mechanism can in principle also be used for (some) test suites and executables, and it's an extension we've discussed. This stuff is currently here: https://github.com/edsko/cabal/tree/orthogonal-linking /cc @dcoutts (who's also been involved in the design of the independent goals changes) |
I think this is actually fixed by #3170. At least the original example now produces:
and
shows that cyclic solutions are being rejected. |
I'm trying to install
pretty
library(from HEAD) with tests. Cabal is failing with this error message:I can't see how there is a dependency cycle, this doesn't form a cycle: QuickCheck-2.7.6, template-haskell-2.9.0.0, pretty-1.1.3.1 because we're not building the library, we're building the test suite.
pretty
s cabal file is a bit weird, test suite doesn't depend on the library itself, instead it compiles the library again. As an experiment, I made this change:But it failed with same error message.
Any ideas?
The text was updated successfully, but these errors were encountered: