Skip to content
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

Dynamic GHC #257

Closed
berberman opened this issue Oct 19, 2020 · 1 comment
Closed

Dynamic GHC #257

berberman opened this issue Oct 19, 2020 · 1 comment

Comments

@berberman
Copy link
Contributor

berberman commented Oct 19, 2020

This is an archlinux related issue, since the entire haskell ecosystem distributed to archlinux is in dynamic linking. Currently, tests of hie-bios, ghcide, HLS , or maybe new projects depending hie-bios will fail immediately in archlinux, because ghc sessions created by hie-bios are not in dynamic for some cases. Personally, I use three kinds of cradle: stack, cabal, and directly ghc on standalone .hs file. For stack, the environment is isolated if we don't tell stack to use system ghc, so it works well; and for cabal, we can add:

program-default-options
  ghc-options:
    -dynamic

in ~/.caban/config, to let cabal call ghc in dynamic globally; and for directly ghc, I think there is no way except passing dynflags in hie.yaml.

Haskell developers using archlinux can write hie.yaml, or use project-local cabal file to make sure that hie-bios works as expect and thier projects work fine, despite it would be tedious to write hie.yaml everywhere. However, for tests I mentioned at first, providing hie.yaml files for every test case is less reasonable, and even in distribution packaging, this is a disaster. Similar issue occurred in doctest, our workaround is to patch source code, @felixonmars :

https://github.com/archlinux/svntogit-community/blob/39a3b66baee8c233ca227a5d969b41cac112630b/trunk/PKGBUILD#L21

to let doctest work with system ghc, not only in tests, but also in runtime. This is hacky, so my opnion is that hie-bios should give a flag to control whether passing -dynamic to cabal, or dynamicTooMkDynamicDynFlags directly to ghc. Alternatively, without a flag, hie-bios just need to guarantee that if it was compiled dynamically, sessions created should be dynamic as well in default (for cabal and direct ghc).

@berberman
Copy link
Contributor Author

Closed by #286 and #287 (hopefully)

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

No branches or pull requests

1 participant