Skip to content

nix: no more yolo on ghc 9.4; test suites generally work! #3373

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

Closed
wants to merge 6 commits into from
Closed
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
13 changes: 5 additions & 8 deletions configuration-ghc-94.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,14 @@ let
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 { };

# Freezes in test for some reason.
ghc-exactprint =
hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint-160 { };
dontCheck (hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint-160 { });
# Hlint is still broken
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint { });

Expand All @@ -34,7 +29,9 @@ let
# Re-generate HLS drv excluding some plugins
haskell-language-server =
hself.callCabal2nixWithOptions "haskell-language-server" ./.
(pkgs.lib.concatStringsSep " " [ "-fpedantic" "-f-hlint" ]) { };
# 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" ]) { };
});
in {
inherit disabledPlugins;
Expand Down
18 changes: 0 additions & 18 deletions flake.lock

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

41 changes: 18 additions & 23 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@
flake = false;
};

# cabal hashes contains all the version for different haskell packages, to update:
# nix flake lock --update-input all-cabal-hashes-unpacked
all-cabal-hashes-unpacked = {
url = "github:commercialhaskell/all-cabal-hashes/current-hackage";
flake = false;
};

# List of hackage dependencies
ghc-exactprint-160 = {
url = "https://hackage.haskell.org/package/ghc-exactprint-1.6.1/ghc-exactprint-1.6.1.tar.gz";
Expand Down Expand Up @@ -61,7 +54,7 @@
};
};
outputs =
inputs@{ self, nixpkgs, flake-compat, flake-utils, gitignore, all-cabal-hashes-unpacked, ... }:
inputs@{ self, nixpkgs, flake-compat, flake-utils, gitignore, ... }:
{
overlays.default = final: prev:
with prev;
Expand Down Expand Up @@ -121,7 +114,10 @@
with haskell.lib; {
# Patches don't apply
github = overrideCabal hsuper.github (drv: { patches = []; });
hiedb = hsuper.callCabal2nix "hiedb" inputs.hiedb {};
# Tests are broken on 9.2 and 9.4, and we wind up bypassing the
# nixpkgs fixes to the test suite by doing this override. So just
# turn it off.
hiedb = haskell.lib.dontCheck (hsuper.callCabal2nix "hiedb" inputs.hiedb {});

# https://github.com/NixOS/nixpkgs/issues/140774
ormolu =
Expand All @@ -142,29 +138,28 @@
builtins.mapAttrs (_: haskell.lib.dontCheck)
(overlay hself hsuper);

extended = hpkgs: hpkgs.override (old: {
applyHaskellOverlays = overlays: hpkgs: hpkgs.override (old: {
overrides =
lib.fold
lib.composeExtensions
(old.overrides or (_: _: { }))
[ haskellOverrides
(dontCheck (haskell.lib.packageSourceOverrides hlsSources))
tweaks
];
overlays;
});

extended = forHlsCI:
applyHaskellOverlays
(prev.lib.optional forHlsCI haskellOverrides
++ [ (dontCheck (haskell.lib.packageSourceOverrides hlsSources))
tweaks
]
);
in {
inherit hlsSources;

all-cabal-hashes = prev.runCommand "all-cabal-hashes.tar.gz"
{ }
''
cd ${all-cabal-hashes-unpacked}
cd ..
tar czf $out $(basename ${all-cabal-hashes-unpacked})
'';

# Haskell packages extended with our packages
hlsHpkgs = compiler: extended haskell.packages.${compiler};
hlsHpkgs = compiler: extended true haskell.packages.${compiler};
# Haskell packages extended with our packages; reusing the nixpkgs set as much as possible
hlsHpkgsNixpkgs = compiler: extended false haskell.packages.${compiler};

# Support of GenChangelogs.hs
gen-hls-changelogs = hpkgs:
Expand Down
3 changes: 1 addition & 2 deletions plugins/hls-cabal-plugin/hls-cabal-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ library
-- automatically, forcing us to manually update the packages revision id.
-- This is a lot of work for almost zero benefit, so we just allow more versions here
-- and we eventually completely drop support for building HLS with stack.
, Cabal ^>=3.2 || ^>=3.4 || ^>=3.6 || ^>= 3.8
, Cabal-syntax ^>= 3.6
, Cabal-syntax ^>= 3.6 || ^>= 3.8
, deepseq
, directory
, extra >=1.7.4
Expand Down