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

Build dynamic executables by default on supported platforms #2245

Closed
pepeiborra opened this issue Sep 27, 2021 · 8 comments · Fixed by #2668
Closed

Build dynamic executables by default on supported platforms #2245

pepeiborra opened this issue Sep 27, 2021 · 8 comments · Fixed by #2668
Labels
old_type: distribution status: needs info Not actionable, because there's missing information type: enhancement New feature or request

Comments

@pepeiborra
Copy link
Collaborator

pepeiborra commented Sep 27, 2021

We want A)git clone .. && cd <dir> && cabal install haskell-language-server to build a -dynamic binary by default on Linux, MacOs and any other supported platforms, excluding Windows, for the reasons outlined in https://github.com/haskell/haskell-language-server/blob/1ba88ab9eca1da29cd4fee7d2084eba4074fbe47/docs/troubleshooting.md#problems-with-dynamic-linking

Similarly, we also want B)cabal unpack haskell-language-server && cd <dir> && cabal install to build dynamic executables.

What's the best way to do this? Summarising the discussion at https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/245:

  1. A cabal.project setting is not a good fit since conditionals are not supported and would not help with B)
  2. A conditional ghc-options: -dynamic in haskell-language-server.cabal doesn't play well with cabal v2-build
  3. A cabal-dynamic.project.local file would require an extra step and would not help with B) either
@pepeiborra
Copy link
Collaborator Author

Summoning Cabal experts, @emilypi @phadej any suggestions?

@jneira
Copy link
Member

jneira commented Sep 27, 2021

A conditional ghc-options: -dynamic in haskell-language-server.cabal doesn't play well with cabal v2-build

hmm could you describe briefly what would be the problem?

if !os(windows) && !flag(static)
  ghc-options: -dynamic

would be a reasonable way to do it

@jneira
Copy link
Member

jneira commented Sep 27, 2021

Want to link a closed issue which considered build dinamically prebuilt binaries: #2069
And i dont find it right now but i want to remember someone had problems in linux building using stack and dynamic linking enabled.

@pepeiborra
Copy link
Collaborator Author

A conditional ghc-options: -dynamic in haskell-language-server.cabal doesn't play well with cabal v2-build

hmm could you describe briefly what would be the problem?

if !os(windows) && !flag(static)
  ghc-options: -dynamic

would be a reasonable way to do it

This doesn't work well for the reasons outlined in https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/245#note_378797

@pepeiborra
Copy link
Collaborator Author

Want to link a closed issue which considered build dinamically prebuilt binaries: #2069
And i dont find it right now but i want to remember someone had problems in linux building using stack and dynamic linking enabled.

Thanks but the linked issue is about distribution, this issue is about building from source.

@hasufell
Copy link
Member

A conditional ghc-options: -dynamic in haskell-language-server.cabal doesn't play well with cabal v2-build

hmm could you describe briefly what would be the problem?

if !os(windows) && !flag(static)
  ghc-options: -dynamic

would be a reasonable way to do it

This doesn't work well for the reasons outlined in https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/245#note_378797

The isssue I described is orthogonal to where this flag is put, be it cabal file, project file or command line. The problem is that we need to install the plugin libs, which requires v2-install, which doesn't play nice with compiling from git, because of overly eager cache hits.

@jneira
Copy link
Member

jneira commented Dec 15, 2021

We took the path of building fully statically linked binaries for linux and set a warning for macos, suggesting building dinamically from source,
Otoh ghcup has a better support to build hls dinamically and https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/245 is closed
@pepeiborra do you think could we close this?

@jneira jneira added the status: needs info Not actionable, because there's missing information label Dec 15, 2021
@pepeiborra
Copy link
Collaborator Author

No, I still want cabal install HLS to build a dyn linked binary by default

@jneira jneira linked a pull request Feb 1, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
old_type: distribution status: needs info Not actionable, because there's missing information type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants