Skip to content

package-tests do not work with stack #2711

Closed

Description

@ezyang

Steps to reproduce: run stack test in Cabal.

Actual result:

Cabal-1.23.0.0: test (suite: package-tests)
package-tests: dist: canonicalizePath: does not exist (No such file or directory)

OK, so let's set CABAL_BUILDDIR explicitly, like env CABAL_BUILDDIR=.stack-work/dist/x86_64-linux/Cabal-1.22.2.0/ stack test. Then we get:

    expected: 'setup install' should succeed
      output: "/home/hs01/ezyang/cabal-edge/Cabal/tests/Setup configure --user -w /bin/ghc" in 
PackageTests/BuildDeps/InternalLibrary2/to-install
    Configuring InternalLibrary2-0.1...
    Setup: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
    Cabal. Use the flag --package-db to specify a package database (it can be used
    multiple times).

Activity

  1. 23Skidoo commented on Jul 7, 2015

    @23Skidoo
    Member

    Patches welcome.

  2. ezyang commented on Aug 27, 2015

    @ezyang
    ContributorAuthor

    An adequate workaround is to call the test executable directly with CABAL_BUILDDIR, e.g. env CABAL_BUILDDIR=.stack-work/dist/x86_64-linux/Cabal-1.22.2.0/ .stack-work/dist/x86_64-linux/Cabal-1.22.2.0/build/package-tests/package-tests

  3. self-assigned this
    on Dec 25, 2015
  4. ezyang commented on Dec 25, 2015

    @ezyang
    ContributorAuthor

    I have a better idea, which is to use the executable name of the package tests to infer the build directory.

  5. ttuegel commented on Aug 29, 2016

    @ttuegel
    Member

    @ezyang You can work around this by running stack exec --no-ghc-package-path stack test.

  6. added 2 commits that reference this issue on Sep 1, 2016
    692ba50
    e7d2a62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions