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

Reject solver solutions involving un-buildable libraries. #5332

Closed
wants to merge 1 commit into from

Conversation

phadej
Copy link
Collaborator

@phadej phadej commented May 19, 2018

Now you get something like this:

Resolving dependencies...
cabal: Could not resolve dependencies:
trying: p-0.1 (user goal)
unknown package: unbuildable (dependency of p-0.1)
fail (backjumping, conflict set: p, unbuildable)
Dependency tree exhaustively searched.

The error message is not the best.

Fixes #3978


% rm -rf dist-newstyle              
% cabal new-build -w ghc-7.8.4 all --dry
Resolving dependencies...
Error:
    Dependency on unbuildable library from http-client
    In the stanza 'library'
    In the package 'http-client-tls-0.3.5.3'

% rm -rf dist-newstyle                  
% ../build/cabal/cabal new-build -w ghc-7.8.4 all --dry
Resolving dependencies...
Build profile: -w ghc-7.8.4 -O1
In order, the following would be built (use -v for more details):
 - Cabal-2.0.1.1 (lib) (requires download & build)

...

% cabal-plan topo | grep http-client
http-client-tls-0.3.5.3
http-client-0.5.12

Note how solver figured out to pick http-client-0.5.12!

Now you get something like this:

    Resolving dependencies...
    cabal: Could not resolve dependencies:
    trying: p-0.1 (user goal)
    unknown package: unbuildable (dependency of p-0.1)
    fail (backjumping, conflict set: p, unbuildable)
    Dependency tree exhaustively searched.

The error message is not the best.

Fixes haskell#3978
@phadej
Copy link
Collaborator Author

phadej commented May 19, 2018

Actual output differs from expected:
stderr:
--- "C:\\projects\\cabal\\cabal-testsuite\\PackageTests\\NewBuild\\T3978\\cabal.dist\\cabal.out.normalized"	2018-05-19 12:27:09.841643700 +0000
+++ "C:\\projects\\cabal\\cabal-testsuite\\PackageTests\\NewBuild\\T3978\\cabal.dist\\cabal.comp.out.normalized"	2018-05-19 12:27:09.841643700 +0000
@@ -1,6 +1,7 @@
 # cabal new-build
 Resolving dependencies...
-Error:
-    Dependency on unbuildable library from p
-    In the stanza 'library'
-    In the inplace package 'q-1.0'
+cabal: Could not resolve dependencies:
+[__0] trying: p-1.0 (user goal)
+[__1] unknown package: buildable-false-hack (dependency of p)
+[__1] fail (backjumping, conflict set: buildable-false-hack, p)
+After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: p (2), buildable-false-hack (1)

@phadej
Copy link
Collaborator Author

phadej commented May 28, 2018

Closing this in favour of @grayjay patch (btw, it's in use in servants CI, and it works!)

@phadej phadej closed this May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toConfiguredComponent: unix (Windows)
2 participants