Skip to content
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

Better messages when constraint from user config makes us not pick a package #373

Closed
bos opened this issue May 24, 2012 · 6 comments
Closed

Comments

@bos
Copy link
Contributor

bos commented May 24, 2012

@ezyang: See below, you can specify constraints to exclude packages, the real bug is error messages


(Imported from Trac #380, reported by guest on 2008-10-23)

Sometimes there are packages on hackage that I don't want to install, perhaps ever. Maybe there is a buggy release I'm trying to avoid, or something of that nature.

So, my proposal is a user defined blacklist. I think the version specification could work just like that of a .cabal file.

I also think cabal should tell you when it skips a dependency due to blacklisting.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dcoutts on 2008-10-23)

Chucking some extra constraints in is easy. The hard part is tracking them so we can report where they came from and if they were used.

Saying that a package was not used due to blacklisting is quite hard really. I guess one could inspect the constraints at the end for each package and check if any packages were excluded only due to the specific blacklist constraint. If it was then we could check if that package would have been the preferred version vs the version actually picked.

This relies closely on the way in which the current solver works and what internal method it uses and the information it collects. That's not great because we would like to make the algorithm pluggable so that we can easily experiment with improved algorithms.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dcoutts on 2008-12-17)

We seem mostly to have given up the pluggable solver interface. It now is explicitly given a set of constraints. The obvious thing to do is to attach reasons to each of the input constraints. Blacklisting could be one such thing. Avoiding broken packages similarly. See also #470.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @kosmikus on 2009-03-11)

In the modular solver, constraints have reasons already. This is related to #925.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @kosmikus on 2012-03-08)

The following works now:

  • Constraints and preferences can be added to the global config file.
  • Each constraint: or preference: line can specify only a single constraint, but several such lines can occur.
  • Config file constraints will be handled like command-line constraints by the solver.
This can be used to specify a personal blacklist.

However, the following remains to be done:

  • Make it easier to work with several config files. Currently, we can reset the config file, but not use a stack of config files. cabal-dev allows the latter.
  • Distinguish config file constraints from command-line constraints in error messages.
  • Allow a single config file line to contain a list of constraints.

@ezyang ezyang changed the title Ability to blacklist packages that are on hackage Better messages when constraint from user config makes us not pick a package Aug 16, 2016
@ulysses4ever
Copy link
Collaborator

I think this issue is too vague, and I'd vote for closing it as such. On top of that, constraint solving is a rather complicated process, results of which will always be hard to explain. I'd welcome more focused issues (e.g. #7993) than this one.

@Mikolaj
Copy link
Member

Mikolaj commented Jun 14, 2022

I think "Make it easier to work with several config files" and "Allow a single config file line to contain a list of constraints" is in a way fixed in #7783. What probably remains unsolved is "Distinguish config file constraints from command-line constraints in error messages". However, given that nobody implemented nor discussed that here in 10 years, if anybody is still interested, please search for newer similar tickets and perhaps open a new ticket with precisely this content, ideally giving a new use case, taking #7783 into consideration and sketching how the errors should look like. Closing this one as stale. Thank you everybody.

@Mikolaj Mikolaj closed this as completed Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants