Skip to content

Different executable components using the same build plan #3732

Open

Description

@basetunnel

I have this cabal file

name: test-components
version: 0.0.1
cabal-version: 1.12
build-type: Simple
license: AllRightsReserved
description:


executable component-a
    main-is: Main.hs
    build-depends:
        base -any
    default-language: Haskell2010
    hs-source-dirs: src

executable component-b
    main-is: Main.hs
    build-depends:
        base == 42.*
    default-language: Haskell2010
    hs-source-dirs: src

test-suite component-c
    type: exitcode-stdio-1.0
    main-is: Main.hs
    build-depends:
        base == 42.*
    default-language: Haskell2010
    hs-source-dirs: src

And run cabal new-build exe:component-a. Then I get this message:

Resolving dependencies...
cabal: Could not resolve dependencies:
trying: test-components-0.0.1 (user goal)
next goal: base (dependency of test-components-0.0.1)
rejecting: base-4.8.2.0/installed-0d6... (conflict: test-components =>
base==42.*)
rejecting: ...

Is this expected behaviour? I'd expect that build-plans for components are seperate. When I remove component-b and keep component-c with the same incorrect dependency I get no error (test-suite have a different status?).

The actual problem I ran into was two components that required different versions of a certain dependency and therefore dependencies could not be resolved.

Activity

  1. ezyang commented on Aug 29, 2016

    @ezyang
    Contributor

    I think this is this bug #1575? We're so close to fixing it, but it requires some extra changes to the solver :/

  2. basetunnel commented on Aug 29, 2016

    @basetunnel
    ContributorAuthor

    Ok, awesome, I missed that.

  3. ezyang commented on Sep 11, 2016

    @ezyang
    Contributor

    #1575 took a different direction so I'm reopening this.

  4. reopened this on Sep 11, 2016
  5. ezyang commented on Sep 11, 2016

    @ezyang
    Contributor

    CC @hvr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions