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 linking does not work on Windows #2048

Closed
Tarmean opened this issue Jul 28, 2021 · 2 comments
Closed

Dynamic linking does not work on Windows #2048

Tarmean opened this issue Jul 28, 2021 · 2 comments
Labels
build tool: stack CI Continuous integration os: windows type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@Tarmean
Copy link

Tarmean commented Jul 28, 2021

I'm usually compiling haskell-language-server on Windows 10 with stack. Running stack build to build 8.10.4 on commit 45fdb25 or later results in compiler errors like:

hie-compat                       > src-ghc810\Compat\HieAst.hs:20:8: error:
hie-compat                       >     Could not find module `Prelude'
hie-compat                       >     Perhaps you haven't installed the "dyn" libraries for package `base-4.14.1.0'?
hie-compat                       >     Use -v (or `:set -v` in ghci) to see a list of the files searched for.
hie-compat                       >    |
hie-compat                       > 20 | module Compat.HieAst ( mkHieFile, enrichHie ) where

From looking at the issue tracker it seems that dynamic linking doesn't work on Windows, but instead of silently being ignored it seems to break the build - at least on the GHC 8.10.4 version installed by stack.
There seems to be some related discussion here? haskell/haskell-ide-engine#1171 (comment)

Removing the

$targets:
- --enable-executable-dynamic

line from the respective stack.yaml fixes the build.

@jneira
Copy link
Member

jneira commented Jul 28, 2021

Hi, thanks for the bug report. We are restoring static linking again with #2044, as there were problems related in linux and the reason to enable it does not hold. You can remove the config that enables it from the stack yaml you are using if you dont want to wait on the pr merge.
I assumed incorrectly that dynamic linking was a no op in windows but it is not the case. The problem here is the ghc distributed for windows (and the bootstrap libs it includes like base) is not prepared for dynamic linking.
Sorry for the inconveniences!

@jneira jneira added CI Continuous integration build tool: stack os: windows type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Jul 28, 2021
@Tarmean
Copy link
Author

Tarmean commented Jul 28, 2021

Wow, a fix time of -5 hours is very impressive. Thank you for your amazing work!

@Tarmean Tarmean closed this as completed Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build tool: stack CI Continuous integration os: windows type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

2 participants