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

Wishful thinking: Please allow cabal to solve the attached challenge #2024

Closed
nomeata opened this issue Aug 2, 2014 · 7 comments
Closed

Comments

@nomeata
Copy link
Contributor

nomeata commented Aug 2, 2014

Hi,

in Debian, we use cabal-install with rather extreme command lines to ensure that our package set selection is consistent. For that, we use --constraint foo (== 1.2.3) flags, which works rather well, even with 300 packages.

But I’d also like cabal to help me to find out what upgrades are required to upgrade a specific package. For that, I figured I can use --preference foo (== 1.2.3) --constraint foo (>= 1.2.3) for all our package selection, and --constraint bar (>= 1.2.4) for the package we want to upgrade.

I’ll attach a tarball with a custom cabal config, 00-index.tar.gz (with Debian-specific patches) and a script with a 91k command line (change the paths in the command line and the config file to match yours).

It is a consistent package selection with the exception of scientific, which I want to upgrade. I believe the upgrade is not actually possible (something involving attoparsec and leksah), but I’d like cabal to tell me. Unfortunately, cabal doesn’t finish in a reasonable time yet.

BTW, I can also provide such self-contained examples of large, but consistent package sets, in case you like to have more large example to benchmark and profile.

@nomeata
Copy link
Contributor Author

nomeata commented Aug 2, 2014

Guess github doesn’t allow file attachments. You can pull the tarball at https://people.debian.org/~nomeata/cabal-challenge.tar.gz

@23Skidoo 23Skidoo added the solver label Aug 2, 2014
@23Skidoo
Copy link
Member

23Skidoo commented Aug 2, 2014

/cc @kosmikus

@kosmikus
Copy link
Contributor

Yes, I'd like this, too.

@ttuegel ttuegel added this to the _|_ milestone Apr 24, 2015
@grayjay
Copy link
Collaborator

grayjay commented Jun 2, 2016

Cabal can find the conflict relatively quickly now with --reorder-goals (12 seconds on my machine). I'm assuming that this example used GHC-7.6, because 7.4.2 and 7.8.4 both fail with conflicts with base. The error with 7.6.3 is:

Resolving dependencies...
cabal: Could not resolve dependencies:
trying: pandoc-1.12.4.2 (user goal)
next goal: scientific (user goal)
rejecting: scientific-0.3.3.0, scientific-0.3.2.2, scientific-0.3.2.1,
scientific-0.3.2.0, scientific-0.3.1.0, scientific-0.3.0.2,
scientific-0.3.0.1, scientific-0.3.0.0 (conflict: pandoc => scientific>=0.2 &&
<0.3)
rejecting: scientific-0.2.0.2, scientific-0.2.0.1, scientific-0.2.0.0,
scientific-0.1.0.1, scientific-0.1.0.0, scientific-0.0.0.2,
scientific-0.0.0.1, scientific-0.0.0.0 (constraint from command line flag
requires (>=0.3))
Dependency tree exhaustively searched.

I also tried running the command on a package that can be upgraded. I removed the constraint on scientific and upgraded tasty-hunit instead, with the constraint >= 0.5. I also had to comment out the fix for #3199, which adds setup dependencies on Cabal-1.24, since that version isn't in the index. Cabal ran in about 50 seconds and chose to upgrade tasty-hunit, tasty, and tasty-rerun to their latest versions. It also added two new packages, regex-tdfa-rc and unbounded-delays. I don't know how often this works, though. Please reopen if you find examples of packages that aren't handled well.

@grayjay grayjay closed this as completed Jun 2, 2016
@kosmikus
Copy link
Contributor

kosmikus commented Jun 2, 2016

@grayjay What about --count-conflicts on this one?

@grayjay
Copy link
Collaborator

grayjay commented Jun 2, 2016

I didn't think to try --count-conflicts after it worked with master. --count-conflicts without --reorder-goals takes 26 seconds to upgrade tasty-hunit, and 13 seconds to fail to upgrade scientific. The solver ended up with a larger top-level conflict set for scientific: aeson, attoparsec, conduit, leksah, leksah-server, scientific. The conflict set with just --reorder-goals was pandoc, scientific.

@kosmikus
Copy link
Contributor

kosmikus commented Jun 2, 2016

Thanks.

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

5 participants