Skip to content

Commit 98830ce

Browse files
Move warning logic into cabal-project.nix (#2203)
* Move warning logic into cabal-project.nix This also adds `old-compiler-warning` project argument we can use to switch off the warning when building hadrian. We build hadrian with ghc 9.6.2 from nixpkgs because 9.6.5 may not be present in nixpkgs. * Fix ci * ifdLevel 2 * ifdLevel 3 * Better fix * Update overlays/bootstrap.nix Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Keep nix 2.4 fix * Fix warning for llvm compilers * Fix warning for llvm compilers --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 4d607f7 commit 98830ce

File tree

5 files changed

+51
-55
lines changed

5 files changed

+51
-55
lines changed

Diff for: compiler/ghc/default.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ let
253253
then "ghc928"
254254
else "ghc962";
255255
in
256-
buildPackages.pinned-haskell-nix.tool compiler-nix-name "hadrian" {
256+
buildPackages.haskell-nix.tool compiler-nix-name "hadrian" {
257257
compilerSelection = p: p.haskell.compiler;
258258
index-state = buildPackages.haskell-nix.internalHackageIndexState;
259259
# Verions of hadrian that comes with 9.6 depends on `time`
@@ -268,6 +268,7 @@ let
268268
then ../../materialized/${compiler-nix-name}/hadrian-ghc98
269269
else ../../materialized/${compiler-nix-name}/hadrian-ghc99;
270270
modules = [{
271+
reinstallableLibGhc = false;
271272
# Apply the patches in a way that does not require using something
272273
# like `srcOnly`. The problem with `pkgs.srcOnly` was that it had to run
273274
# on a platform at eval time.

Diff for: lib/call-cabal-project-to-nix.nix

+3-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ let
9999
(compilerSelection pkgs)."${compiler-nix-name}";
100100

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

Diff for: modules/cabal-project.nix

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ in {
1818
type = str;
1919
description = "The name of the ghc compiler to use eg. \"ghc884\"";
2020
# Map short version names to the latest GHC version.
21-
# TODO: perhaps combine this with the `latestVer` mapping in `overlays/boostrap.nix`.
2221
apply = name: pkgs.haskell-nix.resolve-compiler-name name;
2322
};
2423
compilerSelection = mkOption {

0 commit comments

Comments
 (0)