haskell / haskell/cabal

cabal bench cannot find shared library during execution with executable-dynamic

Open
#4,729 2 comments 0 reactions 0 assignees View on GitHub
cabal-install: v1- Cabal: cmd/bench type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

```sh-session
$ cabal configure --enable-benchmarks --enable-executable-dynamic

$ cabal bench

Benchmark bench: RUNNING...
dist/build/bench/bench: error while loading shared libraries: libHSfoobar-0.1.0.0-…-ghc8.0.2.so: cannot open shared object file: No such file or directory
```

```
-- foobar.cabal
name: foobar
version: 0.1.0.0
build-type: Simple
cabal-version: >=1.10
library
build-depends: base
exposed-modules: Foobar
benchmark bench
type: exitcode-stdio-1.0
build-depends: base, foobar
main-is: Bench.hs
```

```hs
-- Foobar.hs
module Foobar where
```

```hs
-- Bench.hs
main = undefined
```

Reproduced on both:

- cabal-install-2.0.0.0, Cabal-2.0.0.2
- cabal-install-1.24.0.2, Cabal-1.24.2.0

System: Arch Linux (x86-64)

Workaround:

- `LD_LIBRARY_PATH=dist/build:$LD_LIBRARY_PATH cabal bench` (Linux only)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.