Skip to content

Commit

Permalink
Try #1641:
Browse files Browse the repository at this point in the history
  • Loading branch information
iohk-bors[bot] authored Sep 5, 2022
2 parents cc0642c + 204296f commit 61e4c5b
Show file tree
Hide file tree
Showing 175 changed files with 17,076 additions and 8,284 deletions.
2 changes: 1 addition & 1 deletion builder/comp-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ let
(lib.concatMap (c: if c.isHaskell or false
then builtins.attrValues (c.components.exes or {})
else [c]) build-tools) ++
lib.optional (pkgconfig != []) buildPackages.pkgconfig;
lib.optional (pkgconfig != []) buildPackages.cabalPkgConfigWrapper;

# Unfortunately, we need to wrap ghc commands for cabal builds to
# work in the nix-shell. See ../doc/removing-with-package-wrapper.md.
Expand Down
2 changes: 1 addition & 1 deletion builder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let
# in the native case, it would be the same in the cross case however
# we *really* want to build the Setup.hs on the build machine and not
# have the stdenv confuse it with the target/host env.
inherit (buildPackages) stdenv pkgconfig;
inherit (buildPackages) stdenv;
inherit buildPackages;
inherit haskellLib nonReinstallablePkgs makeSetupConfigFiles;
};
Expand Down
2 changes: 1 addition & 1 deletion builder/hspkg-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let
||
# These are the dependencies of `Cabal`
!builtins.elem package.identifier.name
["nix-tools" "alex" "happy" "hscolour" "Cabal" "bytestring" "aeson" "time"
["nix-tools" "alex" "happy" "hscolour" "Cabal" "Cabal-syntax" "bytestring" "aeson" "time"
"filepath" "base-compat-batteries" "base-compat" "unix" "directory" "transformers"
"containers" "binary" "mtl" "text" "process" "parsec"];

Expand Down
4 changes: 2 additions & 2 deletions builder/setup-builder.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, stdenv, lib, buildPackages, haskellLib, ghc, nonReinstallablePkgs, hsPkgs, makeSetupConfigFiles, pkgconfig }@defaults:
{ pkgs, stdenv, lib, buildPackages, haskellLib, ghc, nonReinstallablePkgs, hsPkgs, makeSetupConfigFiles }@defaults:

let self =
{ component, package, name, src, enableDWARF ? false, flags ? {}, revision ? null, patches ? [], defaultSetupSrc
Expand Down Expand Up @@ -38,7 +38,7 @@ let
(lib.concatMap (c: if c.isHaskell or false
then builtins.attrValues (c.components.exes or {})
else [c]) component.build-tools) ++
lib.optional (component.pkgconfig != []) pkgconfig;
lib.optional (component.pkgconfig != []) buildPackages.cabalPkgConfigWrapper;

drv =
stdenv.mkDerivation ({
Expand Down
14 changes: 10 additions & 4 deletions lib/call-cabal-project-to-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ in
# any plutus-apps input being used for a
# package.
, evalPackages
, pkgconfigSelector ? (_: [])
, ...
}@args:

Expand Down Expand Up @@ -167,6 +168,8 @@ let

index-state-pinned = index-state != null || cabalProjectIndexState != null;

pkgconfPkgs = import ./pkgconf-nixpkgs-map.nix pkgs;

in
assert (if index-state-found == null
then throw "No index state passed and none found in ${cabalProjectFileName}" else true);
Expand Down Expand Up @@ -329,14 +332,14 @@ let
# when `checkMaterialization` is set.
dummy-ghc-data =
let
materialized = ../materialized/dummy-ghc + "/${ghc.targetPrefix}${ghc.name}-${pkgs.stdenv.buildPlatform.system}";
materialized = ../materialized/dummy-ghc + "/${ghc.targetPrefix}${ghc.name}-${pkgs.stdenv.buildPlatform.system}"
+ pkgs.lib.optionalString (builtins.compareVersions ghc.version "8.10" < 0 && ghc.targetPrefix == "" && builtins.compareVersions pkgs.lib.version "22.05" < 0) "-old";
in pkgs.haskell-nix.materialize ({
sha256 = null;
sha256Arg = "sha256";
materialized = if __pathExists materialized
then materialized
else __trace ("WARNING: No materialized dummy-ghc-data for "
+ "${ghc.targetPrefix}${ghc.name}-${pkgs.stdenv.buildPlatform.system}.")
else __trace "WARNING: No materialized dummy-ghc-data. mkdir ${toString materialized}"
null;
reasonNotSafe = null;
} // pkgs.lib.optionalAttrs (checkMaterialization != null) {
Expand Down Expand Up @@ -463,7 +466,10 @@ let
} // pkgs.lib.optionalAttrs (checkMaterialization != null) {
inherit checkMaterialization;
}) (evalPackages.runCommand (nameAndSuffix "plan-to-nix-pkgs") {
nativeBuildInputs = [ nix-tools dummy-ghc dummy-ghc-pkg cabal-install evalPackages.rsync evalPackages.gitMinimal ];
nativeBuildInputs = [ nix-tools dummy-ghc dummy-ghc-pkg cabal-install evalPackages.rsync evalPackages.gitMinimal evalPackages.pkgconfig ];
# We only need the `.dev` derivation (if there is one), since it will have
# the pkgconfig files needed by cabal.
buildInputs = map pkgs.lib.getDev (builtins.concatLists (pkgconfigSelector pkgconfPkgs));
# Needed or stack-to-nix will die on unicode inputs
LOCALE_ARCHIVE = pkgs.lib.optionalString (evalPackages.stdenv.buildPlatform.libc == "glibc") "${evalPackages.glibcLocales}/lib/locale/locale-archive";
LANG = "en_US.UTF-8";
Expand Down
4 changes: 2 additions & 2 deletions lib/ghcjs-project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
if (builtins.compareVersions ghcjsVersion "8.10.0.0" >= 0)
then pkgs.haskell-nix.tool compiler-nix-name "cabal" {
index-state = pkgs.haskell-nix.internalHackageIndexState;
version = "3.6.2.0";
version = "3.8.1.0";
materialized = ../materialized/ghcjs/cabal + "/${compiler-nix-name}";
}
else pkgs.haskell-nix.tool compiler-nix-name "cabal" {
Expand All @@ -48,7 +48,7 @@
# Cabal 3.2.1.0 no longer supports he mix of `cabal-version`,
# lack of `custom-setup` and `v1-install` used by ghcjs boot.
cabalProjectLocal = ''
constraints: Cabal <3.2.1.0
constraints: Cabal <3.2.1.0, Cabal-syntax <0
'';
materialized = ../materialized/ghcjs/cabal + "/${compiler-nix-name}";
}
Expand Down

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

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

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

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

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

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

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

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

Loading

0 comments on commit 61e4c5b

Please sign in to comment.