Skip to content

Reject solver solutions involving un-buildable libraries. - #5332

Closed
phadej wants to merge 1 commit into
haskell:masterfrom
phadej:buildable-false
Closed

phadej wants to merge 1 commit into
haskell:masterfrom
phadej:buildable-false

Conversation

@phadej

@phadej phadej commented May 19, 2018

Copy link
Copy Markdown
Collaborator

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

phadej commented May 19, 2018

Copy link
Copy Markdown
Collaborator Author
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

phadej commented May 28, 2018

Copy link
Copy Markdown
Collaborator Author

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