From b809a90acf2d1f4dcf39dcb64c4e26e66bf31ad8 Mon Sep 17 00:00:00 2001 From: jneira Date: Wed, 2 Feb 2022 09:16:15 +0100 Subject: [PATCH 1/7] Disable -dynamic for all workflows --- .github/actions/setup-build/action.yml | 7 ++++++- .github/workflows/build.yml | 5 ----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index 7b69d482e2..7f9c448cbf 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -63,10 +63,15 @@ runs: fi shell: bash + - name: Disable -dynamic + run: | + echo "package haskell-language-server\n flags: -dynamic" >> cabal.project.local + shell: bash + - if: inputs.os == 'Windows' && inputs.ghc == '8.8.4' name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults run: | - echo -e 'package floskell\n ghc-options: -O0' >> cabal.project.local + echo -e 'package floskell\n ghc-options: -O0' >> cabal.project.local shell: bash # Shorten binary names as a workaround for filepath length limits in Windows, diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c945f51517..c8940937da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,11 +48,6 @@ jobs: echo "tests: false" >> cabal.project.local echo "benchmarks: false" >> cabal.project.local - - name: Disable -dynamic - run: | - echo "package haskell-language-server" >> cabal.project.local - echo " flags: -dynamic" >> cabal.project.local - - uses: ./.github/actions/setup-build with: ghc: ${{ matrix.ghc }} From 33faa3f328cb0ce5e4b231031c8d09d142933ce2 Mon Sep 17 00:00:00 2001 From: jneira Date: Wed, 2 Feb 2022 09:17:32 +0100 Subject: [PATCH 2/7] Remove quotes --- docs/troubleshooting.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 842b54d9a9..de893e32d1 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -168,19 +168,19 @@ Dynamically linked binaries (including`ghci`) use the system linker instead of t The easiest way to obtain a dynamically linked HLS binary is to build HLS locally. With `cabal` this can be done as follows: ```bash -cabal update && cabal install pkg:haskell-language-server" +cabal update && cabal install pkg:haskell-language-server ``` If you are compiling with a ghc version with a specific `cabal-ghc${ghcVersion}.project` in the repo you will have to use it. For example for ghc-9.0.x: ```bash -cabal update && cabal install pkg:haskell-language-server --project-file=cabal-ghc90.project" +cabal update && cabal install pkg:haskell-language-server --project-file=cabal-ghc90.project ``` Or with `stack`: ```bash -stack install haskell-language-server --stack-yaml=stack-${ghcVersion}.yaml" +stack install haskell-language-server --stack-yaml=stack-${ghcVersion}.yaml ``` You also can leverage `ghcup compile hls`: From e0c780e26887acfd3cd7f2e703f0250b9bae9c92 Mon Sep 17 00:00:00 2001 From: jneira Date: Wed, 2 Feb 2022 09:25:59 +0100 Subject: [PATCH 3/7] Bump version to 1.6.1.1 --- haskell-language-server.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 689a99e3b5..89d38e953d 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1,7 +1,7 @@ cabal-version: 2.4 category: Development name: haskell-language-server -version: 1.6.1.0 +version: 1.6.1.1 synopsis: LSP server for GHC description: Please see the README on GitHub at From 2de75bd412ccb186e6af31bed23cbe15b4d6abe8 Mon Sep 17 00:00:00 2001 From: jneira Date: Wed, 2 Feb 2022 09:26:18 +0100 Subject: [PATCH 4/7] Update changelog for 1.6.1.1 --- ChangeLog.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 13aefed15f..eed4d13144 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,16 @@ # Changelog for haskell-language-server +## 1.6.1.1 (*only hackage release*) + +- Release to update haskell-language-server.cabal in hackage, setting the build for the executable component as dynamically linked + - The motivation is build by default a hls executable which works for Template Haskell + - This doesn't need a full release cause it does not affect release executables which continue being fully static + +### Pull requests merged for 1.6.1.1 + +- Add the -dynamic flag and update build instructions +([#2668](https://github.com/haskell/haskell-language-server/pull/2668)) by @pepeiborra + ## 1.6.1.0 This is a bug fix release to restore a fully statically linked haskell-language-server-wrapper executable. From fc7c6a6e88ddd7ce106b4ba3ac76f60e400bb62c Mon Sep 17 00:00:00 2001 From: jneira Date: Wed, 2 Feb 2022 09:46:10 +0100 Subject: [PATCH 5/7] Correct flag set --- .github/actions/setup-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index 7f9c448cbf..a3b1696531 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -65,7 +65,7 @@ runs: - name: Disable -dynamic run: | - echo "package haskell-language-server\n flags: -dynamic" >> cabal.project.local + echo -e "package haskell-language-server\n flags: -dynamic" >> cabal.project.local shell: bash - if: inputs.os == 'Windows' && inputs.ghc == '8.8.4' From 187a2d69033875045425fcdad393e6f7d21c852b Mon Sep 17 00:00:00 2001 From: jneira Date: Wed, 2 Feb 2022 10:58:23 +0100 Subject: [PATCH 6/7] add comment to ci step --- .github/actions/setup-build/action.yml | 4 ++++ ChangeLog.md | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index a3b1696531..d86504bc01 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -63,6 +63,10 @@ runs: fi shell: bash + # The default build for haskell-language-server executable is dynamic for linux and macOS + # to get a executable which works for Template Haskell + # However we continue providing full static executables in releases so we have to disable it + # *for all workflows*, including test, flags and release builds - name: Disable -dynamic run: | echo -e "package haskell-language-server\n flags: -dynamic" >> cabal.project.local diff --git a/ChangeLog.md b/ChangeLog.md index eed4d13144..dd12e99a7a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -8,6 +8,8 @@ ### Pull requests merged for 1.6.1.1 +- Prepare 1.6.1.1 (only hackage release) +([#2681](https://github.com/haskell/haskell-language-server/pull/2681)) by @jneira - Add the -dynamic flag and update build instructions ([#2668](https://github.com/haskell/haskell-language-server/pull/2668)) by @pepeiborra From 53608eea85264babd10740c5127692a5abad6e21 Mon Sep 17 00:00:00 2001 From: jneira Date: Wed, 2 Feb 2022 13:13:45 +0100 Subject: [PATCH 7/7] Restore header and link --- docs/troubleshooting.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index de893e32d1..bccc5667ee 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -160,9 +160,9 @@ The server log will show which cradle is being chosen. Using an explicit `hie.yaml` to configure the cradle can resolve the problem, see the [configuration page](./configuration.md#configuring-your-project-build). -### Static binaries and template haskell support +### Static binaries -Static binaries use the GHC linker for dynamically loading dependencies when typechecking TH code, and this can run into issues when loading shared objects linked against mismatching system libraries, or into GHC linker bugs (mainly the Mach linker used in Mac OS, but also potentially the ELF linker). +Static binaries use the GHC linker for dynamically loading dependencies when typechecking Template Haskell code, and this can run into issues when loading shared objects linked against mismatching system libraries, or into GHC linker bugs (mainly the Mach linker used in Mac OS, but also potentially the ELF linker). Dynamically linked binaries (including`ghci`) use the system linker instead of the GHC linker and avoid both issues. The easiest way to obtain a dynamically linked HLS binary is to build HLS locally. With `cabal` this can be done as follows: