Error installing the shuffle library with stack

2019-07-09 04:55发布

问题:

Using stack 1.2.0 and LTS 7.0 I'm getting the following error installing the shuffle library:

$ cabal get shuffle
$ cd shuffle-0.1.3.3
$ stack build
...
/tmp/shuffle-0.1.3.3/Setup.hs:2:1: error:
    Failed to load interface for ‘Distribution.Simple.UUAGC’
    Perhaps you meant
      Distribution.Simple.UHC (from Cabal-1.24.0.0)
      Distribution.Simple.GHC (from Cabal-1.24.0.0)
      Distribution.Simple.JHC (from Cabal-1.24.0.0)
    Use -v to see a list of the files searched for.

/tmp/shuffle-0.1.3.3/Setup.hs:3:1: error:
    Failed to load interface for ‘UU.UUAGC’
    Use -v to see a list of the files searched for.

--  While building package shuffle-0.1.3.3 using:
      /usr/local/bin/ghc --make -odir /tmp/shuffle-0.1.3.3/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup -hidir /tmp/shuffle-0.1.3.3/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup -i -i. -package=Cabal-1.24.0.0 -clear-package-db -global-package-db -package-db=/home/asr/.stack/snapshots/x86_64-linux/lts-7.0/8.0.1/pkgdb /tmp/shuffle-0.1.3.3/Setup.hs -o /tmp/shuffle-0.1.3.3/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup/setup
    Process exited with code: ExitFailure 1

I'm using the following stack.yaml file:

resolver: lts-7.0

# Local packages, usually specified by relative directory name
packages:
- '.'
extra-deps:
- logict-state-0.1.0.2
- pqueue-1.3.1.1
- uhc-util-0.1.6.6
- uuagc-0.9.52.1
- uuagc-cabal-1.0.6.0
- uulib-0.9.22

Do I need to add/change something in the library or in stack.yaml? (I had no problems using cabal-install).

回答1:

I was able to get this to work by adding the following to stack.yaml:

explicit-setup-deps:
    shuffle: true

For more information, see: https://docs.haskellstack.org/en/stable/yaml_configuration/#explicit-setup-deps



回答2:

It appears that this package requires you to have installed uuagc-cabal to build it. Starting after Cabal-1.23 these kinds of package dependencies for Setup.hs files can be captured in the custom-setup section of a cabal file.

There are tickets about this functionality for stack that seem to be interlinked from here:

  • Setup.hs cannot use local snapshot dependencies WAS stack failing to resolve local dependencies of multiple package project #897