Skip to content

docs: Explain how to build only .dyn_o. #10984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nh2
Copy link
Member

@nh2 nh2 commented Jun 11, 2025

We struggled for a while at ZuriHac 2025 to figure out why Cabal kept adding -static -dynamic-too to GHC flags, even when the GHC is built dynamic-by-default
(ghc --info outputs ("GHC Dynamic","YES")).

The docs so far,

``--enable-shared`` is enabled automatically if GHC is dynamically linked or
you request to build dynamic executables.

did not explain it sufficiently.

It is beacause of this code:

wantedLibWays is_indef =
    <> [StaticWay | withVanillaLib lbi || withStaticLib lbi]

This commit clarifies the docs.

Please read Github PR Conventions and then fill in one of these two templates.


Template B: This PR does not modify behaviour or interface

E.g. the PR only touches documentation or tests, does refactorings, etc.

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

We struggled for a while at ZuriHac 2025 to figure out
why Cabal kept adding `-static -dynamic-too` to GHC flags,
even when the GHC is built dynamic-by-default
(`ghc --info` outputs `("GHC Dynamic","YES")`).

The docs so far,

    ``--enable-shared`` is enabled automatically if GHC is dynamically linked or
    you request to build dynamic executables.

did not explain it sufficiently.

It is beacause of this code:

    wantedLibWays is_indef =
        <> [StaticWay | withVanillaLib lbi || withStaticLib lbi]

This commit clarifies the docs.
@nh2
Copy link
Member Author

nh2 commented Jun 11, 2025

Screenshot of the docs generated:

image

and for the commands:

image

@mpickering
Copy link
Collaborator

Indeed, the default is to build vanilla libraries, and if you have a dynamically linked compiler that implies dynamic libraries as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants