haskell / haskell/cabal

list-bin lists wrong binary for versioned dynamic foreign libraries

Open
#10,763 0 comments 0 reactions 0 assignees View on GitHub
needs triage type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

If you create a `foreign-library` stanza with `type: native-shared` and a `lib-version-info` field, cabal will create a library with a version number in its name, but tell you about a non-existent unversioned name. Typical example, with both commands executed after running `cabal build all`:

```
% cabal list-bin poll_stdin
.../dist-newstyle/build/x86_64-linux/ghc-9.8.1/dasyuridia-0.1.0.0/f/poll_stdin/build/poll_stdin/libpoll_stdin.so
% ls dist-newstyle/build/x86_64-linux/ghc-9.8.1/dasyuridia-0.1.0.0/f/poll_stdin/build/poll_stdin
autogen poll_stdin-tmp libpoll_stdin.so.0.0.0
```

Two plausible solutions are to change `list-bin` (to include the version number in the reported file name) or to change `build` (to create an unversioned link to the versioned file); I don't really know enough to be clear on the tradeoffs between them.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by running `cabal build all`, then compare `cabal list-bin poll_stdin` with the files under the reported build directory. Investigate the `list-bin` and `build` behavior for `native-shared` foreign libraries with `lib-version-info`; done means the reported binary exists and the chosen versioning behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.