1

I am trying to use EuterpeaLite (https://github.com/Euterpea/EuterpeaLite), but it is not on Hackage.

I imported it like such import EuterpeaLite as EL and I added it to my cabal file like this:

build-depends:
base >=4.7 && <5
, postgresql-simple
, EuterpeaLite

But when I run stack build or stack ghci, I get this error:


Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for engine-0.1.0.0:

EuterpeaLite needed, but the stack configuration has no specified version (no package with that name found, perhaps there

is a typo in a package's build-depends or an omission from the stack.yaml packages list?)

needed since engine is a build target.

Some different approaches to resolving this:

Plan construction failed.

Is there a special process for non-Hackage packages?

MikaelF
  • 3,518
  • 4
  • 20
  • 33
LevelChart8
  • 207
  • 1
  • 8
  • Does this answer your question? [How to install/use a local version of package using Stack?](https://stackoverflow.com/questions/32849269/how-to-install-use-a-local-version-of-package-using-stack) – MikaelF Mar 14 '20 at 02:27
  • I tried this: `packages: - deepseq-1.4.4.0 - Euterpea-2.0.7@sha256:81d583a47d483bf83ac07df7b764138f1aa52a56db4e7c7f685d070dbac4b388,2661 - location: git: https://github.com/Euterpea/EuterpeaLite.git commit: 5fe2d129bd3087dd78c0feaf4d35fc03ffd36215` and received the same error. – LevelChart8 Mar 14 '20 at 02:38
  • 4
    @LevelChart8 You need to put it in `extra-deps`, not `packages`. `packages` is used to list the packages in your Stack project; `extra-deps` is used to list any extra dependencies which aren’t in your Stack resolver. – bradrn Mar 14 '20 at 04:52

1 Answers1

1

I used the following procedure.

  1. Create a new stack project stack new myproject --resolver=14.27. I needed to specify an older resolver, since EuterpeaLite wouldn't build with lts-15.3
  2. In the myproject directory, add the following lines to stack.yaml:

    extra-deps:
    - git: https://github.com/Euterpea/EuterpeaLite.git
      commit: 5fe2d129bd3087dd78c0feaf4d35fc03ffd36215
    
  3. Also in the myproject directory, I added the following dependency to package.yaml:

    dependencies:
    - base >= 4.7 && < 5
    - EuterpeaLite           # <- added this line
    
  4. Ran stack build in the myproject directory.

As you noted, instead of using package.yaml, you could change your .cabal file.

K. A. Buhr
  • 45,621
  • 3
  • 45
  • 71