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

chore!: Remove deprecated "ghc" argument #2297

Merged
merged 1 commit into from
Dec 18, 2024
Merged
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
30 changes: 11 additions & 19 deletions lib/call-cabal-project-to-nix.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, runCommand, cacert, index-state-hashes, haskellLib }:
{ pkgs, cacert, index-state-hashes, haskellLib }:
{ name ? src.name or null # optional name for better error messages
, src
, materialized-dir ? ../materialized
Expand All @@ -14,7 +14,6 @@
, cabalProjectFreeze ? null
, caller ? "callCabalProjectToNix" # Name of the calling function for better warning messages
, compilerSelection ? p: p.haskell-nix.compiler
, ghc ? null # Deprecated in favour of `compiler-nix-name`
, ghcOverride ? null # Used when we need to set ghc explicitly during bootstrapping
, configureArgs ? "" # Extra arguments to pass to `cabal v2-configure`.
# `--enable-tests --enable-benchmarks` are included by default.
Expand Down Expand Up @@ -74,29 +73,22 @@ let
nix-tools = if args.nix-tools or null != null
then args.nix-tools
else evalPackages.haskell-nix.nix-tools-unchecked;
forName = pkgs.lib.optionalString (name != null) (" for " + name);

nameAndSuffix = suffix: if name == null then suffix else name + "-" + suffix;

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

in let
ghc = if ghc' ? latestVersion
Expand Down
2 changes: 1 addition & 1 deletion overlays/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ final: prev: {
index-state-hashes = import indexStateHashesPath;
inherit (final.buildPackages.haskell-nix) haskellLib;
pkgs = final.buildPackages.pkgs;
inherit (final.buildPackages.pkgs) runCommand cacert;
inherit (final.buildPackages.pkgs) cacert;
};

# Loads a plan and filters the package directories using cleanSourceWith
Expand Down
Loading