-
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
The solver should distinguish errors that are cause by the absence of a system libraries from other errors #10239
Comments
@grayjay Do you have a first opinion on the feasibility of such a thing? |
I'm not sure which of these you're asking for:
This is what you would get... if someone had put a lower-bound on
This doesn't make sense to me, can you elaborate? In the example you give it doesn't look like the dependency is optional, rather it became mandatory at some point in the version history. |
@michaelpj thank you for popping up,
That's indeed a major change. Why shouldn't we indeed, because then if the cabal file misses lower bounds as you say, it leads to such messages.
Can you and other maintainers of this library can tell me if this how In general, the direction of this flow is a bad heuristic because it cannot differ between people who make a conscious choice of not having the library installed and those who haven't installed the library yes. It assumes that people are all-knowing, whereas the majority of people are just waiting to be told "you haven't installed this system library for the build to proceed".
We are the people doing tech support on Discord for beginners, who notice the same UX problems coming up again and again and again. Staying on a library version that doesn't require the system dependency is as easy as putting a bound in your own cabal file.
If a package provides an optional system dependency, they can do it with a cabal flag like in text. Indeed that's not the case of |
The solver is able to switch automatic flags to avoid system dependencies precisely because it backtracks if any dependency (be it native or system or setup or build tool) is not satisfied. Changing this behavior is likely to be pretty damaging and counterintuitive. |
Okay so how do we make it so that the base experience of cabal beginners is improved? |
Well, I think there's a lot of low-hanging fruit in simply reporting the current state in a less obscure fashion:
I tried to encourage Cardano folks to use more dependency bounds but it wasn't popular. I guess this is just a consequence 🤷 Perhaps we need to publicize more that poor lower bounds leads to worse errors for your users?
How are you supposed to know to do that? The solver output, while verbose, does give you the hints you need to see which versions are problematic.
There has been some discussion about this recently, but cabal flags as they currently exist are not very good for this purpose and I wouldn't recommend that people do that unless they really have to. |
That is maybe |
Lower bounds everywhere is probably not necessary. However, specific, targeted lower bounds are a good idea. cardano-crypto-class does already have a few lower bounds. Adding another would probably make sense. The lowest recommended compiler for the Cardano code base is |
Are there more lines in the error message? I would have expected cabal to try more versions of I don't think that it is easy to determine which conflicts are more important to users in general, but in this case I would have expected the solver to de-emphasize the conflict with cabal/cabal-install-solver/src/Distribution/Solver/Modular/Preference.hs Lines 400 to 404 in 72e5439
I'm wondering if the issue is that the solver applies the heuristic when trying to find a solution (visible with |
Let's take a very real and reproducible solver error message:
Two things happen here:
base
it has picked forbase
. You are then led to believe that the GHC version you use must be modifiedlibblst
system library, and the solver has decided that it would simply find a version that would require it.However these are two very different types of error, and mixing them together does not help anyone!
@PPKFS comments, quite understandably:
If people want to provide optional system dependency, we have a tool for it, it's called a flag. The solver is even able to switch them on and off if it thinks it will help finding a working plan.
Let's get rid of this quirk.
The text was updated successfully, but these errors were encountered: