Ticket #824 (closed defect: fixed)

Opened 2 years ago

Last modified 17 months ago

cabal install --enable-tests does not install test dependencies.

Reported by: creswick Owned by: ttuegel
Priority: normal Milestone:
Component: cabal-install tool Version: 1.10.1.0
Severity: normal Keywords:
Cc: j3h, johan.tibell@… Difficulty: unknown
GHC Version: Platform:

Description

Cabal install normally installs all the necessary project dependencies; however, this is not happening for the dependencies specified in the Test-suite stanzas. Here's an example cabal file:

Name:           foo
Version:        1.0
License:        BSD3
Cabal-Version:  >= 1.9.2
Build-Type:     Simple

executable foo
    main-is: foo.hs
    build-depends: base
                 , xml == 1.3.7

Test-Suite test-foo
    type:       exitcode-stdio-1.0
    main-is:    test-foo.hs
    build-depends: base
                  , QuickCheck >= 2.0

cabal install will install xml if necessary, then build foo, but cabal install --enable-tests complains that QuickCheck? is not available:

 $ cabal install --enable-tests
Resolving dependencies...
Configuring foo-1.0...
cabal: At least the following dependencies are missing:
QuickCheck >=2.0
cabal: Error: some packages failed to install:
foo-1.0 failed during the configure step. The exception was:
ExitFailure 1

This causes some problems when building tests with cabal-dev:

 https://github.com/creswick/cabal-dev/issues#issue/10

(Using cabal-install 0.10.2 built with Cabal 1.10.1.0)

Attachments

cabal-install-test-dependencies.dpatch Download (56.4 KB) - added by ttuegel 2 years ago.
Patch to make cabal install pull in test suite dependencies when tests are enabled.

Change History

  Changed 2 years ago by tibbe

  • cc johan.tibell@… added
  • owner set to ttuegel

follow-up: ↓ 3   Changed 2 years ago by tibbe

Thomas, can you please take a look?

Changed 2 years ago by ttuegel

Patch to make cabal install pull in test suite dependencies when tests are enabled.

in reply to: ↑ 2   Changed 2 years ago by ttuegel

Replying to tibbe:

Thomas, can you please take a look?

The attached patch should do the trick.

  Changed 2 years ago by tibbe

Looks good to me. Please send to Duncan for submit.

Perhaps add a comment e.g.

-- Make sure test suite dependencies are included.
pkgSpecifiers' = map enableTests pkgSpecifiers
...

  Changed 2 years ago by duncan

  • status changed from new to closed
  • resolution set to fixed

Applied.

Mon Apr 18 12:05:29 BST 2011  Thomas Tuegel <ttuegel@gmail.com>
  * Install phase pulls in test suite dependencies when necessary.

  Changed 17 months ago by elga

Note: See TracTickets for help on using tickets.