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

Move warning logic into cabal-project.nix #2203

Merged
merged 11 commits into from
May 23, 2024
3 changes: 2 additions & 1 deletion compiler/ghc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ let
then "ghc928"
else "ghc962";
in
buildPackages.pinned-haskell-nix.tool compiler-nix-name "hadrian" {
buildPackages.haskell-nix.tool compiler-nix-name "hadrian" {
compilerSelection = p: p.haskell.compiler;
index-state = buildPackages.haskell-nix.internalHackageIndexState;
# Verions of hadrian that comes with 9.6 depends on `time`
Expand All @@ -261,6 +261,7 @@ let
then ../../materialized/${compiler-nix-name}/hadrian-ghc98
else ../../materialized/${compiler-nix-name}/hadrian-ghc99;
modules = [{
reinstallableLibGhc = false;
# Apply the patches in a way that does not require using something
# like `srcOnly`. The problem with `pkgs.srcOnly` was that it had to run
# on a platform at eval time.
Expand Down
4 changes: 3 additions & 1 deletion lib/call-cabal-project-to-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ let
(compilerSelection pkgs)."${compiler-nix-name}";

in let
ghc = ghc';
ghc = if ghc' ? latestVersion
then __trace "WARNING: ${ghc'.version} is out of date, consider using upgrading to ${ghc'.latestVersion}." ghc'
else ghc';
subDir' = src.origSubDir or "";
subDir = pkgs.lib.strings.removePrefix "/" subDir';

Expand Down
1 change: 0 additions & 1 deletion modules/cabal-project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ in {
type = str;
description = "The name of the ghc compiler to use eg. \"ghc884\"";
# Map short version names to the latest GHC version.
# TODO: perhaps combine this with the `latestVer` mapping in `overlays/boostrap.nix`.
apply = name: pkgs.haskell-nix.resolve-compiler-name name;
};
compilerSelection = mkOption {
Expand Down
Loading