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

GHC 9.4 compatibility + Multiple Home Units #2994

Merged
merged 8 commits into from
Sep 1, 2022
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
2 changes: 1 addition & 1 deletion .github/actions/setup-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
cabal:
description: "Cabal version"
required: false
default: "3.6"
default: "3.8.1.0"
os:
description: "Operating system: Linux, Windows or macOS"
required: true
Expand Down
57 changes: 31 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ jobs:
strategy:
fail-fast: true
matrix:
ghc: [ "9.2.4"
ghc: [ "9.4.2"
, "9.4.1"
, "9.2.4"
, "9.2.3"
, "9.0.2"
, "8.10.7"
Expand All @@ -69,6 +71,9 @@ jobs:
]
include:
# only test supported ghc major versions
- os: ubuntu-latest
ghc: '9.4.2'
test: true
- os: ubuntu-latest
ghc: '9.2.4'
test: true
Expand Down Expand Up @@ -156,103 +161,103 @@ jobs:
HLS_WRAPPER_TEST_EXE: hls-wrapper
run: cabal test wrapper-test --test-options="$TEST_OPTS --rerun-log-file .tasty-rerun-log-wrapper" || cabal test wrapper-test --test-options="$TEST_OPTS --rerun-log-file .tasty-rerun-log-wrapper" || cabal test wrapper-test --test-options="$TEST_OPTS --rerun-log-file .tasty-rerun-log-wrapper"

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

- if: matrix.test
- if: matrix.test && matrix.ghc != '9.4.2'
name: Test hls-refactor-plugin
run: cabal test hls-refactor-plugin --test-options="$TEST_OPTS" || 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.4.2'
name: Test hls-floskell-plugin
run: cabal test hls-floskell-plugin --test-options="$TEST_OPTS" || 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"

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

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

- if: matrix.test
- if: matrix.test && matrix.ghc != '9.4.2'
name: Test hls-eval-plugin
run: cabal test hls-eval-plugin --test-options="$TEST_OPTS" || 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.4'
- if: matrix.test && matrix.ghc != '9.2.4' && matrix.ghc != '9.4.2'
name: Test hls-haddock-comments-plugin
run: cabal test hls-haddock-comments-plugin --test-options="$TEST_OPTS" || 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 && matrix.ghc != '9.2.4'
- if: matrix.test && matrix.ghc != '9.2.4' && matrix.ghc != '9.4.2'
name: Test hls-splice-plugin
run: cabal test hls-splice-plugin --test-options="$TEST_OPTS" || 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.4.2'
name: Test hls-stylish-haskell-plugin
run: cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || 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.4.2'
name: Test hls-ormolu-plugin
run: cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" || 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.4.2'
name: Test hls-fourmolu-plugin
run: cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || 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.4'
- if: matrix.test && matrix.ghc != '9.2.4' && matrix.ghc != '9.4.2'
name: Test hls-tactics-plugin test suite
run: cabal test hls-tactics-plugin --test-options="$TEST_OPTS" || 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"

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

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

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

- if: matrix.test && matrix.os != 'windows-latest'
- if: matrix.test && matrix.os != 'windows-latest' && matrix.ghc != '9.4.2'
name: Test hls-rename-plugin test suite
run: cabal test hls-rename-plugin --test-options="$TEST_OPTS" || 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.4.2'
name: Test hls-hlint-plugin test suite
run: cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || 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.1' && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.4'
- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.4' && matrix.ghc != '9.4.2'
name: Test hls-stan-plugin test suite
run: cabal test hls-stan-plugin --test-options="$TEST_OPTS" || 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-stan-plugin --test-options="$TEST_OPTS"

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

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

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

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

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

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

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

Expand Down
6 changes: 5 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ variables:
# Commit of ghc/ci-images repository from which to pull Docker images
DOCKER_REV: "4ed1a4f27828ba96a34662dc954335e29b470cd2"

CABAL_INSTALL_VERSION: 3.6.2.0
CABAL_INSTALL_VERSION: 3.8.1.0

.windows_matrix: &windows_matrix
matrix:
Expand All @@ -21,6 +21,10 @@ variables:
CABAL_PROJECT: cabal.project
- GHC_VERSION: 9.2.4
CABAL_PROJECT: cabal.project
- GHC_VERSION: 9.4.1
CABAL_PROJECT: cabal.project
- GHC_VERSION: 9.4.2
CABAL_PROJECT: cabal.project

workflow:
rules:
Expand Down
2 changes: 2 additions & 0 deletions bindist/ghcs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
9.0.2,cabal.project
9.2.3,cabal.project
9.2.4,cabal.project
9.4.1,cabal.project
9.4.2,cabal.project
2 changes: 2 additions & 0 deletions bindist/ghcs-Msys
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
9.0.2,cabal.project
9.2.3,cabal.project
9.2.4,cabal.project
9.4.1,cabal.project
9.4.2,cabal.project
13 changes: 13 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ source-repository-package
tag: 7a0af7a8fd38045fd15fb13445bdcc7085325460
-- https://github.com/tibbe/ekg-json/pull/12

source-repository-package
type:git
location: https://github.com/wz1000/hiedb
tag: 67b92df2359558091df9102db5b701327308b930

source-repository-package
type:git
location: https://github.com/wz1000/hie-bios
tag: aa73d3d2eb89df0003d2468a105e326d71b62cc7

-- Needed for ghcide-bench until a new release of lsp-test is out
source-repository-package
type:git
Expand All @@ -76,6 +86,9 @@ source-repository-package
-- https://github.com/haskell/lsp/pull/450

allow-newer:
base, ghc-prim, ghc-bignum, ghc, Cabal, binary, bytestring, unix, time, template-haskell,
ghc-paths:Cabal,

-- ghc-9.2
----------
hiedb:base,
Expand Down
42 changes: 42 additions & 0 deletions configuration-ghc-94.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ pkgs, inputs }:

let
disabledPlugins = [
"hls-hlint-plugin"
# 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"
];

hpkgsOverride = hself: hsuper:
with pkgs.haskell.lib;
{
hlsDisabledPlugins = disabledPlugins;
# YOLO
mkDerivation = args:
hsuper.mkDerivation (args // {
jailbreak = true;
doCheck = false;
});
} // (builtins.mapAttrs (_: drv: disableLibraryProfiling drv) {
# 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 { };

ghc-exactprint =
hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint-150 { };
# Hlint is still broken
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint { });

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

# Re-generate HLS drv excluding some plugins
haskell-language-server =
hself.callCabal2nixWithOptions "haskell-language-server" ./.
(pkgs.lib.concatStringsSep " " [ "-fpedantic" "-f-hlint" ]) { };
});
in {
inherit disabledPlugins;
tweakHpkgs = hpkgs: hpkgs.extend hpkgsOverride;
}
7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
hie-compat = ./hie-compat;
hls-plugin-api = ./hls-plugin-api;
hls-test-utils = ./hls-test-utils;
ghcide-test-utils = ./ghcide/test;
} // pluginSourceDirs;

# Tweak our packages
Expand Down Expand Up @@ -215,6 +216,7 @@

ghc902Config = (import ./configuration-ghc-90.nix) { inherit pkgs inputs; };
ghc924Config = (import ./configuration-ghc-92.nix) { inherit pkgs inputs; };
ghc941Config = (import ./configuration-ghc-94.nix) { inherit pkgs inputs; };

# GHC versions
# While HLS still works fine with 8.10 GHCs, we only support the versions that are cached
Expand All @@ -224,11 +226,13 @@
cases = {
ghc902 = ghc902Config.tweakHpkgs (pkgs.hlsHpkgs "ghc902");
ghc924 = ghc924Config.tweakHpkgs (pkgs.hlsHpkgs "ghc924");
ghc941 = ghc941Config.tweakHpkgs (pkgs.hlsHpkgs "ghc941");
};
in { default = cases."${ghcVersion}"; } // cases;

ghc902 = supportedGHCs.ghc902;
ghc924 = supportedGHCs.ghc924;
ghc941 = supportedGHCs.ghc941;
ghcDefault = supportedGHCs.default;

# For markdown support
Expand Down Expand Up @@ -361,19 +365,22 @@
haskell-language-server-dev = mkDevShell ghcDefault "cabal.project";
haskell-language-server-902-dev = mkDevShell ghc902 "cabal.project";
haskell-language-server-924-dev = mkDevShell ghc924 "cabal.project";
haskell-language-server-941-dev = mkDevShell ghc941 "cabal.project";
};

# Developement shell, haskell packages are also provided by nix
nixDevShells = {
haskell-language-server-dev-nix = mkDevShellWithNixDeps ghcDefault "cabal.project";
haskell-language-server-902-dev-nix = mkDevShellWithNixDeps ghc902 "cabal.project";
haskell-language-server-924-dev-nix = mkDevShellWithNixDeps ghc924 "cabal.project";
haskell-language-server-941-dev-nix = mkDevShellWithNixDeps ghc941 "cabal.project";
};

allPackages = {
haskell-language-server = mkExe ghcDefault;
haskell-language-server-902 = mkExe ghc902;
haskell-language-server-924 = mkExe ghc924;
haskell-language-server-941 = mkExe ghc941;
};

devShells = simpleDevShells // nixDevShells // {
Expand Down
3 changes: 2 additions & 1 deletion ghcide/ghcide.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ test-suite ghcide-tests
--------------------------------------------------------------
ghcide,
ghcide-test-utils-internal,
ghc-typelits-knownnat,
lsp,
lsp-types,
hls-plugin-api,
Expand Down Expand Up @@ -378,6 +377,8 @@ test-suite ghcide-tests
build-depends:
record-dot-preprocessor,
record-hasfield
if impl(ghc < 9.3)
build-depends: ghc-typelits-knownnat
hs-source-dirs: test/cabal test/exe bench/lib
ghc-options: -threaded -Wall -Wno-name-shadowing -O0 -Wno-unticked-promoted-constructors
main-is: Main.hs
Expand Down
Loading