Unverified Commit 40ce16ef authored by maralorn's avatar maralorn
Browse files

haskell-language-server: Fix for all supported GHCs

parent 37282b51
Loading
Loading
Loading
Loading
+2 −25
Original line number Diff line number Diff line
@@ -96,11 +96,7 @@ self: super: {
  ### HASKELL-LANGUAGE-SERVER SECTION ###
  #######################################

  inherit (let
    hls_overlay = lself: lsuper: {
      ghc-lib-parser = lself.ghc-lib-parser_9_6_2_20230523;
      ghc-lib-parser-ex = doDistribute lself.ghc-lib-parser-ex_9_6_0_2;
      Cabal-syntax = lself.Cabal-syntax_3_10_1_0;
  haskell-language-server = dontCheck (super.haskell-language-server.overrideScope (lself: lsuper: {
    # For most ghc versions, we overrideScope Cabal in the configuration-ghc-???.nix,
    # because some packages, like ormolu, need a newer Cabal version.
    # ghc-paths is special because it depends on Cabal for building
@@ -111,26 +107,7 @@ self: super: {
    # otherwise we have different versions of ghc-paths
    # around which have the same abi-hash, which can lead to confusions and conflicts.
    ghc-paths = lsuper.ghc-paths.override { Cabal = null; };
  };
  in lib.mapAttrs (_: pkg: doDistribute (pkg.overrideScope hls_overlay)) {
    haskell-language-server = allowInconsistentDependencies (dontCheck super.haskell-language-server);
    # Tests fail due to the newly-build fourmolu not being in PATH
    # https://github.com/fourmolu/fourmolu/issues/231
    fourmolu = dontCheck super.fourmolu_0_14_0_0;
    ormolu = super.ormolu_0_7_2_0;
    hlint = super.hlint_3_6_1;
    stylish-haskell = super.stylish-haskell_0_14_5_0;
  })
    haskell-language-server
  # HLS from 2.3 needs at least formolu 0.14.
  # This means we need to bump a lot of other tools, too, because they all us ghc-lib-parser
  # We do this globally to prevent inconsistent formatting or lints between hls and the command line tools.
    fourmolu
    ormolu
    hlint
    stylish-haskell;

  fourmolu_0_13_1_0 = dontCheck super.fourmolu_0_13_1_0;
  }));

  # hasn't bumped upper bounds
  # test fails: "floskell-test: styles/base.md: openBinaryFile: does not exist (No such file or directory)"
+4 −7
Original line number Diff line number Diff line
@@ -76,9 +76,7 @@ self: super: {
    Cabal-syntax = self.Cabal-syntax_3_8_1_0;
  };

  fourmolu = self.fourmolu_0_10_1_0.override {
    Cabal-syntax = self.Cabal-syntax_3_8_1_0;
  };
  stylish-haskell = doJailbreak super.stylish-haskell_0_14_4_0;

  doctest = dontCheck super.doctest;
  # Apply patches from head.hackage.
@@ -91,16 +89,15 @@ self: super: {
    # These aren't included in hackage-packages.nix because hackage2nix is configured for GHC 9.2, under which these plugins aren't supported.
    # See https://github.com/NixOS/nixpkgs/pull/205902 for why we use `self.<package>.scope`
    additionalDeps = with self.haskell-language-server.scope; [
      hls-haddock-comments-plugin
      (unmarkBroken hls-splice-plugin)
      hls-tactics-plugin
    ];
  in addBuildDepends additionalDeps (super.haskell-language-server.overrideScope (lself: lsuper: {
  in addBuildDepends additionalDeps (disableCabalFlag "fourmolu" (super.haskell-language-server.overrideScope (lself: lsuper: {
    # Needed for modern ormolu and fourmolu.
    # Apply this here and not in common, because other ghc versions offer different Cabal versions.
    Cabal = lself.Cabal_3_6_3_0;
    hls-overloaded-record-dot-plugin = null;
  }));
    hls-fourmolu-plugin = null;
  })));

  # Needs to use ghc-lib due to incompatible GHC
  ghc-tags = doDistribute (addBuildDepend self.ghc-lib self.ghc-tags_1_5);
+2 −3
Original line number Diff line number Diff line
@@ -71,10 +71,9 @@ self: super: {
    Cabal-syntax = self.Cabal-syntax_3_8_1_0;
  };

  fourmolu = self.fourmolu_0_10_1_0.override {
    Cabal-syntax = self.Cabal-syntax_3_8_1_0;
  };
  stylish-haskell = doJailbreak super.stylish-haskell_0_14_4_0;

  haskell-language-server = disableCabalFlag "fourmolu" (super.haskell-language-server.override { hls-fourmolu-plugin = null; });
  # For GHC < 9.4, some packages need data-array-byte as an extra dependency
  hashable = addBuildDepends [ self.data-array-byte ] super.hashable;
  primitive = addBuildDepends [ self.data-array-byte ] super.primitive;
+28 −3
Original line number Diff line number Diff line
@@ -111,7 +111,32 @@ in {
  # https://github.com/kowainik/relude/issues/436
  relude = dontCheck super.relude;

  fourmolu = overrideCabal (drv: {
    libraryHaskellDepends = drv.libraryHaskellDepends ++ [ self.file-embed ];
  }) (disableCabalFlag "fixity-th" super.fourmolu);
  inherit
    (
      let
        hls_overlay = lself: lsuper: {
          ghc-lib-parser = lself.ghc-lib-parser_9_6_2_20230523;
          ghc-lib-parser-ex = doDistribute lself.ghc-lib-parser-ex_9_6_0_2;
          Cabal-syntax = lself.Cabal-syntax_3_10_1_0;
        };
      in
      lib.mapAttrs (_: pkg: doDistribute (pkg.overrideScope hls_overlay)) {
        haskell-language-server = allowInconsistentDependencies super.haskell-language-server;
        # Tests fail due to the newly-build fourmolu not being in PATH
        # https://github.com/fourmolu/fourmolu/issues/231
        fourmolu = dontCheck super.fourmolu_0_14_0_0;
        ormolu = self.generateOptparseApplicativeCompletions [ "ormolu" ] (enableSeparateBinOutput super.ormolu_0_7_2_0);
        hlint = super.hlint_3_6_1;
        stylish-haskell = super.stylish-haskell;
      }
    )
    haskell-language-server
    # HLS from 2.3 needs at least formolu 0.14.
    # This means we need to bump a lot of other tools, too, because they all us ghc-lib-parser
    # We do this globally to prevent inconsistent formatting or lints between hls and the command line tools.
    fourmolu
    ormolu
    hlint
    stylish-haskell
  ;
}
+6 −6
Original line number Diff line number Diff line
@@ -91,6 +91,12 @@ self: super: {
  ghc-lib-parser = doDistribute self.ghc-lib-parser_9_6_2_20230523;
  ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_6_0_2;

  # Tests fail due to the newly-build fourmolu not being in PATH
  # https://github.com/fourmolu/fourmolu/issues/231
  fourmolu = dontCheck super.fourmolu_0_14_0_0;
  ormolu = self.generateOptparseApplicativeCompletions [ "ormolu" ] (enableSeparateBinOutput super.ormolu_0_7_2_0);
  hlint = super.hlint_3_6_1;

  # v0.1.6 forbids base >= 4.18
  singleton-bool = doDistribute super.singleton-bool_0_1_7;

@@ -166,10 +172,6 @@ self: super: {
      hls-floskell-plugin = null;
    };

  fourmolu = super.fourmolu_0_14_0_0;
  ormolu = self.generateOptparseApplicativeCompletions [ "ormolu" ] (enableSeparateBinOutput super.ormolu_0_7_2_0);
  stylish-haskell = super.stylish-haskell_0_14_5_0;

  # Newer version of servant required for GHC 9.6
  servant = self.servant_0_20_1;
  servant-server = self.servant-server_0_20;
@@ -205,8 +207,6 @@ self: super: {
   HUnit Diff data-default extra fail free ghc-paths ordered-containers silently syb
  ]) super.ghc-exactprint_1_7_0_1);

  hlint = super.hlint_3_6_1;

  inherit (pkgs.lib.mapAttrs (_: doJailbreak ) super)
    hls-cabal-plugin
    algebraic-graphs
Loading