Skip to content

new-haddock: '-dynamic' flag is not passed to haddock (archlinux, dynamic GHC package) #4670

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
TimoFreiberg opened this issue Aug 6, 2017 · 1 comment

Comments

@TimoFreiberg
Copy link

~/.cabal/config:

library-vanilla: False
shared: True
executable-dynamic: True

GHC version: 8.2.1
Cabal version: 2.1.0

ghc and setup are called with -dynamic, but haddock isn't.
The operation fails with a linker error.
Passing -optghc=-dynamic to haddock (via --haddock-options) fixed the issue.

I since went static again after I found ghc-static and don't use the dynamic settings anymore.

@alexbiehl
Copy link
Member

alexbiehl commented Aug 7, 2017

The culprit is most likely here: https://github.com/haskell/cabal/blob/master/Cabal/Distribution/Simple/Haddock.hs#L329

    opts <- if withVanillaLib lbi
            then return vanillaOpts
            else if withSharedLib lbi
            then return sharedOpts
            else die' verbosity $ "Must have vanilla or shared libraries "
                       ++ "enabled in order to run haddock"

Where sharedOpts includes -dynamic.

Indeed if one passes --disable-library-vanilla Cabal picks sharedOpts. So I think we need the same mechanism here with which cabal-install decides if it should pass -dynamic to ghc and setup or not.

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

No branches or pull requests

3 participants