commercialhaskell / commercialhaskell/stack

Stack Yields Opaque Error When Using Foreign Libraries That Depend On Other Foreign Libraries (Hides g++ Output)

Open
#2,932 2 comments 2 reactions 0 assignees View on GitHub
component: output (UI/UX) needs reproduction
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

Let’s say you are building a Haskell/C++ project that depends upon `libA.so`, but `libA.so` also depends upon `libB.so` (using Haskell FFI with Main located in Haskell). You then put `libA.so` into your project's cabal file under `extra-libraries:` field but neglect to put in libB.so also (problematic). Since you did not also put `libB.so`, g++ would normally complain that a bunch of stuff is undefined (if you were just using g++ instead of Haskell FFI). This would help you track down the error as you forgetting the `libB.so` dependency.

But running `stack build` just shows the opaque error “cannot find missing C library: libA.so”, even though the issue is not with `libA.so` but with `libB.so`!

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.