Skip to content

Commit 618d266

Browse files
authored
chore!: Remove deprecated "ghc" argument (#2297)
1 parent 6b7d0eb commit 618d266

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

lib/call-cabal-project-to-nix.nix

+11-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ pkgs, runCommand, cacert, index-state-hashes, haskellLib }:
1+
{ pkgs, cacert, index-state-hashes, haskellLib }:
22
{ name ? src.name or null # optional name for better error messages
33
, src
44
, materialized-dir ? ../materialized
@@ -14,7 +14,6 @@
1414
, cabalProjectFreeze ? null
1515
, caller ? "callCabalProjectToNix" # Name of the calling function for better warning messages
1616
, compilerSelection ? p: p.haskell-nix.compiler
17-
, ghc ? null # Deprecated in favour of `compiler-nix-name`
1817
, ghcOverride ? null # Used when we need to set ghc explicitly during bootstrapping
1918
, configureArgs ? "" # Extra arguments to pass to `cabal v2-configure`.
2019
# `--enable-tests --enable-benchmarks` are included by default.
@@ -74,29 +73,22 @@ let
7473
nix-tools = if args.nix-tools or null != null
7574
then args.nix-tools
7675
else evalPackages.haskell-nix.nix-tools-unchecked;
77-
forName = pkgs.lib.optionalString (name != null) (" for " + name);
76+
7877
nameAndSuffix = suffix: if name == null then suffix else name + "-" + suffix;
7978

8079
ghc' =
8180
if ghcOverride != null
8281
then ghcOverride
8382
else
84-
if ghc != null
85-
then __trace ("WARNING: A `ghc` argument was passed" + forName
86-
+ " this has been deprecated in favour of `compiler-nix-name`. "
87-
+ "Using `ghc` will break cross compilation setups, as haskell.nix cannot "
88-
+ "pick the correct `ghc` package from the respective buildPackages. "
89-
+ "For example, use `compiler-nix-name = \"ghc865\";` for GHC 8.6.5.") ghc
90-
else
91-
# Do note that `pkgs = final.buildPackages` in the `overlays/haskell.nix`
92-
# call to this file. And thus `pkgs` here is the proper `buildPackages`
93-
# set and we do not need, nor should pick the compiler from another level
94-
# of `buildPackages`, lest we want to get confusing errors about the Win32
95-
# package.
96-
#
97-
# > The option `packages.Win32.package.identifier.name' is used but not defined.
98-
#
99-
(compilerSelection pkgs)."${compiler-nix-name}";
83+
# Do note that `pkgs = final.buildPackages` in the `overlays/haskell.nix`
84+
# call to this file. And thus `pkgs` here is the proper `buildPackages`
85+
# set and we do not need, nor should pick the compiler from another level
86+
# of `buildPackages`, lest we want to get confusing errors about the Win32
87+
# package.
88+
#
89+
# > The option `packages.Win32.package.identifier.name' is used but not defined.
90+
#
91+
(compilerSelection pkgs)."${compiler-nix-name}";
10092

10193
in let
10294
ghc = if ghc' ? latestVersion

overlays/haskell.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ final: prev: {
600600
index-state-hashes = import indexStateHashesPath;
601601
inherit (final.buildPackages.haskell-nix) haskellLib;
602602
pkgs = final.buildPackages.pkgs;
603-
inherit (final.buildPackages.pkgs) runCommand cacert;
603+
inherit (final.buildPackages.pkgs) cacert;
604604
};
605605

606606
# Loads a plan and filters the package directories using cleanSourceWith

0 commit comments

Comments
 (0)