Skip to content
  • Alex Biehl's avatar
    Propage provenance when parsing ProjectConfig · efa1e3f1
    Alex Biehl authored
    In a project with lots of constraints it's not always obvious from
    which file a constraint is coming from. Also we are currently showing
    a big `TODO` message in place of the file name which is not nice.
    
    Prior to this patch
    
    ```
    $ cabal build all
    Resolving dependencies...
    cabal: Could not resolve dependencies:
    [__0] trying: some-package-0.24.1.2 (user goal)
    [__1] trying: foldl-1.4.8 (dependency of some-package)
    [__2] next goal: mwc-random (dependency of foldl)
    [__2] rejecting: mwc-random-0.15.0.0 (constraint from project config TODO
    requires ==0.14.0.0)
    [__2] trying: mwc-random-0.14.0.0
    [__3] next goal: math-functions (dependency of mwc-random)
    [__3] rejecting: math-functions-0.3.4.0, math-functions-0.3.3.0,
    math-functions-0.3.2.1, math-functions-0.3.2.0, math-functions-0.3.1.0,
    math-functions-0.3.0.2, math-functions-0.3.0.1, math-functions-0.3.0.0,
    math-functions-0.2.1.0, math-functions-0.2.0.2, math-functions-0.2.0.1,
    math-functions-0.2.0.0, math-functions-0.1.7.0, math-functions-0.1.6.0,
    math-functions-0.1.5.2, math-functions-0.1.5.1, math-functions-0.1.4.0,
    math-functions-0.1.3.0, math-functions-0.1.1.2, math-functions-0.1.1.1,
    math-functions-0.1.1.0, math-functions-0.1.0.0 (constraint from project config
    TODO requires ==0.3.4.1)
    [__3] fail (backjumping, conflict set: math-functions, mwc-random)
    After searching the rest of the dependency tree exhaustively, these were the
    goals I've had most trouble fulfilling: mwc-random, math-functions, foldl,
    some-package
    Try running with --minimize-conflict-set to improve the error message.
    ```
    
    Note the TODO. No idea where th constraint is coming from :(
    
    With this patch applied:
    
    ```
    Resolving dependencies...
    cabal: Could not resolve dependencies:
    [__0] trying: some-package-0.24.1.2 (user goal)
    [__1] trying: foldl-1.4.8 (dependency of some-packagge)
    [__2] next goal: mwc-random (dependency of foldl)
    [__2] rejecting: mwc-random-0.15.0.0 (constraint from project config
    /Users/a602232/git/haskell-libs/cabal.project.freeze requires ==0.14.0.0)
    [__2] trying: mwc-random-0.14.0.0
    [__3] next goal: math-functions (dependency of mwc-random)
    [__3] rejecting: math-functions-0.3.4.0, math-functions-0.3.3.0,
    math-functions-0.3.2.1, math-functions-0.3.2.0, math-functions-0.3.1.0,
    math-functions-0.3.0.2, math-functions-0.3.0.1, math-functions-0.3.0.0,
    math-functions-0.2.1.0, math-functions-0.2.0.2, math-functions-0.2.0.1,
    math-functions-0.2.0.0, math-functions-0.1.7.0, math-functions-0.1.6.0,
    math-functions-0.1.5.2, math-functions-0.1.5.1, math-functions-0.1.4.0,
    math-functions-0.1.3.0, math-functions-0.1.1.2, math-functions-0.1.1.1,
    math-functions-0.1.1.0, math-functions-0.1.0.0 (constraint from project config
    /Users/a602232/git/haskell-libs/cabal.project.freeze requires ==0.3.4.1)
    [__3] fail (backjumping, conflict set: math-functions, mwc-random)
    After searching the rest of the dependency tree exhaustively, these were the
    goals I've had most trouble fulfilling: mwc-random, math-functions, foldl,
    some-package
    Try running with --minimize-conflict-set to improve the error message.
    ```
    
    Note that we now explicitly say where the constraint is coming from!
    efa1e3f1