diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index d99683fc52..fd920f71df 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -35,6 +35,8 @@ jobs: , "**/README.md" , "FUNDING.yml" , "**/stack*.yaml" + , ".gitlab-ci.yaml" + , ".gitlab/**" ]' bench_init: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3dc45129fd..c8940937da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,7 +105,7 @@ jobs: - name: Build the wrapper if: matrix.ghc == '8.10.7' - run: cabal build exe:hls-wrapper -O2 $LINUX_CABAL_ARGS + run: cabal build exe:hls-wrapper -O2 $CABAL_ARGS - name: Compress wrapper binary if: matrix.ghc == '8.10.7' diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index fc9b319de0..2473f7ad7f 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -69,6 +69,9 @@ jobs: , "**/README.md" , "FUNDING.yml" , ".circleci/**" + , "**/stack*.yaml" + , ".gitlab-ci.yaml" + , ".gitlab/**" ]' caching: diff --git a/.github/workflows/flags.yml b/.github/workflows/flags.yml index 1f7e659a04..c23533430b 100644 --- a/.github/workflows/flags.yml +++ b/.github/workflows/flags.yml @@ -34,6 +34,8 @@ jobs: , "FUNDING.yml" , ".circleci/**" , "**/stack*.yaml" + , ".gitlab-ci.yaml" + , ".gitlab/**" ]' flags: diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index ebb9a9572e..5645f9f0e8 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -11,7 +11,7 @@ on: upload-candidates: description: 'Whether packages should be uploaded' required: true - default: 'true' + default: 'false' push: branches: - '*-hackage' @@ -20,7 +20,7 @@ jobs: check-and-upload-tarballs: runs-on: ubuntu-latest strategy: - fail-fast: ${{ github.event.inputs.upload-candidates == 'true' }} + fail-fast: ${{ github.event.inputs.upload-candidates != 'false' }} matrix: package: ["hie-compat", "hls-graph", "shake-bench", "hls-plugin-api", "ghcide", "hls-test-utils", @@ -139,7 +139,7 @@ jobs: path: ${{ steps.generate-dist-tarball.outputs.path }} upload-candidate: - if: github.event.inputs.upload-candidates == 'true' + if: github.event.inputs.upload-candidates != 'false' needs: check-and-upload-tarballs runs-on: ubuntu-latest steps: diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index bc2b9bed6c..1cdf937d09 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -32,6 +32,9 @@ jobs: , "**/README.md" , "FUNDING.yml" , "**/stack*.yaml" + , "**/stack*.yaml" + , ".gitlab-ci.yaml" + , ".gitlab/**" ]' - id: skip_check_no_nix uses: fkirc/skip-duplicate-actions@v3.4.1 diff --git a/.github/workflows/rerun.yml b/.github/workflows/rerun.yml deleted file mode 100644 index 5886e8946c..0000000000 --- a/.github/workflows/rerun.yml +++ /dev/null @@ -1,14 +0,0 @@ -on: - issue_comment: - types: [created] - -jobs: - rerun_pr_tests: - name: rerun_pr_tests - if: ${{ github.event.issue.pull_request }} - runs-on: ubuntu-20.04 - steps: - - uses: estroz/rerun-actions@main - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - comment_id: ${{ github.event.comment.id }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e8bbb11eda..d71bdbeef3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,6 +35,8 @@ jobs: , "FUNDING.yml" , ".circleci/**" , "**/stack*.yaml" + , ".gitlab-ci.yaml" + , ".gitlab/**" ]' # If we only change ghcide downstream packages we have not test ghcide itself - id: skip_ghcide_check diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e93f32b716..6ef38692a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,7 +85,7 @@ tar-aarch64-linux-deb10: script: - ./.gitlab/tar.sh variables: - TARBALL_ARCHIVE_SUFFIX: aarch64-linux-deb10 + TARBALL_ARCHIVE_SUFFIX: Linux-aarch64 TARBALL_EXT: tar.xz build-armv7-linux-deb10: @@ -107,7 +107,7 @@ tar-armv7-linux-deb10: script: - ./.gitlab/tar.sh variables: - TARBALL_ARCHIVE_SUFFIX: armv7-linux-deb10 + TARBALL_ARCHIVE_SUFFIX: Linux-armv7 TARBALL_EXT: tar.xz build-x86_64-linux: @@ -129,7 +129,7 @@ tar-x86_64-linux: script: - ./.gitlab/tar.sh variables: - TARBALL_ARCHIVE_SUFFIX: x86_64-linux + TARBALL_ARCHIVE_SUFFIX: Linux-x86_64 TARBALL_EXT: tar.xz build-x86_64-linux-alpine: @@ -153,7 +153,7 @@ tar-x86_64-linux-alpine: script: - ./.gitlab/tar.sh variables: - TARBALL_ARCHIVE_SUFFIX: x86_64-linux-alpine + TARBALL_ARCHIVE_SUFFIX: Linux-alpine-x86_64 TARBALL_EXT: tar.xz build-x86_64-freebsd12: @@ -173,7 +173,7 @@ tar-x86_64-freebsd12: script: - ./.gitlab/tar.sh variables: - TARBALL_ARCHIVE_SUFFIX: x86_64-freebsd12 + TARBALL_ARCHIVE_SUFFIX: FreeBSD12-x86_64 TARBALL_EXT: tar.xz build-x86_64-freebsd13: @@ -197,7 +197,7 @@ tar-x86_64-freebsd13: script: - ./.gitlab/tar.sh variables: - TARBALL_ARCHIVE_SUFFIX: x86_64-freebsd13 + TARBALL_ARCHIVE_SUFFIX: FreeBSD13-x86_64 TARBALL_EXT: tar.xz build-x86_64-darwin: @@ -217,7 +217,7 @@ tar-x86_64-darwin: script: - ./.gitlab/tar.sh variables: - TARBALL_ARCHIVE_SUFFIX: x86_64-darwin + TARBALL_ARCHIVE_SUFFIX: macOS-x86_64 TARBALL_EXT: tar.xz build-aarch64-darwin: @@ -269,7 +269,7 @@ tar-aarch64-darwin: script: - arch -arm64 /bin/bash ./.gitlab/tar.sh variables: - TARBALL_ARCHIVE_SUFFIX: aarch64-darwin + TARBALL_ARCHIVE_SUFFIX: macOS-aarch64 TARBALL_EXT: tar.xz build-x86_64-windows: @@ -278,7 +278,6 @@ build-x86_64-windows: - new-x86_64-windows parallel: *default_matrix script: - - bash '-lc' 'pacman --noconfirm -S zip' - $env:CHERE_INVOKING = "yes" - bash '-lc' "ADD_CABAL_ARGS=$env:ADD_CABAL_ARGS GHC_VERSION=$env:GHC_VERSION CABAL_INSTALL_VERSION=$CABAL_INSTALL_VERSION .gitlab/ci.sh" variables: @@ -294,5 +293,5 @@ tar-x86_64-windows: - $env:CHERE_INVOKING = "yes" - bash '-lc' "TARBALL_ARCHIVE_SUFFIX=$env:TARBALL_ARCHIVE_SUFFIX TARBALL_EXT=$env:TARBALL_EXT .gitlab/tar.sh" variables: - TARBALL_ARCHIVE_SUFFIX: x86_64-windows + TARBALL_ARCHIVE_SUFFIX: Windows-x86_64 TARBALL_EXT: zip diff --git a/.gitlab/tar.sh b/.gitlab/tar.sh index 7fd719589d..ba713d63fa 100755 --- a/.gitlab/tar.sh +++ b/.gitlab/tar.sh @@ -8,14 +8,15 @@ ls -la out/ cd out/ # create tarball/zip -TARBALL_PREFIX="haskell-language-server-$("$CI_PROJECT_DIR/out/haskell-language-server-wrapper" --numeric-version)" +HLS_VERSION="$("$CI_PROJECT_DIR/out/haskell-language-server-wrapper" --numeric-version)" +TARBALL_PREFIX="haskell-language-server" case "${TARBALL_EXT}" in zip) - zip "${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}.${TARBALL_EXT}" haskell-language-server-* + zip "${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}-${HLS_VERSION}.zip" haskell-language-server-* find . -type f ! -name '*.zip' -delete ;; tar.xz) - tar caf "${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}.${TARBALL_EXT}" haskell-language-server-* + tar caf "${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}-${HLS_VERSION}.tar.xz" haskell-language-server-* find . -type f ! -name '*.tar.xz' -delete ;; *) diff --git a/ChangeLog.md b/ChangeLog.md index 8acbd3339c..601a0f4755 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,6 @@ # Changelog for haskell-language-server -## 1.6.0 +## 1.6.0.0 Time for a new and exciting hls release: @@ -9,7 +9,7 @@ Time for a new and exciting hls release: - [Qualify imported names](https://haskell-language-server.readthedocs.io/en/latest/features.html#qualify-imported-names) thanks to @eddiemundo - New plugin to support [selection range](https://haskell-language-server.readthedocs.io/en/latest/features.html#selection-range) (aka double click text selection) thanks to @kokobd - Finally hls [supports *ghc 9.2.1*](https://github.com/haskell/haskell-language-server/issues/2179) - - Including core features and [many plugins](https://haskell-language-server.readthedocs.io/en/latest/supported-versions.html#plugins-support-by-ghc-version)) + - Including core features and [many plugins](https://haskell-language-server.readthedocs.io/en/latest/supported-versions.html#plugins-support-by-ghc-version) - Thanks to a great collective effort coordinated by @pepeiborra and with the help of @wz1000, @mpickering and @alanz among others - Hls now also [supports *ghc 9.0.2*](https://github.com/haskell/haskell-language-server/issues/297) with all plugins but the stylish-haskell formatter - Including the [wingman plugin](https://github.com/haskell/haskell-language-server/tree/master/plugins/hls-tactics-plugin) thanks to @isovector and @anka-213 diff --git a/docs/contributing/releases.md b/docs/contributing/releases.md index d426e4de3b..728cba90e0 100644 --- a/docs/contributing/releases.md +++ b/docs/contributing/releases.md @@ -43,12 +43,15 @@ and it is being used in nix environments. - [ ] bump up package versions following the [pvp specification](https://pvp.haskell.org/) if they are not already updated. You could use [policeman](https://github.com/kowainik/policeman) to help with this step. - [ ] create ${version}-hackage branch to trigger the hackage github workflow which will upload all changed packages to hackage as candidates +- [ ] for new plugins or packages, update hackage uploaders to add the author of the plugin/package and some hls maintainer(s) other than the owner of the hackage api key used to upload them (it has to be done by the owner of the api key, actually @pepeiborra) - [ ] check manually candidates in hackage - [ ] publish them definitely ### ghcup release - [ ] push the release tag to the [haskell-language-server gitlab repo](https://gitlab.haskell.org/haskell/haskell-language-server) to trigger the build of ghcup specific artifacts +- [ ] download specific artifacts [only available in the gitlab build](#haskell-gitlab-release-pipeline) and compute their sha256sum +- [ ] upload them to the github release and complete the SHA256SUMS file - [ ] change ghcup metadata to include the new release in - example pull request [here](https://github.com/haskell/ghcup-metadata/pull/11) @@ -124,20 +127,10 @@ It just kicks off a matrix of jobs varying across GHC versions and OSs, building the binaries with Cabal and extracting them from the dist-newstyle directory. The binaries are built with -O2. -One caveat is that we need to rename the binaries from -haskell-language-server/haskell-language-server-wrapper to hls/hls-wrapper due to -path length limitations on windows. But whenever we upload them to the release, -we make sure to upload them as their full name variant. - ### Failing workflow -If the workflow fail and all of some binaries has not been uploaded, -the prerelease and the tag itself has to be recreated to start it again. -If only some of the artefacts are missing, an alternative could be make -the release in a fork and upload manually them. - -If they are missing due to ci specific problems we can build the executable locally -and add it to the existing release. +If the workflow fail and some binaries has been already uploaded, +those artifacts must be removed and the build should be re-ran (the build tries to upload themm all and it fails if there is an existing artifact with the same name) ### Updating release artifacts @@ -171,7 +164,7 @@ The script will upload the tarballs as candidates, maintainers will have to chec The project is present in the haskell gitlab server: The main motivation is to leverage the ci infrastructure which includes architectures not included in the github ci. -The specific architectures only available through gitlab are: `armv7-linux`, `x86_64-freebsd`, `aarch64-darwin`, `aarch64-linux` +The specific architectures only available through gitlab are: `aarch64-darwin`, `aarch64-linux`, `armv7-linux`, `x86_64-freebsd12`, `x86_64-freebsd13`, `x86_64-linux-alpine` The gitlab pipeline uses the configuration file [.gitlab-ci.yml](https://github.com/haskell/haskell-language-server/blob/master/.gitlab-ci.yml) and the sh scripts in [.gitlab](https://github.com/haskell/haskell-language-server/tree/master/.gitlab) It is triggered by pushing a tag to the gitlab repo. diff --git a/docs/installation.md b/docs/installation.md index 38ccab5931..938f21c9ec 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,6 +1,7 @@ # Installation A typical haskell-language-server installation consists of: + - One binary file for each supported ghc version: `haskell-language-server-${ghcVersion}` - Another binary named `haskell-language-version-wrapper` which analyzes the project or file in the current working dir and calls the appropiate `haskell-language-server-${ghcVersion}` variant. @@ -15,6 +16,7 @@ A typical haskell-language-server installation consists of: ## ghcup If you are using [`ghcup`](https://www.haskell.org/ghcup/) to manage your installations, you can install `haskell-language-server` with + ```bash ghcup install hls ``` @@ -22,6 +24,7 @@ ghcup install hls You can check if HLS is available for your platorm via ghcup here: . You can also install HLS from source without checking out the code manually: + ```bash ghcup compile hls -v 1.4.0 8.10.7 ``` @@ -31,6 +34,7 @@ Check `ghcup compile hls --help` for a full list of compilation options. ## chocolatey If you are using [`chocolatey`](https://chocolatey.org/) to manage your installations in windows, [you can install `haskell-language-server`](https://community.chocolatey.org/packages/haskell-language-server) with + ```bash choco install haskell-language-server ```` @@ -79,8 +83,6 @@ pkg install hs-haskell-language-server to install it. At the moment, HLS installed this way only supports the same GHC version as the ports one. - - ## Installation from source ### Common pre-requirements diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index d4f29150e4..fa42040364 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -160,18 +160,40 @@ 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 +### Static binaries and template haskell support 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). 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 it locally. With `cabal` this can be done as follows: - cabal update && cabal install haskell-language-server --enable-executable-dynamic +```bash +cabal update && cabal install pkg:haskell-language-server --ghc-options="-dynamic" +``` + +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 --ghc-options="-dynamic" +``` + +With `stack` you also need add the ghc option `-dynamic`. -With `stack` you need to manually add the ghc option `-dynamic`. +```bash +stack install haskell-language-server --stack-yaml=stack-${ghcVersion}.yaml --ghc-options="-dynamic" +``` -Note: HLS binaries prior to 1.6.0 were statically linking `glibc` which is not a supported configuration and has been replaced by `musl`. +You also can leverage `ghcup compile hls`: + +```bash +ghcup compile hls -g master --ghc 8.10.7 -- --ghc-options="-dynamic" +``` + +as it uses cabal underneath you might need to use a specific cabal.project for some ghc versions: + +```bash +ghcup compile hls -g master --ghc 9.0.2 --project-file cabal-ghc90.project -- --ghc-options="-dynamic" +``` ### Preprocessors diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 870f64132e..a2a1debdda 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.0.0 +version: 1.6.1.0 synopsis: LSP server for GHC description: Please see the README on GitHub at diff --git a/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal b/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal index bf1a0905b6..6696a1d8c7 100644 --- a/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal +++ b/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal @@ -1,7 +1,7 @@ cabal-version: 2.4 category: Development name: hls-tactics-plugin -version: 1.6.0.0 +version: 1.6.1.0 synopsis: Wingman plugin for Haskell Language Server description: Please see the README on GitHub at