mherzl
mherzl

Reputation: 6200

Haskell-Stack error: "The same package name is used in multiple local packages"

I have two different Haskell projects on my machine, and each uses the WordNet package. When installing WordNet from Hackage the build failed, however the package did build successfully when cloned and installed locally from github.

In each of my two projects, I point to the local installation in the stack.yaml file as described in the "packages and extra-deps" section of stack's documentation. The first project builds successfully. However, when I attempt to build the second project using this local dependency, I get the following error.

$ stack build
The same package name is used in multiple local packages

WordNet used in:
- PLIndex "WordNet-1.1.0"
- PLOther (PLFilePath "../WordNet-ghc74")

Why can I not depend on the same local package in two different projects?

Is there some way around this?


I have tried both cloning the package locally and pointing there in stack.yaml,

packages:
- .
- ../WordNet-ghc74

and also pointing to the repository directly on github in my stack.yaml.

packages:
- .
- location:
    git: http://github.com/mherzl/WordNet-ghc74.git
    commit: 35478c4ee8ce3fcb7b134901255818408fb934a1
  extra-dep: true

Upvotes: 3

Views: 1616

Answers (1)

mgsloan
mgsloan

Reputation: 3295

You can use the same local package in multiple projects. This looks like you have both WordNet-1.1.0 and the local file path listed in your packages / extra-deps. If this is not the case, then please open an issue on the stack issue tracker with a reproduction of the problem. Also, please ensure that you are on the latest stable version of stack (1.6.3)

Upvotes: 3

Related Questions