From 3a842c3f38294f7a176b8ddfc713cac6ea61467c Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Wed, 3 Dec 2025 00:49:03 +1300 Subject: [PATCH 1/2] Fix nixpkgs warnings --- build.nix | 6 +++--- builder/hspkg-builder.nix | 2 +- ci.nix | 4 ++-- lib/default.nix | 8 ++++---- modules/install-plan/redirect.nix | 2 +- modules/project-common.nix | 4 ++-- nix-tools/flake.nix | 8 ++++---- nix-tools/static/project.nix | 2 +- nix-tools/static/zipped.nix | 14 +++++++------- overlays/armv6l-linux.nix | 8 ++++---- overlays/default.nix | 6 +++--- overlays/haskell.nix | 6 +++--- package-set.nix | 2 +- test/annotations/default.nix | 4 ++-- test/buildable/default.nix | 4 ++-- test/c-ffi/default.nix | 4 ++-- test/ca-derivations-include/default.nix | 4 ++-- test/ca-derivations/default.nix | 4 ++-- test/cabal-22/default.nix | 4 ++-- test/cabal-doctests/default.nix | 4 ++-- test/cabal-hpack/default.nix | 4 ++-- test/cabal-project-nix-path/default.nix | 4 ++-- test/cabal-simple-debug/default.nix | 4 ++-- test/cabal-simple-prof/default.nix | 4 ++-- test/cabal-simple/default.nix | 4 ++-- test/cabal-source-repo-comments/default.nix | 4 ++-- test/cabal-source-repo/default.nix | 4 ++-- test/cabal-sublib/default.nix | 4 ++-- test/call-cabal-project-to-nix/default.nix | 4 ++-- test/call-stack-to-nix/default.nix | 4 ++-- test/coverage-golden/default.nix | 4 ++-- test/coverage-no-libs/default.nix | 4 ++-- test/coverage/default.nix | 4 ++-- test/default.nix | 6 +++--- test/exe-dlls/default.nix | 4 ++-- test/exe-lib-dlls/default.nix | 4 ++-- test/exe-only/default.nix | 4 ++-- test/external-static-plugin/default.nix | 4 ++-- test/extra-hackage/default.nix | 4 ++-- test/fully-static/default.nix | 3 +-- test/ghc-options/cabal.nix | 4 ++-- test/ghc-options/stack.nix | 4 ++-- test/ghcjs-overlay/default.nix | 4 ++-- test/gi-gtk/default.nix | 4 ++-- test/githash/default.nix | 4 ++-- test/haskell-language-server/cabal.nix | 4 ++-- test/haskell-language-server/stack.nix | 4 ++-- test/js-template-haskell/default.nix | 4 ++-- test/literate-haskell/default.nix | 4 ++-- test/plugin/default.nix | 4 ++-- test/project-flags/cabal.nix | 4 ++-- test/project-flags/stack.nix | 4 ++-- test/setup-deps/default.nix | 2 +- test/sha256map/default.nix | 2 +- test/shell-for-setup-deps/default.nix | 4 ++-- test/shell-for/default.nix | 4 ++-- test/snapshots/default.nix | 4 ++-- test/stack-compiler/default.nix | 4 ++-- test/stack-local-resolver-subdir/default.nix | 4 ++-- test/stack-local-resolver/default.nix | 4 ++-- test/stack-remote-resolver/default.nix | 4 ++-- test/stack-simple/default.nix | 2 +- test/stack-source-repo/default.nix | 4 ++-- test/sublib-docs/default.nix | 4 ++-- test/supported-langauges/default.nix | 4 ++-- test/test-only/default.nix | 4 ++-- test/th-dlls-minimal/default.nix | 4 ++-- test/th-dlls/default.nix | 4 ++-- test/with-packages/default.nix | 4 ++-- 69 files changed, 145 insertions(+), 146 deletions(-) diff --git a/build.nix b/build.nix index f52fdcb9f7..086913559e 100644 --- a/build.nix +++ b/build.nix @@ -20,7 +20,7 @@ in rec { tests = import ./test/default.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name; }; tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) ( - pkgs.recurseIntoAttrs ({ + pkgs.lib.recurseIntoAttrs ({ cabal-latest = tool compiler-nix-name "cabal" ({ inherit evalPackages; } // pkgs.lib.optionalAttrs (ghcFromTo "9.13" "9.14") { @@ -100,8 +100,8 @@ in rec { # These are pure parts of maintainer-script so they can be built by hydra # and added to the cache to speed up buildkite. - maintainer-script-cache = pkgs.recurseIntoAttrs ( - (pkgs.lib.optionalAttrs (pkgs.system == "x86_64-linux") { + maintainer-script-cache = pkgs.lib.recurseIntoAttrs ( + (pkgs.lib.optionalAttrs (pkgs.stdenv.hostPlatform.system == "x86_64-linux") { inherit (maintainer-scripts) check-hydra; }) // (pkgs.lib.optionalAttrs (ifdLevel > 2) { diff --git a/builder/hspkg-builder.nix b/builder/hspkg-builder.nix index 7a24ebea2f..0288f78012 100644 --- a/builder/hspkg-builder.nix +++ b/builder/hspkg-builder.nix @@ -62,7 +62,7 @@ let in rec { components = haskellLib.applyComponents (buildComp pkg.allComponent) pkg; - checks = pkgs.recurseIntoAttrs (builtins.mapAttrs + checks = pkgs.lib.recurseIntoAttrs (builtins.mapAttrs (_: d: haskellLib.check d) (lib.filterAttrs (_: d: d.config.doCheck) components.tests)); inherit (package) identifier detailLevel isLocal isProject buildType; diff --git a/ci.nix b/ci.nix index 706ea92613..0d5f5b3bac 100644 --- a/ci.nix +++ b/ci.nix @@ -134,7 +134,7 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: pinnedNixpkgsSrc: in filterAttrsOnlyRecursive (_: v: platformFilter v && !(isDisabled v)) ({ # Native builds # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native? - native = pkgs.recurseIntoAttrs ({ + native = pkgs.lib.recurseIntoAttrs ({ roots = pkgs.haskell-nix.roots' { inherit compiler-nix-name evalPackages; } ifdLevel; } // pkgs.lib.optionalAttrs runTests { inherit (build) tests tools maintainer-scripts maintainer-script-cache; @@ -156,7 +156,7 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: pinnedNixpkgsSrc: then import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; }) else crossSystem (import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; })); build = import ./build.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name haskellNix; }; - in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) ({ + in pkgs.lib.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) ({ roots = pkgs.haskell-nix.roots' { inherit compiler-nix-name evalPackages; } ifdLevel // { ghc = pkgs.buildPackages.haskell-nix.compiler.${compiler-nix-name}.override { ghcEvalPackages = evalPackages; }; }; diff --git a/lib/default.nix b/lib/default.nix index f9d7269701..299b758ab1 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,4 +1,4 @@ -{ pkgs, stdenv, lib, haskellLib, recurseIntoAttrs, srcOnly }: +{ pkgs, stdenv, lib, haskellLib, srcOnly }: with haskellLib; @@ -166,7 +166,7 @@ in { components = if lib.isDerivation components || components == {} then components - else recurseIntoAttrs components; + else lib.recurseIntoAttrs components; }; packageFilter = _name: package: (package.isHaskell or false) && packageSel package; filteredPkgs = lib.filterAttrs packageFilter haskellPackages; @@ -177,7 +177,7 @@ in { lib.filterAttrs (_: components: components != {}) ( builtins.mapAttrs (_name: packages: builtins.foldl' (a: b: a // b) {} (map (x: x.components) packages)) packagesGroupedByName); - in recurseIntoAttrs combined; + in lib.recurseIntoAttrs combined; # Equivalent to collectComponents with (_: true) as selection function. # Useful for pre-filtered package-set. @@ -193,7 +193,7 @@ in { # This can be used to collect all the test runs in your project, so that can be run in CI. collectChecks = packageSel: haskellPackages: let packageFilter = _name: package: (package.isHaskell or false) && packageSel package; - in recurseIntoAttrs (lib.filterAttrs (_: x: x != {} && x != recurseIntoAttrs {}) (lib.mapAttrs (_: p: p.checks) (lib.filterAttrs packageFilter haskellPackages))); + in lib.recurseIntoAttrs (lib.filterAttrs (_: x: x != {} && x != lib.recurseIntoAttrs {}) (lib.mapAttrs (_: p: p.checks) (lib.filterAttrs packageFilter haskellPackages))); # Equivalent to collectChecks with (_: true) as selection function. # Useful for pre-filtered package-set. diff --git a/modules/install-plan/redirect.nix b/modules/install-plan/redirect.nix index a3cc2fe238..3d92839d6d 100644 --- a/modules/install-plan/redirect.nix +++ b/modules/install-plan/redirect.nix @@ -39,7 +39,7 @@ let // lib.optionalAttrs (componentsByName ? lib) { library = lookupComponent "" "" componentsByName.lib; }; - checks = pkgs.recurseIntoAttrs ( + checks = pkgs.lib.recurseIntoAttrs ( lib.filterAttrs (_: x: x != {}) ( builtins.mapAttrs (_: d: pkgs.haskell-nix.haskellLib.check d) diff --git a/modules/project-common.nix b/modules/project-common.nix index 60776e4cc8..dadf2cdc0e 100644 --- a/modules/project-common.nix +++ b/modules/project-common.nix @@ -43,7 +43,7 @@ with lib.types; }; evalSystem = mkOption { type = str; - default = pkgs.pkgsBuildBuild.stdenv.system; + default = pkgs.pkgsBuildBuild.stdenv.hostPlatform.system; description = '' Specifies the system on which `cabal` and `nix-tools` should run. If not specified the `pkgsBuildBuild` system will be used. @@ -55,7 +55,7 @@ with lib.types; evalPackages = mkOption { type = attrs; default = - if pkgs.pkgsBuildBuild.stdenv.system == config.evalSystem + if pkgs.pkgsBuildBuild.stdenv.hostPlatform.system == config.evalSystem then pkgs.pkgsBuildBuild else import pkgs.path { diff --git a/nix-tools/flake.nix b/nix-tools/flake.nix index a45dd4701b..d8dc72286a 100644 --- a/nix-tools/flake.nix +++ b/nix-tools/flake.nix @@ -29,7 +29,7 @@ pkgs'.nix-tools-set { compilerSelection = lib.mkForce (p: p.haskell-nix.compiler); }; # tarball filename e.g. nix-tools-0.1.0.0-x86_64-unknown-linux-musl.tar.gz - tarball-filename = "${toolset.name}-${pkgs.hostPlatform.config}.tar.gz"; + tarball-filename = "${toolset.name}-${pkgs.stdenv.hostPlatform.config}.tar.gz"; in pkgs.runCommand tarball-filename { preferLocalBuild = true; } @@ -80,13 +80,13 @@ # project's hydraJobs pkgs.nix-tools-eval-on-linux.project.flake'.hydraJobs # tarballs with static builds. - // lib.optionalAttrs (pkgs.buildPlatform.system == "x86_64-linux") + // lib.optionalAttrs (pkgs.stdenv.buildPlatform.system == "x86_64-linux") { binary-tarball = mkTarball pkgs.pkgsCross.musl64; } # aarch64-multiplatform-musl cross compile is currently broken - # // lib.optionalAttrs (pkgs.buildPlatform.system == "aarch64-linux") + # // lib.optionalAttrs (pkgs.stdenv.buildPlatform.system == "aarch64-linux") # { binary-tarball = mkTarball pkgs.pkgsCross.aarch64-multiplatform-musl; } // { - static = static-nix-tools-outputs.hydraJobs.${pkgs.system}; + static = static-nix-tools-outputs.hydraJobs.${pkgs.stdenv.hostPlatform.system}; } ); }; diff --git a/nix-tools/static/project.nix b/nix-tools/static/project.nix index 4202cc5e17..cbefb235d1 100644 --- a/nix-tools/static/project.nix +++ b/nix-tools/static/project.nix @@ -46,7 +46,7 @@ let }; - add-static-libs-to-darwin = pkgs.lib.mkIf pkgs.hostPlatform.isDarwin { + add-static-libs-to-darwin = pkgs.lib.mkIf pkgs.stdenv.hostPlatform.isDarwin { packages.cabal-install.ghcOptions = [ "-L${pkgs.lib.getLib pkgs.static-gmp}/lib" ]; diff --git a/nix-tools/static/zipped.nix b/nix-tools/static/zipped.nix index c6390818c6..85b2a96b7b 100644 --- a/nix-tools/static/zipped.nix +++ b/nix-tools/static/zipped.nix @@ -31,7 +31,7 @@ let ]; in customPkgs.packaging.asZip { - name = "${customPkgs.hostPlatform.system}-nix-tools-static"; + name = "${customPkgs.stdenv.hostPlatform.system}-nix-tools-static"; drvs' = [ hsPkgs.cabal-install.components.exes.cabal hsPkgs.hpack.components.exes.hpack @@ -45,12 +45,12 @@ let stringifyInputs = inputs: pkgs.lib.mapAttrsToList (name: value: pkgs.lib.trace "${name}=${value}" "${value}") inputs; # stringifyInputs = inputs: map (x: "${x}") (builtins.attrValues inputs); - fragment-drv = "static-nix-tools-outputs.hydraJobs.${pkgs.hostPlatform.system}.zipped.${fragment-name}"; + fragment-drv = "static-nix-tools-outputs.hydraJobs.${pkgs.stdenv.hostPlatform.system}.zipped.${fragment-name}"; in - pkgs.runCommand "${pkgs.hostPlatform.system}-all-nix-tools" { + pkgs.runCommand "${pkgs.stdenv.hostPlatform.system}-all-nix-tools" { requiredSystemFeatures = [ "recursive-nix" ]; nativeBuildInputs = - # [ inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.nix pkgs.gitMinimal ] + # [ inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system}.nix pkgs.gitMinimal ] [ (pkgs.lib.trace pkgs.nix.version pkgs.nix) pkgs.gitMinimal ] ++ stringifyInputs inputs ++ stringifyInputs inputs.haskellNix.inputs; @@ -59,7 +59,7 @@ let mkdir $out cp $(nix --offline --extra-experimental-features "flakes nix-command" \ build --accept-flake-config --no-link --print-out-paths --no-allow-import-from-derivation \ - --system ${pkgs.hostPlatform.system} \ + --system ${pkgs.stdenv.hostPlatform.system} \ ${../.}#${fragment-drv})/*.zip $out/ ''; @@ -81,12 +81,12 @@ let allZippedTools = - pkgs.lib.optionalAttrs (pkgs.system == "x86_64-darwin" || pkgs.system == "aarch64-darwin") { + pkgs.lib.optionalAttrs (pkgs.stdenv.hostPlatform.system == "x86_64-darwin" || pkgs.stdenv.hostPlatform.system == "aarch64-darwin") { "nix-tools-static" = zippedToolsForDarwin; "nix-tools-static-no-ifd" = zippedToolsNoIfdFor "nix-tools-static"; } // - pkgs.lib.optionalAttrs (pkgs.system == "x86_64-linux") { + pkgs.lib.optionalAttrs (pkgs.stdenv.hostPlatform.system == "x86_64-linux") { "nix-tools-static" = zippedToolsForLinux; "nix-tools-static-arm64" = zippedToolsForLinuxArm64; diff --git a/overlays/armv6l-linux.nix b/overlays/armv6l-linux.nix index 96ebbd0c6f..e5dae3b201 100644 --- a/overlays/armv6l-linux.nix +++ b/overlays/armv6l-linux.nix @@ -2,10 +2,10 @@ final: prev: let isLinuxCross = prev.haskell-nix.haskellLib.isCrossHost - && prev.hostPlatform.isLinux - && (prev.hostPlatform.isAarch32 - || prev.hostPlatform.isAarch64 - || prev.hostPlatform.isi686); + && prev.stdenv.hostPlatform.isLinux + && (prev.stdenv.hostPlatform.isAarch32 + || prev.stdenv.hostPlatform.isAarch64 + || prev.stdenv.hostPlatform.isi686); in { diff --git a/overlays/default.nix b/overlays/default.nix index b252c4228c..4d1a1a84f9 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -31,7 +31,7 @@ let static-nix-tools' = pins: let # TODO replace once haskell-nix-examples nix-tools is in haskell.nix - zipFile = (import pins final).${final.system}; + zipFile = (import pins final).${final.stdenv.hostPlatform.system}; tarball = final.runCommand "nix-tools" { nativeBuildInputs = [ final.unzip ]; } '' @@ -54,7 +54,7 @@ let # Version of nix-tools built with a pinned version of haskell.nix. pinned-nix-tools-lib = (import final.haskell-nix.sources.flake-compat { pkgs = final; - inherit (final) system; + inherit (final.stdenv.hostPlatform) system; src = ../nix-tools; override-inputs = { # Avoid downloading another `hackage.nix`. @@ -75,7 +75,7 @@ let }; # For use building hadrian. This way updating anything that modifies the # way hadrian is built will not cause a GHC rebuild. - pinned-haskell-nix = pinned-nix-tools-lib.haskell-nix final.system; + pinned-haskell-nix = pinned-nix-tools-lib.haskell-nix final.stdenv.hostPlatform.system; }); bootstrap = import ./bootstrap.nix; diff --git a/overlays/haskell.nix b/overlays/haskell.nix index c9084f2e6f..1f14b81e6a 100644 --- a/overlays/haskell.nix +++ b/overlays/haskell.nix @@ -55,7 +55,7 @@ final: prev: { # Utility functions for working with the component builder. haskellLib = let hl = import ../lib { pkgs = final; - inherit (final) stdenv lib recurseIntoAttrs srcOnly; + inherit (final) stdenv lib srcOnly; haskellLib = hl; }; in hl; @@ -1034,7 +1034,7 @@ final: prev: { # project = cabalProject' {...}; # In your tests module add something that is effectively # testProjectPlan = withInputs project.plan-nix; - withInputs = final.recurseIntoAttrs; + withInputs = final.lib.recurseIntoAttrs; iserv-proxy-exes = __mapAttrs (compiler-nix-name: _ghc: let @@ -1153,7 +1153,7 @@ final: prev: { let ghc = final.buildPackages.haskell-nix.compiler.${compiler-nix-name}.override { ghcEvalPackages = evalPackages; }; in - final.recurseIntoAttrs ({ + final.lib.recurseIntoAttrs ({ # Things that require no IFD to build source-pin-hackage = hackageSrc; source-pin-stackage = stackageSrc; diff --git a/package-set.nix b/package-set.nix index 618024539c..21fbd0229a 100644 --- a/package-set.nix +++ b/package-set.nix @@ -7,7 +7,7 @@ in pkgs.lib.evalModules { _module.args = { # this is *not* the hasekllLib from nixpkgs; it is rather our own # library from haskell.nix - haskellLib = let hl = import ./lib { inherit pkgs lib; inherit (pkgs) stdenv recurseIntoAttrs srcOnly; haskellLib = hl; }; in hl; + haskellLib = let hl = import ./lib { inherit pkgs lib; inherit (pkgs) stdenv srcOnly; haskellLib = hl; }; in hl; # The package descriptions depend on pkgs, which are used to resolve system package dependencies # as well as pkgconfPkgs, which are used to resolve pkgconfig name to nixpkgs names. We simply diff --git a/test/annotations/default.nix b/test/annotations/default.nix index 6412b44e43..97642ac1c0 100644 --- a/test/annotations/default.nix +++ b/test/annotations/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, util, project', haskellLib, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -8,7 +8,7 @@ let src = testSrc "annotations"; }; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { meta.disabled = # This fail looking for ghci. Adding ghci as a `build-depends` works, but should not be needed stdenv.hostPlatform.isGhcjs || stdenv.hostPlatform.isWasm diff --git a/test/buildable/default.nix b/test/buildable/default.nix index ea20474379..872932d73a 100644 --- a/test/buildable/default.nix +++ b/test/buildable/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, cabalProject', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -13,7 +13,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/c-ffi/default.nix b/test/c-ffi/default.nix index f03ac119fe..c5396baffb 100644 --- a/test/c-ffi/default.nix +++ b/test/c-ffi/default.nix @@ -1,5 +1,5 @@ # Test a package set -{ stdenv, lib, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, util, mkCabalProjectPkgSet, project', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -20,7 +20,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/ca-derivations-include/default.nix b/test/ca-derivations-include/default.nix index 00f88a1045..7a23d140f8 100644 --- a/test/ca-derivations-include/default.nix +++ b/test/ca-derivations-include/default.nix @@ -1,6 +1,6 @@ # Build a project enabling content addressed derivations for # only a subset of the components -{ stdenv, pkgs, lib, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, CADerivationsEnabled }: +{ stdenv, pkgs, lib, mkCabalProjectPkgSet, project', haskellLib, testSrc, compiler-nix-name, evalPackages, CADerivationsEnabled }: with lib; @@ -34,7 +34,7 @@ let exeB = projectB.hsPkgs.cabal-simple.components.exes.cabal-simple.exePath; in -recurseIntoAttrs { +lib.recurseIntoAttrs { meta.disabled = !CADerivationsEnabled; diff --git a/test/ca-derivations/default.nix b/test/ca-derivations/default.nix index 4e9d8c99d1..b20014245b 100644 --- a/test/ca-derivations/default.nix +++ b/test/ca-derivations/default.nix @@ -1,6 +1,6 @@ # Test if derivations are content addressed building two derivations producing # the same outputs and checking if the path stores are equals -{ stdenv, pkgs, lib, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, CADerivationsEnabled }: +{ stdenv, pkgs, lib, mkCabalProjectPkgSet, project', haskellLib, testSrc, compiler-nix-name, evalPackages, CADerivationsEnabled }: with lib; @@ -38,7 +38,7 @@ let exe-withComment = projectWithComment.hsPkgs.cabal-simple.components.exes.cabal-simple.exePath; in -recurseIntoAttrs { +lib.recurseIntoAttrs { meta.disabled = !CADerivationsEnabled; diff --git a/test/cabal-22/default.nix b/test/cabal-22/default.nix index 071992ab9e..946e4ffda6 100644 --- a/test/cabal-22/default.nix +++ b/test/cabal-22/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, mkCabalProjectPkgSet, cabalProject', haskellLib, util, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, mkCabalProjectPkgSet, cabalProject', haskellLib, util, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -11,7 +11,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { # When using ghcjs on darwin this test fails with # ReferenceError: h$hs_clock_darwin_gettime is not defined # https://github.com/input-output-hk/haskell.nix/issues/925 diff --git a/test/cabal-doctests/default.nix b/test/cabal-doctests/default.nix index 1a2ccd235c..88f6753d03 100644 --- a/test/cabal-doctests/default.nix +++ b/test/cabal-doctests/default.nix @@ -1,5 +1,5 @@ # Test a package set -{ stdenv, lib, util, cabalProject', haskellLib, gmp6, zlib, recurseIntoAttrs, runCommand, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, util, cabalProject', haskellLib, gmp6, zlib, runCommand, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -18,7 +18,7 @@ let disabled = stdenv.buildPlatform != stdenv.hostPlatform; }; -in recurseIntoAttrs ({ +in lib.recurseIntoAttrs ({ # Making cabal-doctest work for cross compilers will be difficult. meta.disabled = stdenv.buildPlatform != stdenv.hostPlatform || builtins.compareVersions buildPackages.haskell-nix.compiler.${compiler-nix-name}.version "9.0" >= 0; diff --git a/test/cabal-hpack/default.nix b/test/cabal-hpack/default.nix index 4162bb6886..39c76c2a46 100644 --- a/test/cabal-hpack/default.nix +++ b/test/cabal-hpack/default.nix @@ -1,5 +1,5 @@ # Test a package set -{ stdenv, lib, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, util, mkCabalProjectPkgSet, project', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -21,7 +21,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/cabal-project-nix-path/default.nix b/test/cabal-project-nix-path/default.nix index d34643582e..401a5af7ad 100644 --- a/test/cabal-project-nix-path/default.nix +++ b/test/cabal-project-nix-path/default.nix @@ -1,4 +1,4 @@ -{ lib, cabalProject', tool, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ lib, cabalProject', tool, testSrc, compiler-nix-name, evalPackages }: let # Kind of round about way of getting the source for the hello package from hackage # so we can use it in this test. @@ -22,7 +22,7 @@ let ''; }; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/cabal-simple-debug/default.nix b/test/cabal-simple-debug/default.nix index 58d7aab01f..21dc6e5e15 100644 --- a/test/cabal-simple-debug/default.nix +++ b/test/cabal-simple-debug/default.nix @@ -1,5 +1,5 @@ # Test a package set -{ stdenv, lib, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages, dwarfdump }: +{ stdenv, lib, util, cabalProject', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages, dwarfdump }: with lib; @@ -12,7 +12,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { # DWARF only works on linux with GHC 8.10.2 and newer # GHC 9.2.1 disabled because of https://github.com/input-output-hk/haskell.nix/issues/1332 meta.disabled = __elem compiler-nix-name ["ghc921" "ghc922" "ghc923" "ghc924" "ghc925" "ghc926" "ghc927"] diff --git a/test/cabal-simple-prof/default.nix b/test/cabal-simple-prof/default.nix index d95fbf8f95..3a44d94614 100644 --- a/test/cabal-simple-prof/default.nix +++ b/test/cabal-simple-prof/default.nix @@ -1,5 +1,5 @@ # Test a package set -{ stdenv, lib, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, util, cabalProject', haskellLib, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -28,7 +28,7 @@ let exe = (project.getComponent "cabal-simple:exe:cabal-simple") .override (lib.optionalAttrs stdenv.hostPlatform.isAndroid { setupBuildFlags = ["--ghc-option=-optl-static" ]; }); -in recurseIntoAttrs { +in lib.recurseIntoAttrs { meta.disabled = stdenv.hostPlatform.isGhcjs || stdenv.hostPlatform.isWasm; ifdInputs = { inherit (project) plan-nix; diff --git a/test/cabal-simple/default.nix b/test/cabal-simple/default.nix index 86c13739d2..5bf2ba2f98 100644 --- a/test/cabal-simple/default.nix +++ b/test/cabal-simple/default.nix @@ -1,5 +1,5 @@ # Test a package set -{ stdenv, lib, util, mkCabalProjectPkgSet, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, util, mkCabalProjectPkgSet, project', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -24,7 +24,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/cabal-source-repo-comments/default.nix b/test/cabal-source-repo-comments/default.nix index d277a46186..fe5a6b0462 100644 --- a/test/cabal-source-repo-comments/default.nix +++ b/test/cabal-source-repo-comments/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, cabalProject', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -12,7 +12,7 @@ let ''; }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/cabal-source-repo/default.nix b/test/cabal-source-repo/default.nix index 74ad377bec..6bea82617e 100644 --- a/test/cabal-source-repo/default.nix +++ b/test/cabal-source-repo/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, cabalProject', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -12,7 +12,7 @@ let ''; }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/cabal-sublib/default.nix b/test/cabal-sublib/default.nix index c2821b8492..5620af8a88 100644 --- a/test/cabal-sublib/default.nix +++ b/test/cabal-sublib/default.nix @@ -1,5 +1,5 @@ # Test a package set -{ stdenv, lib, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, util, cabalProject', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -25,7 +25,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/call-cabal-project-to-nix/default.nix b/test/call-cabal-project-to-nix/default.nix index 40423c8b07..d5677afe14 100644 --- a/test/call-cabal-project-to-nix/default.nix +++ b/test/call-cabal-project-to-nix/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, buildPackages, mkCabalProjectPkgSet, callCabalProjectToNix, loadCabalPlan, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, buildPackages, mkCabalProjectPkgSet, callCabalProjectToNix, loadCabalPlan, haskellLib, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -28,7 +28,7 @@ let }; packages = pkgSet.config.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { plan-nix = callProjectResults.projectNix; }; diff --git a/test/call-stack-to-nix/default.nix b/test/call-stack-to-nix/default.nix index 345a147752..2f965cbb42 100644 --- a/test/call-stack-to-nix/default.nix +++ b/test/call-stack-to-nix/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, mkStackPkgSet, callStackToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, mkStackPkgSet, callStackToNix, importAndFilterProject, haskellLib, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -14,7 +14,7 @@ let }; packages = pkgSet.config.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { meta.disabled = compiler-nix-name != "ghc865"; ifdInputs = { stack-nix = callProjectResults.projectNix; diff --git a/test/coverage-golden/default.nix b/test/coverage-golden/default.nix index 441e9bc191..c110715e6a 100644 --- a/test/coverage-golden/default.nix +++ b/test/coverage-golden/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, recurseIntoAttrs, runCommand, testSrc, compiler-nix-name, evalPackages, buildPackages, sources }: +{ stdenv, lib, fetchFromGitHub, runCommand, testSrc, compiler-nix-name, evalPackages, buildPackages, sources }: with lib; @@ -18,7 +18,7 @@ let exampleProject = import "${exampleProjectSrc}" { config = { haskellNix = { coverage = true; }; }; }; exampleCoverageReport = exampleProject.cardanoShellHaskellPackages.projectCoverageReport; -in recurseIntoAttrs ({ +in lib.recurseIntoAttrs ({ # Does not work on ghcjs because it needs zlib. meta.disabled = stdenv.hostPlatform.isGhcjs; run = stdenv.mkDerivation { diff --git a/test/coverage-no-libs/default.nix b/test/coverage-no-libs/default.nix index 02a9df5ee0..5730a6a67b 100644 --- a/test/coverage-no-libs/default.nix +++ b/test/coverage-no-libs/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, cabal-install, cabalProject', stackProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, cabal-install, cabalProject', stackProject', runCommand, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -13,7 +13,7 @@ let cabalProj = (cabalProject' (projectArgs // { inherit compiler-nix-name; })); stackProj = (stackProject' projectArgs); -in recurseIntoAttrs ({ +in lib.recurseIntoAttrs ({ # Does not work on ghcjs because it needs zlib. meta.disabled = stdenv.hostPlatform.isGhcjs; run = stdenv.mkDerivation { diff --git a/test/coverage/default.nix b/test/coverage/default.nix index de86fb4b1c..828808b59f 100644 --- a/test/coverage/default.nix +++ b/test/coverage/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, cabal-install, cabalProject', stackProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, cabal-install, cabalProject', stackProject', runCommand, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -25,7 +25,7 @@ let crossSuffix = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-${stdenv.hostPlatform.config}"; crossSuffix' = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isStatic) "-static" + crossSuffix; -in recurseIntoAttrs ({ +in lib.recurseIntoAttrs ({ # Does not work on ghcjs because it needs zlib. Wasm needs network fixed. meta.disabled = stdenv.hostPlatform.isGhcjs || stdenv.hostPlatform.isWasm # For some reason the `.tix` file is not created on armv7a android (not sure why) diff --git a/test/default.nix b/test/default.nix index 9ca3cbb580..a398346ca6 100644 --- a/test/default.nix +++ b/test/default.nix @@ -59,7 +59,7 @@ let (name: val: if name == "ifdInputs" then - pkgs.recurseIntoAttrs + pkgs.lib.recurseIntoAttrs (builtins.mapAttrs (_: v: pkgs.haskell-nix.withInputs v) val) else val ); @@ -97,7 +97,7 @@ let # >>> filterNonIfdInputsSetRecurse { foobar = "hello" } # { recurseForDerivations = true; } filterNonIfdInputsSetRecurse = attrs: - pkgs.recurseIntoAttrs (filterAttrsIfdInputs attrs); + pkgs.lib.recurseIntoAttrs (filterAttrsIfdInputs attrs); # Filter all out all the keys/values for child values of this attribute set # where the key is not equal to "ifdInputs". @@ -261,7 +261,7 @@ let optionalIfdTests = ifdLevel: pkgs.lib.optionalAttrs (ifdLevel > 1) (allTestsWithIfdInputs ifdLevel); in filterAttrsOnlyRecursive (_: v: !(isDisabled v)) - (pkgs.recurseIntoAttrs (optionalIfdTests ifdLevel)) + (pkgs.lib.recurseIntoAttrs (optionalIfdTests ifdLevel)) ## more possible test cases # 1. fully static linking diff --git a/test/exe-dlls/default.nix b/test/exe-dlls/default.nix index f16960cbf2..4bdd6f3a3b 100644 --- a/test/exe-dlls/default.nix +++ b/test/exe-dlls/default.nix @@ -1,5 +1,5 @@ # Test building TH code that needs DLLs when cross compiling for windows -{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, util, project', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -13,7 +13,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs rec { +in lib.recurseIntoAttrs rec { meta.disabled = stdenv.hostPlatform.isGhcjs || stdenv.hostPlatform.isWasm; ifdInputs = { diff --git a/test/exe-lib-dlls/default.nix b/test/exe-lib-dlls/default.nix index 467c08afbe..057904c9b7 100644 --- a/test/exe-lib-dlls/default.nix +++ b/test/exe-lib-dlls/default.nix @@ -1,5 +1,5 @@ # Test building TH code that needs DLLs when cross compiling for windows -{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, util, project', haskellLib, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -13,7 +13,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs rec { +in lib.recurseIntoAttrs rec { meta.disabled = stdenv.hostPlatform.isGhcjs || stdenv.hostPlatform.isWasm; ifdInputs = { diff --git a/test/exe-only/default.nix b/test/exe-only/default.nix index ee69c34b26..401758cafb 100644 --- a/test/exe-only/default.nix +++ b/test/exe-only/default.nix @@ -1,5 +1,5 @@ # Test a package set -{ stdenv, lib, util, haskell-nix, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, util, haskell-nix, haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -15,7 +15,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/external-static-plugin/default.nix b/test/external-static-plugin/default.nix index 1eff8ab632..5f1579e083 100644 --- a/test/external-static-plugin/default.nix +++ b/test/external-static-plugin/default.nix @@ -1,4 +1,4 @@ -{ cabalProject', testSrc, compiler-nix-name, buildPackages, evalPackages, recurseIntoAttrs, haskellLib }: let +{ cabalProject', testSrc, compiler-nix-name, buildPackages, evalPackages, haskellLib }: let project = cabalProject' { src = testSrc "external-static-plugin"; inherit compiler-nix-name evalPackages; @@ -9,7 +9,7 @@ ''; } ]; }; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/extra-hackage/default.nix b/test/extra-hackage/default.nix index 6c43bb7a97..9fdae4b336 100644 --- a/test/extra-hackage/default.nix +++ b/test/extra-hackage/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, cabalProject', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -27,7 +27,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/fully-static/default.nix b/test/fully-static/default.nix index 9379b00f91..be205d6df1 100644 --- a/test/fully-static/default.nix +++ b/test/fully-static/default.nix @@ -1,7 +1,6 @@ { stackProject' , stdenv, lib, gmp6, openssl, zlib, libffi , buildPackages -, recurseIntoAttrs , testSrc , compiler-nix-name , evalPackages @@ -30,7 +29,7 @@ let packagesGmp = (project { gpl = true; }).hsPkgs; packagesIntegerSimple = (project { gpl = false; }).hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { meta.disabled = stdenv.hostPlatform.isGhcjs || compiler-nix-name != compiler; ifdInputs = { diff --git a/test/ghc-options/cabal.nix b/test/ghc-options/cabal.nix index c3388e8eae..8b7aa34b81 100644 --- a/test/ghc-options/cabal.nix +++ b/test/ghc-options/cabal.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, cabalProject', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -19,7 +19,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/ghc-options/stack.nix b/test/ghc-options/stack.nix index c7841441be..cc18c097b4 100644 --- a/test/ghc-options/stack.nix +++ b/test/ghc-options/stack.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, stackProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, stackProject', haskellLib, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -9,7 +9,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { # This test is somehow broken for ghcjs meta.disabled = stdenv.hostPlatform.isGhcjs || compiler-nix-name != "ghc984"; diff --git a/test/ghcjs-overlay/default.nix b/test/ghcjs-overlay/default.nix index 956e800408..c160b04c71 100644 --- a/test/ghcjs-overlay/default.nix +++ b/test/ghcjs-overlay/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, cabalProject', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -10,7 +10,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/gi-gtk/default.nix b/test/gi-gtk/default.nix index 8ceb1e1f69..3da857dfe5 100644 --- a/test/gi-gtk/default.nix +++ b/test/gi-gtk/default.nix @@ -1,5 +1,5 @@ # Test building TH code that needs DLLs when cross compiling for windows -{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, util, project', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -15,7 +15,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs rec { +in lib.recurseIntoAttrs rec { meta.disabled = stdenv.hostPlatform.isGhcjs || stdenv.hostPlatform.isWasm # Gtk cross compilation seems to be broken in nixpkgs || stdenv.hostPlatform.isWindows diff --git a/test/githash/default.nix b/test/githash/default.nix index e3e9bfe171..35f68547b5 100644 --- a/test/githash/default.nix +++ b/test/githash/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, haskell-nix, haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, runCommand, gitReallyMinimal, buildPackages }: +{ stdenv, lib, haskell-nix, haskellLib, testSrc, compiler-nix-name, evalPackages, runCommand, gitReallyMinimal, buildPackages }: with lib; @@ -40,7 +40,7 @@ let githash-test = packages.githash-test.components.exes.githash-test; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { # githash runs git from TH code and this needs a cross compiled git exe # to work correctly. Cross compiling git is currently broken. meta.disabled = __elem compiler-nix-name ["ghc901" "ghc902"] || haskellLib.isCrossHost || diff --git a/test/haskell-language-server/cabal.nix b/test/haskell-language-server/cabal.nix index 26cc6a4104..a59e40027e 100644 --- a/test/haskell-language-server/cabal.nix +++ b/test/haskell-language-server/cabal.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, testSrc, haskell-nix, compiler-nix-name, evalPackages, recurseIntoAttrs, buildPackages }: +{ lib, stdenv, testSrc, haskell-nix, compiler-nix-name, evalPackages, buildPackages }: let project = haskell-nix.cabalProject' { inherit compiler-nix-name evalPackages; @@ -6,7 +6,7 @@ let src = haskell-nix.sources."hls-2.11"; configureArgs = "--disable-benchmarks --disable-tests"; # This makes cabalProject' more like the `tool` function }; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/haskell-language-server/stack.nix b/test/haskell-language-server/stack.nix index 124be9f308..e786955e0d 100644 --- a/test/haskell-language-server/stack.nix +++ b/test/haskell-language-server/stack.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, testSrc, haskell-nix, buildPackages, compiler-nix-name, evalPackages, recurseIntoAttrs }: +{ stdenv, lib, testSrc, haskell-nix, buildPackages, compiler-nix-name, evalPackages }: let project = buildPackages.haskell-nix.project' { inherit compiler-nix-name evalPackages; @@ -15,7 +15,7 @@ let "https://github.com/hsyl20/ghc-api-compat.git"."8fee87eac97a538dbe81ff1ab18cff10f2f9fa15" = "sha256-byehvdxQxhNk5ZQUXeFHjAZpAze4Ct9261ro4c5acZk="; }; }; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) stack-nix; }; diff --git a/test/js-template-haskell/default.nix b/test/js-template-haskell/default.nix index 8a2ad7e2e5..c43953dedf 100644 --- a/test/js-template-haskell/default.nix +++ b/test/js-template-haskell/default.nix @@ -1,5 +1,5 @@ # Test building TH code that needs DLLs when cross compiling for windows -{ stdenv, lib, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, project', haskellLib, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -18,7 +18,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/literate-haskell/default.nix b/test/literate-haskell/default.nix index 572bd08540..0962bdd34a 100644 --- a/test/literate-haskell/default.nix +++ b/test/literate-haskell/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, project', haskellLib, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -10,7 +10,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/plugin/default.nix b/test/plugin/default.nix index ed550473d4..ff65a848d8 100644 --- a/test/plugin/default.nix +++ b/test/plugin/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, haskellLib, project', recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, haskellLib, project', testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -13,7 +13,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/project-flags/cabal.nix b/test/project-flags/cabal.nix index 808f56b104..0a1f0b2b8e 100644 --- a/test/project-flags/cabal.nix +++ b/test/project-flags/cabal.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, cabalProject', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -9,7 +9,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/project-flags/stack.nix b/test/project-flags/stack.nix index 6cb5334283..c220a9c1d0 100644 --- a/test/project-flags/stack.nix +++ b/test/project-flags/stack.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, stackProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, stackProject', haskellLib, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -9,7 +9,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { meta.disabled = compiler-nix-name != "ghc984"; ifdInputs = { inherit (project) stack-nix; diff --git a/test/setup-deps/default.nix b/test/setup-deps/default.nix index efcc15696d..b0991d7163 100644 --- a/test/setup-deps/default.nix +++ b/test/setup-deps/default.nix @@ -18,7 +18,7 @@ let }; in -recurseIntoAttrs ({ +lib.recurseIntoAttrs ({ ifdInputs = { plan-nix = addMetaAttrs meta project.plan-nix; }; diff --git a/test/sha256map/default.nix b/test/sha256map/default.nix index a4c2a65e20..89b230f854 100644 --- a/test/sha256map/default.nix +++ b/test/sha256map/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, stdenv, haskell-nix, testSrc, zlib, compiler-nix-name, evalPackages, recurseIntoAttrs } : recurseIntoAttrs { +{ pkgs, lib, stdenv, haskell-nix, testSrc, zlib, compiler-nix-name, evalPackages } : lib.recurseIntoAttrs { # The version of pandoc used in this test does not build with ghcjs or ghc 8.10 meta.disabled = stdenv.hostPlatform.isGhcjs || builtins.compareVersions pkgs.buildPackages.haskell-nix.compiler.${compiler-nix-name}.version "8.10" >= 0; diff --git a/test/shell-for-setup-deps/default.nix b/test/shell-for-setup-deps/default.nix index 6bf7214373..9e15676917 100644 --- a/test/shell-for-setup-deps/default.nix +++ b/test/shell-for-setup-deps/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, cabal-install, cabalProject', recurseIntoAttrs, runCommand, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, cabal-install, cabalProject', runCommand, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -14,7 +14,7 @@ let withHoogle = true; }; -in recurseIntoAttrs ({ +in lib.recurseIntoAttrs ({ # Making this work for cross compilers will be difficult as setup-deps are # built for the build platform and the shell will be for the host platform. # We probably need a shell that provides both build and host ghc diff --git a/test/shell-for/default.nix b/test/shell-for/default.nix index 34f1b2ff06..f2abe0a5b8 100644 --- a/test/shell-for/default.nix +++ b/test/shell-for/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, project' }: +{ stdenv, lib, haskellLib, testSrc, compiler-nix-name, evalPackages, project' }: with lib; @@ -50,7 +50,7 @@ let packageSetupDeps = false; }; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { # Does not work on ghcjs because it needs zlib. # Does not work on windows because it needs mintty. meta.disabled = stdenv.hostPlatform.isMusl diff --git a/test/snapshots/default.nix b/test/snapshots/default.nix index eaa64f94b2..fdb65291c6 100644 --- a/test/snapshots/default.nix +++ b/test/snapshots/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, haskellPackages, snapshots, recurseIntoAttrs, runCommand, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, haskellPackages, snapshots, runCommand, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -6,7 +6,7 @@ let env = snapshots."lts-14.13".ghcWithHoogle (ps: with ps; [ conduit conduit-extra resourcet ]); -in recurseIntoAttrs { +in lib.recurseIntoAttrs { # Does not work on ghcjs because it needs zlib. meta.disabled = stdenv.hostPlatform.isGhcjs || compiler-nix-name != "ghc865"; inherit env; diff --git a/test/stack-compiler/default.nix b/test/stack-compiler/default.nix index 614de24341..b9fa7db2f3 100644 --- a/test/stack-compiler/default.nix +++ b/test/stack-compiler/default.nix @@ -1,4 +1,4 @@ -{ stackProject', recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ stackProject', testSrc, compiler-nix-name, evalPackages }: let project = stackProject' { @@ -7,7 +7,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { meta.disabled = compiler-nix-name != "ghc9101"; ifdInputs = { inherit (project) stack-nix; diff --git a/test/stack-local-resolver-subdir/default.nix b/test/stack-local-resolver-subdir/default.nix index fe0520d2f4..12902accba 100644 --- a/test/stack-local-resolver-subdir/default.nix +++ b/test/stack-local-resolver-subdir/default.nix @@ -1,4 +1,4 @@ -{ project', recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ project', testSrc, compiler-nix-name, evalPackages }: let project = project' { @@ -7,7 +7,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { meta.disabled = compiler-nix-name != "ghc984"; ifdInputs = { inherit (project) stack-nix; diff --git a/test/stack-local-resolver/default.nix b/test/stack-local-resolver/default.nix index 640d9ada4b..3479340d26 100644 --- a/test/stack-local-resolver/default.nix +++ b/test/stack-local-resolver/default.nix @@ -1,4 +1,4 @@ -{ project', recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ project', testSrc, compiler-nix-name, evalPackages }: let project = project' { @@ -7,7 +7,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { meta.disabled = compiler-nix-name != "ghc984"; ifdInputs = { inherit (project) stack-nix; diff --git a/test/stack-remote-resolver/default.nix b/test/stack-remote-resolver/default.nix index 83468a56bc..f30592e876 100644 --- a/test/stack-remote-resolver/default.nix +++ b/test/stack-remote-resolver/default.nix @@ -1,4 +1,4 @@ -{ project', recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ project', testSrc, compiler-nix-name, evalPackages }: let project = project' { @@ -8,7 +8,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { meta.disabled = compiler-nix-name != "ghc984"; ifdInputs = { inherit (project) stack-nix; diff --git a/test/stack-simple/default.nix b/test/stack-simple/default.nix index 5c8be4a197..90c3e6bdfd 100644 --- a/test/stack-simple/default.nix +++ b/test/stack-simple/default.nix @@ -11,7 +11,7 @@ let packages = project.hsPkgs; -in pkgs.recurseIntoAttrs { +in pkgs.lib.recurseIntoAttrs { meta.disabled = !builtins.pathExists ./stack-${compiler-nix-name}.yaml; stack-simple-exe = (haskellLib.check packages.stack-simple.components.exes.stack-simple-exe) // { # Attributes used for debugging with nix repl diff --git a/test/stack-source-repo/default.nix b/test/stack-source-repo/default.nix index f6ace1c6f0..12dca95e7f 100644 --- a/test/stack-source-repo/default.nix +++ b/test/stack-source-repo/default.nix @@ -1,4 +1,4 @@ -{ stdenv, stackProject', recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, stackProject', testSrc, compiler-nix-name, evalPackages }: let project = stackProject' { @@ -7,7 +7,7 @@ let }; packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { meta.disabled = compiler-nix-name != "ghc984" || stdenv.hostPlatform.isGhcjs; ifdInputs = { inherit (project) stack-nix; diff --git a/test/sublib-docs/default.nix b/test/sublib-docs/default.nix index e106dc1da2..d6de17d3ed 100644 --- a/test/sublib-docs/default.nix +++ b/test/sublib-docs/default.nix @@ -1,5 +1,5 @@ # Test a package set -{ stdenv, lib, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, util, cabalProject', haskellLib, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -12,7 +12,7 @@ let packages = project.hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { # Haddock is not included with cross compilers currently meta.disabled = haskellLib.isCrossHost || stdenv.hostPlatform.isStatic; ifdInputs = { diff --git a/test/supported-langauges/default.nix b/test/supported-langauges/default.nix index cb1b31d834..b48fc0bb5f 100644 --- a/test/supported-langauges/default.nix +++ b/test/supported-langauges/default.nix @@ -1,4 +1,4 @@ -{ stdenv, pkgs, lib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, pkgs, lib, testSrc, compiler-nix-name, evalPackages, buildPackages }: let ghc = buildPackages.haskell-nix.compiler.${compiler-nix-name}.override { ghcEvalPackages = evalPackages; }; @@ -7,7 +7,7 @@ let inherit pkgs evalPackages ghc; }; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { check = stdenv.mkDerivation { name = "support-languages-check"; diff --git a/test/test-only/default.nix b/test/test-only/default.nix index 9d53dc14b6..59fa4ee3c1 100644 --- a/test/test-only/default.nix +++ b/test/test-only/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }: +{ stdenv, lib, util, project', haskellLib, testSrc, compiler-nix-name, evalPackages }: with lib; @@ -8,7 +8,7 @@ let src = testSrc "test-only"; }; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { ifdInputs = { inherit (project) plan-nix; }; diff --git a/test/th-dlls-minimal/default.nix b/test/th-dlls-minimal/default.nix index 43837f7ef1..bc7324c291 100644 --- a/test/th-dlls-minimal/default.nix +++ b/test/th-dlls-minimal/default.nix @@ -1,5 +1,5 @@ # Test building TH code that needs DLLs when cross compiling for windows -{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, util, project', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -30,7 +30,7 @@ let packages = (project false).hsPkgs; packages-ei = (project true).hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { # This test is just for windows currently (the full th-dlls test runs on other platforms) meta.disabled = !stdenv.hostPlatform.isWindows # Disable for now (CI machines currently hang without timing out) diff --git a/test/th-dlls/default.nix b/test/th-dlls/default.nix index 6b7ad744b5..3216d00028 100644 --- a/test/th-dlls/default.nix +++ b/test/th-dlls/default.nix @@ -1,5 +1,5 @@ # Test building TH code that needs DLLs when cross compiling for windows -{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, util, project', haskellLib, testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; @@ -25,7 +25,7 @@ let packages = (project false).hsPkgs; packages-ei = (project true).hsPkgs; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { meta.disabled = stdenv.hostPlatform.isGhcjs || stdenv.hostPlatform.isWasm # On aarch64 this test breaks form musl cross compiles on x86_64-linux # Error is: diff --git a/test/with-packages/default.nix b/test/with-packages/default.nix index 5612af574b..fcf1504cbc 100644 --- a/test/with-packages/default.nix +++ b/test/with-packages/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, haskellLib, util, cabalProject', recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages, buildPackages }: +{ stdenv, lib, haskellLib, util, cabalProject', testSrc, compiler-nix-name, evalPackages, buildPackages }: with lib; with util; @@ -34,7 +34,7 @@ let showDepends = component: concatMapStringsSep " " pkgId (component.depends or []); extraFlags = ""; -in recurseIntoAttrs { +in lib.recurseIntoAttrs { # Used for testing externally with nix-shell (../tests.sh). # This just adds cabal-install to the existing shells. test-shell = (addCabalInstall library.shell).overrideAttrs (_: _: { From 77645ec92f1d019695f8bf291852a5c617138e3f Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Wed, 3 Dec 2025 01:26:55 +1300 Subject: [PATCH 2/2] Fix missing `lib` --- test/external-static-plugin/default.nix | 2 +- test/stack-compiler/default.nix | 2 +- test/stack-local-resolver-subdir/default.nix | 2 +- test/stack-local-resolver/default.nix | 2 +- test/stack-remote-resolver/default.nix | 2 +- test/stack-source-repo/default.nix | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/external-static-plugin/default.nix b/test/external-static-plugin/default.nix index 5f1579e083..c08387e445 100644 --- a/test/external-static-plugin/default.nix +++ b/test/external-static-plugin/default.nix @@ -1,4 +1,4 @@ -{ cabalProject', testSrc, compiler-nix-name, buildPackages, evalPackages, haskellLib }: let +{ lib, cabalProject', testSrc, compiler-nix-name, buildPackages, evalPackages, haskellLib }: let project = cabalProject' { src = testSrc "external-static-plugin"; inherit compiler-nix-name evalPackages; diff --git a/test/stack-compiler/default.nix b/test/stack-compiler/default.nix index b9fa7db2f3..261159e8c0 100644 --- a/test/stack-compiler/default.nix +++ b/test/stack-compiler/default.nix @@ -1,4 +1,4 @@ -{ stackProject', testSrc, compiler-nix-name, evalPackages }: +{ lib, stackProject', testSrc, compiler-nix-name, evalPackages }: let project = stackProject' { diff --git a/test/stack-local-resolver-subdir/default.nix b/test/stack-local-resolver-subdir/default.nix index 12902accba..c5d7b1b763 100644 --- a/test/stack-local-resolver-subdir/default.nix +++ b/test/stack-local-resolver-subdir/default.nix @@ -1,4 +1,4 @@ -{ project', testSrc, compiler-nix-name, evalPackages }: +{ lib, project', testSrc, compiler-nix-name, evalPackages }: let project = project' { diff --git a/test/stack-local-resolver/default.nix b/test/stack-local-resolver/default.nix index 3479340d26..00e4d4fbf4 100644 --- a/test/stack-local-resolver/default.nix +++ b/test/stack-local-resolver/default.nix @@ -1,4 +1,4 @@ -{ project', testSrc, compiler-nix-name, evalPackages }: +{ lib, project', testSrc, compiler-nix-name, evalPackages }: let project = project' { diff --git a/test/stack-remote-resolver/default.nix b/test/stack-remote-resolver/default.nix index f30592e876..6e6e799775 100644 --- a/test/stack-remote-resolver/default.nix +++ b/test/stack-remote-resolver/default.nix @@ -1,4 +1,4 @@ -{ project', testSrc, compiler-nix-name, evalPackages }: +{ lib, project', testSrc, compiler-nix-name, evalPackages }: let project = project' { diff --git a/test/stack-source-repo/default.nix b/test/stack-source-repo/default.nix index 12dca95e7f..81be4ce932 100644 --- a/test/stack-source-repo/default.nix +++ b/test/stack-source-repo/default.nix @@ -1,4 +1,4 @@ -{ stdenv, stackProject', testSrc, compiler-nix-name, evalPackages }: +{ lib, stdenv, stackProject', testSrc, compiler-nix-name, evalPackages }: let project = stackProject' {