-
Notifications
You must be signed in to change notification settings - Fork 206
hie executable should be compiled with -dynamic #1171
Comments
Unfortunately it opens another can of worms. Dynamic linking in Haskell doesn't work as of 2019, there are a bunch of issues. It may work if we also build a static version, doubling build times. Cabal-install, Stack and GHC are all broken in one way or another: haskell/cabal#1720 and so on :) Basically it seems to work, but corner cases (such as dynamic linking of I'm a big proponent of dynamic builds, they are better in every aspect than "traditional" static builds. So dynamic linking of HIE is a pretty nice feature to have. But it's blocked by upstream bugs for now. |
|
I didn't try it. But it can't work on Windows because I checked the last binaries and .dlls aren't there. So any build script should at very least change the setting if on Windows. Also, the dynamic linking may seem to work, but bugs affect corner cases we may or may not encounter in the future. For example, the static Setup.hs linking bug affects dependencies too, but only if we disable "vanilla" (static) libraries with So yeah, we may try to do it, but the idea of my comments is merely that we may regret :) as we need to support a wide range of platforms and scenarios. |
Seems working on the first look on Win 10. Just to be sure i did it right:
I just checked that hie launches ok for stack project and handles basic diagnostic like misspelled name of type in scope. |
Is hie dynamically linked indeed? can you look at the .exe with http://dependencywalker.com/ ? I don't think |
@nponeccop i've loaded the EXE into dep walker, how exactly i determine if it's dynamically linked? |
It should have some 90+ libHS*.dll. If it has the same dlls as stack.exe then it's static. |
Welp, it didn't work then. All I see is winapi related libs and no traces of anything libHS*-like, module(?) list is slightly longer than stack.exe, with addition of DBGHELP.DLL, PSAPI.DLL, SHLWAPI.DLL and WINMM.DLL. |
these are all windows dlls. So it's definitely not dynamic. @mpickering how do you build hie so it's dynamic? with |
I can have a look at this. What is actually required for this? |
@power-fungus We want to build hie and all its dependencies with I know one way to do it:
I think it goes to |
@nponeccop so this is really more of a thing the user has to do? Because the build process does not touch these files. |
We need to answer some questions:
So we need someone to do this research. I only found the |
@nponeccop Please can you reopen this issue as it is not resolved yet. You can read more about the investigations I did into this issue on the GHC issue tracker In summary
It seems that your argument boils down to the fact that dynamic linking might not work on all platforms but as it improves the experience of users on platforms where it does work then we should try to enable it or at least provide an option to enable it. Further to this, we should certainly make sure that |
Oh sorry I closed it by mistake |
In the interim, can we make this platform-dependent? So it is enabled for platforms where we know it works. |
@alanz I am currently experimenting with dynamic building on linux. But I need assistence in testing if the build script I write does indeed build everything dynamically. |
Can someone try to check if |
The goal is just to build the hie executable dynamically. So you can check it with |
Are there any updates on this? I can add |
Well, |
For the record, |
See https://gitlab.haskell.org/ghc/ghc/issues/15524
c356c38
Testing this change on my branch it makes a huge difference.
Any volunteers to integrate this into
stack
and the./install.hs
script?@power-fungus perhaps?
The text was updated successfully, but these errors were encountered: