Skip to content

Remove some obsolete hackage-quirks #1813

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 3 commits into from
Jan 24, 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
2 changes: 1 addition & 1 deletion build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ in rec {
hls-latest = tool compiler-nix-name "haskell-language-server" {
inherit evalPackages;
version =
if __compareVersions haskell.compiler.${compiler-nix-name}.version "9.4" < 0
if __compareVersions haskell.compiler.${compiler-nix-name}.version "9.0" < 0
then "1.8.0.0"
else "latest";
};
Expand Down
23 changes: 10 additions & 13 deletions modules/hackage-quirks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,34 +41,31 @@ in [
}
)

# TODO remove this when `dependent-sum-0.7.1.0` constraint on `some` has been updated.
# See https://github.com/haskell/haskell-language-server/issues/2969
# and https://github.com/obsidiansystems/dependent-sum/issues/71
({config, lib, pkgs, ...}:
{ _file = "haskell.nix/overlays/hackage-quirks.nix#haskell-language-server"; } //
lib.mkIf (config.name == "haskell-language-server") {
# TODO remove this when `dependent-sum-0.7.1.0` constraint on `some` has been updated.
# See https://github.com/haskell/haskell-language-server/issues/2969
# and https://github.com/obsidiansystems/dependent-sum/issues/71
cabalProject = lib.mkDefault (''
packages: .
constraints: dependent-sum >=0.7.1.0
''
# TODO remove once these two plugins have been updated in hackage
# TODO remove once these the plugins have been updated in hackage
+ lib.optionalString (config.version == "1.8.0.0") ''
package haskell-language-server
flags: -qualifyimportednames -stylishhaskell${lib.optionalString (config.compiler-nix-name != "ghc902") " -hlint"}
flags: -qualifyimportednames${
# Stylish haskell is broken for GHC 9.2
lib.optionalString (__elem config.compiler-nix-name ["ghc921" "ghc922" "ghc923" "ghc924" "ghc925"]) " -stylishhaskell"
# Hlint with this HLS only compiles for GHC 9.0
+ lib.optionalString (!__elem config.compiler-nix-name ["ghc901" "ghc902"]) " -hlint"
}
constraints: hls-fourmolu-plugin <1.1.1.0, hls-rename-plugin <1.0.2.0, hls-stan-plugin <1.0.1.0
''
+ lib.optionalString (config.version == "1.9.0.0") ''
allow-newer: hls-call-hierarchy-plugin:ghcide, hls-call-hierarchy-plugin:hls-plugin-api
''
# TODO Remove this flag once the hls-haddock-comments-plugin is updated in hackage to work with ghc 9.2
+ lib.optionalString (__elem config.compiler-nix-name ["ghc921" "ghc922" "ghc923" "ghc924" "ghc925"]) ''
package haskell-language-server
flags: -haddockcomments
''
# Exclude `retrie` that does not actually work with older versions of GHC.
# TODO Remove this once https://github.com/facebookincubator/retrie/pull/51 is fixed somehow
+ lib.optionalString (__elem config.compiler-nix-name ["ghc865" "ghc884" "ghc8105" "ghc8106" "ghc8107" "ghc901" "ghc902"]) ''
constraints: retrie <1.2.1
'');
}
)
Expand Down
2 changes: 1 addition & 1 deletion test/haskell-language-server/cabal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let
inherit (haskell-nix.tool compiler-nix-name "haskell-language-server" {
version =
if __compareVersions haskell-nix.compiler.${compiler-nix-name}.version "9.4" < 0
if __compareVersions haskell-nix.compiler.${compiler-nix-name}.version "9.0" < 0
then "1.8.0.0"
else "latest";
inherit evalPackages; }) project;
Expand Down