Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Self-dependency in test suite fails with hie #1786

Description

@IlyaBizyaev

Hello! I have the following hashtable.cabal file:

cabal-version:       2.2

name:                hashtable
version:             0.1.0.0
-- description etc.

common shared-properties
  build-depends: -- packages
  ghc-options: -Wall -Werror -O2
  default-language:    Haskell2010

library
  import: shared-properties
  hs-source-dirs:  src
  exposed-modules: Hashtable
  default-language:    Haskell2010

-- executable

test-suite hashtable-tests
  import:              shared-properties
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test/unit
  main-is:             Spec.hs
  other-modules:       HashtableSpec
  build-depends:       hashtable
                     , hspec
                     , hspec-discover
  default-language:    Haskell2010

And the following hie.yaml file:

cradle:
  stack:
    - path: ./src
      component: "hashtable:lib"
    - path: ./test/unit
      component: "hashtable:test:hashtable-tests"

It worked fine before I added the test suite, but now I get:

"cannot satisfy -package hashtable-0.1.0.0\n    (use -v for more information)"

stack build runs successfully.
Since self-dependency seems to be the canonical way to test a library in Haskell, how can I fix this issue?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions