haskell / haskell/cabal

Dynamic object files are nearly always built

Open
#7,377 1 comment 1 reaction 0 assignees View on GitHub
documentation type: discussion
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

It's very hard to stop dynamic object files being built.

1. Documentation states that `shared: False` and `dynamic-executable: False`, so you would expect dynamic interface files to not be built by default.
2. If you set either of these options, shared libraries are still built because `ghci` needs shared libraries. See `compilerShouldUseSharedLibsByDefault`.
3. Even if you set `shared: False` explicitly, shared libraries are built because of the use of `liftA2` in `pkgsUseSharedLibrary` requires that **both** `shared:False` and `dynamic-executable: False` is set.

If you set both these options then cabal only produces .hi files.

However, if you then using `cabal repl` fails because dynamic object files are not forced to be built when we are using ghci.

I just write this down as it's pretty confusing what is going on.

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.