Skip to content

9.6 support for HLS #3480

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

Merged
merged 9 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/setup-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ runs:
- name: Workaround runner image issue
if: runner.os == 'Linux'
# https://github.com/actions/runner-images/issues/7061
run: |
run: |
sudo mkdir -p /usr/local/.ghcup
sudo chown -R $USER /usr/local/.ghcup
shell: bash

- uses: haskell/actions/setup@v2.3.5
- uses: haskell/actions/setup@v2.3.6
id: HaskEnvSetup
with:
ghc-version : ${{ inputs.ghc }}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ jobs:

steps:
- uses: actions/checkout@v3
with:

# By default, the `pull_request` event has a `GITHUB_SHA` env variable
# set to the "last merge commit on the GITHUB_REF branch" (see
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request).
# But we want to check out the latest commit on the branch whether or
# not it is a merge commit, so this is how we do that.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by this. Is this pervasively wrong with everyone using these workflows? Do you have a reference?

ref: "${{ github.event.pull_request.head.sha }}"

- run: git fetch origin master # check the master branch for benchmarking

Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/flags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ jobs:

steps:
- uses: actions/checkout@v3
with:

# By default, the `pull_request` event has a `GITHUB_SHA` env variable
# set to the "last merge commit on the GITHUB_REF branch" (see
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request).
# But we want to check out the latest commit on the branch whether or
# not it is a merge commit, so this is how we do that.
ref: "${{ github.event.pull_request.head.sha }}"

- uses: ./.github/actions/setup-build
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
# We only build nix dev shell for current GHC version because some are
# failing with different GHC version on darwin.
- name: Build development shell with nix dependencies for current GHC version
run: nix develop --print-build-logs .#haskell-language-server-dev-nix --profile dev
run: nix develop --print-build-logs .#all-nix-dev-shells --profile dev
- name: Push development shell
if: ${{ env.HAS_TOKEN == 'true' }}
run: cachix push haskell-language-server dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/supported-ghc-versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ "9.4.4" , "9.2.5" , "9.0.2" , "8.10.7" ]
[ "9.6.1", "9.4.4" , "9.2.5" , "9.0.2" , "8.10.7" ]
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
name: Test hls-refactor-plugin
run: cabal test hls-refactor-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-refactor-plugin --test-options="$TEST_OPTS"

- if: matrix.test
- if: matrix.test && matrix.ghc != '9.6.1'
name: Test hls-floskell-plugin
run: cabal test hls-floskell-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-floskell-plugin --test-options="$TEST_OPTS"

Expand All @@ -152,27 +152,27 @@ jobs:
name: Test hls-eval-plugin
run: cabal test hls-eval-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-eval-plugin --test-options="$TEST_OPTS"

- if: matrix.test && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4'
- if: matrix.test && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4' && matrix.ghc != '9.6.1'
name: Test hls-haddock-comments-plugin
run: cabal test hls-haddock-comments-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-haddock-comments-plugin --test-options="$TEST_OPTS"

- if: matrix.test
name: Test hls-splice-plugin
run: cabal test hls-splice-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-splice-plugin --test-options="$TEST_OPTS"

- if: matrix.test
- if: matrix.test && matrix.ghc != '9.6.1'
name: Test hls-stylish-haskell-plugin
run: cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS"

- if: matrix.test
- if: matrix.test && matrix.ghc != '9.6.1'
name: Test hls-ormolu-plugin
run: cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-ormolu-plugin --test-options="$TEST_OPTS"

- if: matrix.test
- if: matrix.test && matrix.ghc != '9.6.1'
name: Test hls-fourmolu-plugin
run: cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS"

- if: matrix.test && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4'
- if: matrix.test && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4' && matrix.ghc != '9.6.1'
name: Test hls-tactics-plugin test suite
run: cabal test hls-tactics-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-tactics-plugin --test-options="$TEST_OPTS"

Expand All @@ -192,11 +192,11 @@ jobs:
name: Test hls-rename-plugin test suite
run: cabal test hls-rename-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-rename-plugin --test-options="$TEST_OPTS"

- if: matrix.test
- if: matrix.test && matrix.ghc != '9.6.1'
name: Test hls-hlint-plugin test suite
run: cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-hlint-plugin --test-options="$TEST_OPTS"

- if: matrix.test && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4'
- if: matrix.test && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4' && matrix.ghc != '9.6.1'
name: Test hls-stan-plugin test suite
run: cabal test hls-stan-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-stan-plugin --test-options="$TEST_OPTS"

Expand Down
41 changes: 36 additions & 5 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,26 @@ packages:
-- See https://github.com/haskell/haskell-language-server/blob/master/.gitlab-ci.yml
optional-packages: vendored/*/*.cabal

tests: true
tests: True

-- mfsolve has duplicate instances in its test suite
-- See: https://github.com/kuribas/mfsolve/issues/8
package mfsolve
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by this. tests: True shouldn't mean that cabal builds the tests for library dependencies. Why is this needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, maybe a cabal bug?

tests: False

if impl(ghc >= 9.5)
source-repository-package
type:git
location: https://github.com/wz1000/retrie
tag: 0a2dbfc00e745737f249f16325b2815d2e3a14eb

package *
ghc-options: -haddock
test-show-details: direct

write-ghc-environment-files: never

index-state: 2023-03-15T00:00:00Z
index-state: 2023-03-23T00:00:00Z

constraints:
-- For GHC 9.4, older versions of entropy fail to build on Windows
Expand All @@ -67,8 +78,9 @@ constraints:
ghc-lib-parser-ex -auto,
stylish-haskell +ghc-lib,
fourmolu -fixity-th,
-- http2 doesn't build with -haddock on ghc-8.10
http2 < 4.0.0
setup.happy == 1.20.1.1,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why aren't these constraints in the conditional block? comments? can we put the 9.4 constraints in a conditional block also?

happy == 1.20.1.1,
filepath installed,

-- This is benign and won't affect our ability to release to Hackage,
-- because we only depend on `ekg-json` when a non-default flag
Expand All @@ -81,7 +93,6 @@ source-repository-package
type:git
location: https://github.com/pepeiborra/ekg-json
tag: 7a0af7a8fd38045fd15fb13445bdcc7085325460
-- https://github.com/tibbe/ekg-json/pull/12
-- END DELETE

allow-newer:
Expand All @@ -107,3 +118,23 @@ allow-newer:
uuid:time,
vector-space:base,
ekg-wai:time,

if impl(ghc >= 9.5)
allow-newer:
-- ghc-9.6
algebraic-graphs:transformers,
cryptohash-md5:base,
cryptohash-sha1:base,
ekg-core:ghc-prim,
focus:transformers,
ghc-trace-events:base,
implicit-hie-cradle:transformers,
retrie:base,
retrie:ghc,
retrie:ghc-exactprint,
retrie:mtl,
retrie:transformers,
semigroupoids:base,
stm-hamt:transformers,
entropy:Cabal,

58 changes: 58 additions & 0 deletions configuration-ghc-96.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{ pkgs, inputs }:

let
disabledPlugins = [
# That one is not technically a plugin, but by putting it in this list, we
# get it removed from the top level list of requirement and it is not pull
# in the nix shell.
"shake-bench"
"hls-retrie-plugin"
"hls-splice-plugin"
"hls-class-plugin"
"hls-rename-plugin"
"hls-gadt-plugin"
"hls-refactor-plugin"
];

hpkgsOverride = hself: hsuper:
with pkgs.haskell.lib;
{
hlsDisabledPlugins = disabledPlugins;

# Override for all derivation
# If they are considered as broken, we just disable jailbreak and hope for the best
mkDerivation = args:
hsuper.mkDerivation (args //
{
jailbreak = true;
broken = false;
doCheck = false;
});
apply-refact = hsuper.apply-refact_0_12_0_0;
tagged = hself.callHackage "tagged" "0.8.7" { };
primitive = hself.callHackage "primitive" "0.8.0.0" { };
unix-compat = hself.callCabal2nix "unix-compat" inputs.haskell-unix-compat { };
MonadRandom = hself.callHackage "MonadRandom" "0.6" { };
hiedb = hself.callCabal2nix "hiedb" inputs.haskell-hiedb { };
hie-bios = hself.callCabal2nix "hie-bios" inputs.haskell-hie-bios { };
ghc-exactprint = hself.callCabal2nix "ghc-exactprint" inputs.haskell-ghc-exactprint { };

# ptr-poker breaks on MacOS without SSE2 optimizations
# https://github.com/nikita-volkov/ptr-poker/issues/11
ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { };

ormolu = hself.ormolu_0_5_3_0;

stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib";

# Re-generate HLS drv excluding some plugins
haskell-language-server =
hself.callCabal2nixWithOptions "haskell-language-server" ./.
# Pedantic cannot be used due to -Werror=unused-top-binds
# Check must be disabled due to some missing required files
(pkgs.lib.concatStringsSep " " [ "--no-check" "-f-pedantic" "-f-hlint" "-f-refactor" "-f-retrie" "-f-class" "-f-gadt" "-f-splice" "-f-rename" ]) { };
};
in {
inherit disabledPlugins;
tweakHpkgs = hpkgs: hpkgs.extend hpkgsOverride;
}
90 changes: 80 additions & 10 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading