- 
                Notifications
    
You must be signed in to change notification settings  - Fork 66
 
Description
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 :
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).