commercialhaskell / commercialhaskell/stack

"stack bench" probably shouldn't use "cabal bench", inconsistent GHC_PACKAGE_PATH

Open
#3,462 1 comment 1 reaction 0 assignees View on GitHub
component: benchmark type: enhancement
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

https://stackoverflow.com/questions/46505007/access-ghc-package-database-in-test-and-benchmark-suite + https://github.com/sgraf812/ghc-package-path point out that there's an inconsistency between the execution of tests and the execution of benchmarks - benchmarks don't see stack's `GHC_PACKAGE_PATH`, whereas tests do. This is because test executables are run directly, whereas benchmark executables are run via cabal. There is an unfortunate cabal misfeature (imho) where it exits immediately if GHC_PACKAGE_PATH is set.

Different to work around this:

1. Fix cabal's behavior for GHC_PACKAGE_PATH

2. Work around cabal's behavior by not using "cabal bench". I think I prefer this. IIRC there was another reason to do this, but I can't seem to find the issue via search.

3. Make cabal test not pass through GHC_PACKAGE_PATH. This would at least make it consistent with benchmarks, but not consistent with `stack exec`. I don't like this option much.

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.