Skip to content

Benchmarks fail due to "shadowed dependencies" #2781

Closed
@crockeea

Description

@crockeea

This problem is described in a Stackage Server issue, but the problem should really be reported here. The problem is this:

library a
library b depends on a
benchmarks for library a depend on a and b

stack bench a results in the error:

> stack bench a
...
Preprocessing library a-0.0.1...
Preprocessing benchmark 'a-benches' for a-0.0.1...
<command line>: cannot satisfy -package-id b-0.0.1-2uppVa4SsB06R8hiHGD1I8: 
    b-0.0.1-2uppVa4SsB06R8hiHGD1I8 is unusable due to shadowed dependencies:
      a-0.0.1-B41UI81aQaCEjW3sk56eaB
    (use -v for more information)
Progress: 3/4
--  While building package a-0.0.1 using:
      /home/eric/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.0.0 build bench:a-benches --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

Note that the benchmarks compile if a-benches only depends on a or b, but not both. I don't see any reason why the benchmarks should fail to compile when they depend on both a and b; it's clear what the compilation order should be.

As indicated in the Stackage Server issue, this problem affects many packages including

  • text
  • unordered-containers
  • clock
  • options
  • attoparsec
  • wai-logger

A minimal example is in shadowed-deps.tar.gz.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions