From 5d9959cd30e5f94b3e351771758f8d4405b55ed7 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 21 Apr 2023 23:18:54 +0300 Subject: [PATCH 1/3] WIP: add depsBuildHost depsHostTarget --- pkgs/stdenv/adapters.nix | 8 ++++---- pkgs/stdenv/cross/default.nix | 5 +++-- pkgs/stdenv/generic/builder.sh | 4 ++-- pkgs/stdenv/generic/default.nix | 13 ++++++++----- pkgs/stdenv/generic/make-derivation.nix | 25 +++++++++++++++++-------- pkgs/stdenv/generic/setup.sh | 16 ++++++++++++---- 6 files changed, 46 insertions(+), 25 deletions(-) diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 0c5645e5a487f..414ac8d3c488e 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -39,7 +39,7 @@ rec { # Used to override packages in stdenv like Make. Should not be used # for other dependencies. overrideInStdenv = stdenv: pkgs: - stdenv.override (prev: { allowedRequisites = null; extraBuildInputs = (prev.extraBuildInputs or []) ++ pkgs; }); + stdenv.override (prev: { allowedRequisites = null; extraDepsHostTarget = (prev.extraDepsHostTarget or []) ++ pkgs; }); # Override the setup script of stdenv. Useful for testing new @@ -68,7 +68,7 @@ rec { ]; })); } // lib.optionalAttrs (stdenv0.hostPlatform.libc == "libc") { - extraBuildInputs = (old.extraBuildInputs or []) ++ [ + extraDepsHostTarget = (old.extraDepsHostTarget or []) ++ [ pkgs.glibc.static ]; }); @@ -93,8 +93,8 @@ rec { # Best effort static binaries. Will still be linked to libSystem, # but more portable than Nix store binaries. makeStaticDarwin = stdenv: stdenv.override (old: { - # extraBuildInputs are dropped in cross.nix, but darwin still needs them - extraBuildInputs = [ pkgs.buildPackages.darwin.CF ]; + # extraDepsHostTarget are dropped in cross.nix, but darwin still needs them + extraDepsHostTarget = [ pkgs.buildPackages.darwin.CF ]; mkDerivationFromStdenv = extendMkDerivationArgs old (args: { NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") + lib.optionalString (stdenv.cc.isGNU or false) " -static-libgcc"; diff --git a/pkgs/stdenv/cross/default.nix b/pkgs/stdenv/cross/default.nix index bf410ec0a6841..394bc68f2e301 100644 --- a/pkgs/stdenv/cross/default.nix +++ b/pkgs/stdenv/cross/default.nix @@ -52,7 +52,8 @@ in lib.init bootStages ++ [ # Prior overrides are surely not valid as packages built with this run on # a different platform, and so are disabled. overrides = _: _: {}; - extraBuildInputs = [ ] # Old ones run on wrong platform + extraBuildInputs = [ ]; # Old ones run on wrong platform + extraDepsHostTarget = [ ] # Old ones run on wrong platform ++ lib.optionals hostPlatform.isDarwin [ buildPackages.targetPackages.darwin.apple_sdk.frameworks.CoreFoundation ] ; allowedRequisites = null; @@ -75,7 +76,7 @@ in lib.init bootStages ++ [ then buildPackages.llvmPackages.clangUseLLVM else buildPackages.gcc; - extraNativeBuildInputs = old.extraNativeBuildInputs + extraDepsBuildHost = old.extraDepsBuildHost ++ lib.optionals (hostPlatform.isLinux && !buildPlatform.isLinux) [ buildPackages.patchelf ] diff --git a/pkgs/stdenv/generic/builder.sh b/pkgs/stdenv/generic/builder.sh index 2d8d784982a80..7f2c85c5c02ac 100644 --- a/pkgs/stdenv/generic/builder.sh +++ b/pkgs/stdenv/generic/builder.sh @@ -9,8 +9,8 @@ mkdir $out { echo "export SHELL=$shell" echo "initialPath=\"$initialPath\"" - echo "defaultNativeBuildInputs=\"$defaultNativeBuildInputs\"" - echo "defaultBuildInputs=\"$defaultBuildInputs\"" + echo "defaultDepsBuildHost=\"$defaultDepsBuildHost\"" + echo "defaultDepsHostTarget=\"$defaultDepsHostTarget\"" echo "$preHook" cat "$setup" } > "$out/setup" diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index cf194be92bd75..c51216348bb5d 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -21,6 +21,8 @@ argsStdenv@{ name ? "stdenv", preHook ? "", initialPath , extraNativeBuildInputs ? [] , extraBuildInputs ? [] +, extraDepsBuildHost ? [] +, extraDepsHostTarget ? [] , __stdenvImpureHostDeps ? [] , __extraImpureHostDeps ? [] , stdenvSandboxProfile ? "" @@ -56,7 +58,7 @@ argsStdenv@{ name ? "stdenv", preHook ? "", initialPath }: let - defaultNativeBuildInputs = extraNativeBuildInputs ++ + defaultDepsBuildHost = extraDepsBuildHost ++ extraNativeBuildInputs ++ [ ../../build-support/setup-hooks/audit-tmpdir.sh ../../build-support/setup-hooks/compress-man-pages.sh @@ -73,7 +75,7 @@ let ../../build-support/setup-hooks/strip.sh ] ++ lib.optionals hasCC [ cc ]; - defaultBuildInputs = extraBuildInputs; + defaultDepsHostTarget = extraDepsHostTarget ++ extraBuildInputs; stdenv = (stdenv-overridable argsStdenv); @@ -82,7 +84,7 @@ let derivation ( lib.optionalAttrs (allowedRequisites != null) { allowedRequisites = allowedRequisites - ++ defaultNativeBuildInputs ++ defaultBuildInputs; + ++ defaultDepsBuildHost ++ defaultDepsHostTarget; } // lib.optionalAttrs config.contentAddressedByDefault { __contentAddressed = true; @@ -124,7 +126,7 @@ let ; inherit initialPath shell - defaultNativeBuildInputs defaultBuildInputs; + defaultDepsBuildHost defaultDepsHostTarget; } // lib.optionalAttrs buildPlatform.isDarwin { __sandboxProfile = stdenvSandboxProfile; @@ -140,7 +142,8 @@ let inherit buildPlatform hostPlatform targetPlatform; - inherit extraNativeBuildInputs extraBuildInputs + inherit extraDepsBuildHost extraDepsHostTarget + extraNativeBuildInputs extraBuildInputs __extraImpureHostDeps extraSandboxProfile; # Utility flags to test the type of platform. diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 6cb494d46e5f2..d613d43c19637 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -91,6 +91,8 @@ let , depsBuildBuildPropagated ? [] # -1 -> -1 , nativeBuildInputs ? [] # -1 -> 0 N.B. Legacy name , propagatedNativeBuildInputs ? [] # -1 -> 0 N.B. Legacy name +, depsBuildHost ? [] # -1 -> 0 +, depsBuildHostPropagated ? [] # -1 -> 0 , depsBuildTarget ? [] # -1 -> 1 , depsBuildTargetPropagated ? [] # -1 -> 1 @@ -98,6 +100,8 @@ let , depsHostHostPropagated ? [] # 0 -> 0 , buildInputs ? [] # 0 -> 1 N.B. Legacy name , propagatedBuildInputs ? [] # 0 -> 1 N.B. Legacy name +, depsHostTarget ? [] # 0 -> 1 N.B. +, depsHostTargetPropagated ? [] # 0 -> 1 N.B. , depsTargetTarget ? [] # 1 -> 1 , depsTargetTargetPropagated ? [] # 1 -> 1 @@ -184,6 +188,7 @@ let noNonNativeDeps = builtins.length (depsBuildTarget ++ depsBuildTargetPropagated ++ depsHostHost ++ depsHostHostPropagated ++ buildInputs ++ propagatedBuildInputs + ++ depsBuildTarget ++ depsBuildTargetPropagated ++ depsTargetTarget ++ depsTargetTargetPropagated) == 0; dontAddHostSuffix = attrs ? outputHash && !noNonNativeDeps || !stdenv.hasCC; @@ -224,10 +229,10 @@ then abort ("mkDerivation was called with unsupported hardening flags: " + lib.g else let doCheck = doCheck'; doInstallCheck = doInstallCheck'; - buildInputs' = buildInputs + depsHostTarget' = depsHostTarget ++ buildInputs ++ lib.optionals doCheck checkInputs ++ lib.optionals doInstallCheck installCheckInputs; - nativeBuildInputs' = nativeBuildInputs + depsBuildHost' = depsBuildHost ++ nativeBuildInputs ++ lib.optional separateDebugInfo' ../../build-support/setup-hooks/separate-debug-info.sh ++ lib.optional stdenv.hostPlatform.isWindows ../../build-support/setup-hooks/win-dll-link.sh ++ lib.optionals doCheck nativeCheckInputs @@ -235,18 +240,18 @@ else let outputs = outputs'; - references = nativeBuildInputs ++ buildInputs - ++ propagatedNativeBuildInputs ++ propagatedBuildInputs; + references = depsBuildHost ++ nativeBuildInputs ++ depsHostTarget ++ buildInputs + ++ depsBuildHostPropagated ++ propagatedNativeBuildInputs ++ depsHostTargetPropagated ++ propagatedBuildInputs; dependencies = map (map lib.chooseDevOutputs) [ [ (map (drv: drv.__spliced.buildBuild or drv) (checkDependencyList "depsBuildBuild" depsBuildBuild)) - (map (drv: drv.__spliced.buildHost or drv) (checkDependencyList "nativeBuildInputs" nativeBuildInputs')) + (map (drv: drv.__spliced.buildHost or drv) (checkDependencyList "depsBuildHost/nativeBuildInputs" depsBuildHost')) (map (drv: drv.__spliced.buildTarget or drv) (checkDependencyList "depsBuildTarget" depsBuildTarget)) ] [ (map (drv: drv.__spliced.hostHost or drv) (checkDependencyList "depsHostHost" depsHostHost)) - (map (drv: drv.__spliced.hostTarget or drv) (checkDependencyList "buildInputs" buildInputs')) + (map (drv: drv.__spliced.hostTarget or drv) (checkDependencyList "depsHostTarget/buildInputs" depsHostTarget')) ] [ (map (drv: drv.__spliced.targetTarget or drv) (checkDependencyList "depsTargetTarget" depsTargetTarget)) @@ -255,12 +260,12 @@ else let propagatedDependencies = map (map lib.chooseDevOutputs) [ [ (map (drv: drv.__spliced.buildBuild or drv) (checkDependencyList "depsBuildBuildPropagated" depsBuildBuildPropagated)) - (map (drv: drv.__spliced.buildHost or drv) (checkDependencyList "propagatedNativeBuildInputs" propagatedNativeBuildInputs)) + (map (drv: drv.__spliced.buildHost or drv) (checkDependencyList "depsBuildHostPropagated/propagatedNativeBuildInputs" (depsBuildHostPropagated ++ propagatedNativeBuildInputs))) (map (drv: drv.__spliced.buildTarget or drv) (checkDependencyList "depsBuildTargetPropagated" depsBuildTargetPropagated)) ] [ (map (drv: drv.__spliced.hostHost or drv) (checkDependencyList "depsHostHostPropagated" depsHostHostPropagated)) - (map (drv: drv.__spliced.hostTarget or drv) (checkDependencyList "propagatedBuildInputs" propagatedBuildInputs)) + (map (drv: drv.__spliced.hostTarget or drv) (checkDependencyList "depsHostTargetPropagated/propagatedBuildInputs" (depsHostTargetPropagated ++ propagatedBuildInputs))) ] [ (map (drv: drv.__spliced.targetTarget or drv) (checkDependencyList "depsTargetTargetPropagated" depsTargetTargetPropagated)) @@ -344,16 +349,20 @@ else let depsBuildBuild = lib.elemAt (lib.elemAt dependencies 0) 0; nativeBuildInputs = lib.elemAt (lib.elemAt dependencies 0) 1; + depsBuildHost = lib.elemAt (lib.elemAt dependencies 0) 1; depsBuildTarget = lib.elemAt (lib.elemAt dependencies 0) 2; depsHostHost = lib.elemAt (lib.elemAt dependencies 1) 0; buildInputs = lib.elemAt (lib.elemAt dependencies 1) 1; + depsHostTarget = lib.elemAt (lib.elemAt dependencies 1) 1; depsTargetTarget = lib.elemAt (lib.elemAt dependencies 2) 0; depsBuildBuildPropagated = lib.elemAt (lib.elemAt propagatedDependencies 0) 0; propagatedNativeBuildInputs = lib.elemAt (lib.elemAt propagatedDependencies 0) 1; + depsBuildHostPropagated = lib.elemAt (lib.elemAt propagatedDependencies 0) 1; depsBuildTargetPropagated = lib.elemAt (lib.elemAt propagatedDependencies 0) 2; depsHostHostPropagated = lib.elemAt (lib.elemAt propagatedDependencies 1) 0; propagatedBuildInputs = lib.elemAt (lib.elemAt propagatedDependencies 1) 1; + depsHostTargetPropagated = lib.elemAt (lib.elemAt propagatedDependencies 1) 1; depsTargetTargetPropagated = lib.elemAt (lib.elemAt propagatedDependencies 2) 0; # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 734abb890c24f..a845bc78fea32 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -611,10 +611,12 @@ findInputs() { # Make sure all are at least defined as empty : "${depsBuildBuild=}" "${depsBuildBuildPropagated=}" -: "${nativeBuildInputs=}" "${propagatedNativeBuildInputs=}" "${defaultNativeBuildInputs=}" +: "${nativeBuildInputs=}" "${propagatedNativeBuildInputs=}" +: "${depsBuildHost=}" "${depsBuildHostPropagated=}" "${defaultDepsBuildHost=}" : "${depsBuildTarget=}" "${depsBuildTargetPropagated=}" : "${depsHostHost=}" "${depsHostHostPropagated=}" -: "${buildInputs=}" "${propagatedBuildInputs=}" "${defaultBuildInputs=}" +: "${buildInputs=}" "${propagatedBuildInputs=}" +: "${depsHostTargetPropagated=}" "${depsHostTarget=}" "${defaultDepsHostTarget=}" : "${depsTargetTarget=}" "${depsTargetTargetPropagated=}" for pkg in ${depsBuildBuild[@]} ${depsBuildBuildPropagated[@]}; do @@ -623,6 +625,9 @@ done for pkg in ${nativeBuildInputs[@]} ${propagatedNativeBuildInputs[@]}; do findInputs "$pkg" -1 0 done +for pkg in ${depsBuildHost[@]} ${depsBuildHostPropagated[@]}; do + findInputs "$pkg" -1 0 +done for pkg in ${depsBuildTarget[@]} ${depsBuildTargetPropagated[@]}; do findInputs "$pkg" -1 1 done @@ -632,14 +637,17 @@ done for pkg in ${buildInputs[@]} ${propagatedBuildInputs[@]} ; do findInputs "$pkg" 0 1 done +for pkg in ${depsHostTarget[@]} ${depsHostTargetPropagated[@]} ; do + findInputs "$pkg" 0 1 +done for pkg in ${depsTargetTarget[@]} ${depsTargetTargetPropagated[@]}; do findInputs "$pkg" 1 1 done # Default inputs must be processed last -for pkg in ${defaultNativeBuildInputs[@]}; do +for pkg in ${defaultDepsBuildHost[@]}; do findInputs "$pkg" -1 0 done -for pkg in ${defaultBuildInputs[@]}; do +for pkg in ${defaultDepsHostTarget[@]}; do findInputs "$pkg" 0 1 done From 63fa336ab7a64cc44ad051b54488d171ba1eed0c Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 23 Apr 2023 15:54:17 -0700 Subject: [PATCH 2/3] stdenv: s/extraNativeBuildInputs/extraDepsBuildHost/ --- pkgs/stdenv/darwin/default.nix | 32 ++++++++++++++++---------------- pkgs/stdenv/linux/default.nix | 12 ++++++------ pkgs/stdenv/native/default.nix | 12 ++++++------ 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 6cc6271eedbe6..6fc4ec70c3987 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -84,8 +84,8 @@ rec { stageFun = step: last: { shell ? "${bootstrapTools}/bin/bash" , overrides ? (self: super: { }) , extraPreHook ? "" - , extraNativeBuildInputs - , extraBuildInputs + , extraDepsBuildHost + , extraDepsHostTarget , libcxx , allowedRequisites ? null }: @@ -148,9 +148,9 @@ rec { thisStdenv = import ../generic { name = "${name}-stdenv-darwin"; - inherit config shell extraBuildInputs; + inherit config shell extraDepsHostTarget; - extraNativeBuildInputs = extraNativeBuildInputs ++ lib.optionals doUpdateAutoTools [ + extraDepsBuildHost = extraDepsBuildHost ++ lib.optionals doUpdateAutoTools [ last.pkgs.updateAutotoolsGnuConfigScriptsHook last.pkgs.gnu-config ]; @@ -364,8 +364,8 @@ rec { }; }; - extraNativeBuildInputs = [ ]; - extraBuildInputs = [ ]; + extraDepsBuildHost = [ ]; + extraDepsHostTarget = [ ]; libcxx = null; }; @@ -411,8 +411,8 @@ rec { in with prevStage; stageFun 1 prevStage { extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\""; - extraNativeBuildInputs = [ ]; - extraBuildInputs = [ pkgs.darwin.CF ]; + extraDepsBuildHost = [ ]; + extraDepsHostTarget = [ pkgs.darwin.CF ]; libcxx = pkgs."${finalLlvmPackages}".libcxx; allowedRequisites = @@ -469,8 +469,8 @@ rec { export PATH_LOCALE=${pkgs.darwin.locale}/share/locale ''; - extraNativeBuildInputs = [ pkgs.xz ]; - extraBuildInputs = [ pkgs.darwin.CF ]; + extraDepsBuildHost = [ pkgs.xz ]; + extraDepsHostTarget = [ pkgs.darwin.CF ]; libcxx = pkgs."${finalLlvmPackages}".libcxx; allowedRequisites = @@ -539,8 +539,8 @@ rec { # enables patchShebangs above. Unfortunately, patchShebangs ignores our $SHELL setting # and instead goes by $PATH, which happens to contain bootstrapTools. So it goes and # patches our shebangs back to point at bootstrapTools. This makes sure bash comes first. - extraNativeBuildInputs = with pkgs; [ xz ]; - extraBuildInputs = [ pkgs.darwin.CF pkgs.bash ]; + extraDepsBuildHost = with pkgs; [ xz ]; + extraDepsHostTarget = [ pkgs.darwin.CF pkgs.bash ]; libcxx = pkgs."${finalLlvmPackages}".libcxx; extraPreHook = '' @@ -625,8 +625,8 @@ rec { in with prevStage; stageFun 4 prevStage { shell = "${pkgs.bash}/bin/bash"; - extraNativeBuildInputs = with pkgs; [ xz ]; - extraBuildInputs = [ pkgs.darwin.CF pkgs.bash ]; + extraDepsBuildHost = with pkgs; [ xz ]; + extraDepsHostTarget = [ pkgs.darwin.CF pkgs.bash ]; libcxx = pkgs."${finalLlvmPackages}".libcxx; extraPreHook = '' @@ -692,11 +692,11 @@ rec { cc = pkgs."${finalLlvmPackages}".libcxxClang; - extraNativeBuildInputs = lib.optionals localSystem.isAarch64 [ + extraDepsBuildHost = lib.optionals localSystem.isAarch64 [ pkgs.updateAutotoolsGnuConfigScriptsHook ]; - extraBuildInputs = [ pkgs.darwin.CF ]; + extraDepsHostTarget = [ pkgs.darwin.CF ]; extraAttrs = { libc = pkgs.darwin.Libsystem; diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index e227b6850773c..677c0728acb72 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -156,7 +156,7 @@ let # the bootstrap. In all stages, we build an stdenv and the package # set that can be built with that stdenv. stageFun = prevStage: - { name, overrides ? (self: super: {}), extraNativeBuildInputs ? [] }: + { name, overrides ? (self: super: {}), extraDepsBuildHost ? [] }: let @@ -165,7 +165,7 @@ let buildPlatform = localSystem; hostPlatform = localSystem; targetPlatform = localSystem; - inherit config extraNativeBuildInputs; + inherit config extraDepsBuildHost; preHook = '' # Don't patch #!/interpreter because it leads to retained @@ -469,7 +469,7 @@ in }; # `libtool` comes with obsolete config.sub/config.guess that don't recognize Risc-V. - extraNativeBuildInputs = + extraDepsBuildHost = lib.optional (localSystem.isRiscV) prevStage.updateAutotoolsGnuConfigScriptsHook; }) @@ -507,7 +507,7 @@ in passthru = a.passthru // { inherit (self) gmp mpfr libmpc isl; }; }); }; - extraNativeBuildInputs = [ prevStage.patchelf ] ++ + extraDepsBuildHost = [ prevStage.patchelf ] ++ # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. lib.optional (!localSystem.isx86 || localSystem.libc == "musl") prevStage.updateAutotoolsGnuConfigScriptsHook; @@ -562,7 +562,7 @@ in shell = self.bash + "/bin/bash"; }; }; - extraNativeBuildInputs = [ prevStage.patchelf prevStage.xz ] ++ + extraDepsBuildHost = [ prevStage.patchelf prevStage.xz ] ++ # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. lib.optional (!localSystem.isx86 || localSystem.libc == "musl") prevStage.updateAutotoolsGnuConfigScriptsHook; @@ -599,7 +599,7 @@ in initialPath = ((import ../generic/common-path.nix) {pkgs = prevStage;}); - extraNativeBuildInputs = [ prevStage.patchelf ] ++ + extraDepsBuildHost = [ prevStage.patchelf ] ++ # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. lib.optional (!localSystem.isx86 || localSystem.libc == "musl") prevStage.updateAutotoolsGnuConfigScriptsHook; diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix index bae4ff2c93b26..719fcc18caad2 100644 --- a/pkgs/stdenv/native/default.nix +++ b/pkgs/stdenv/native/default.nix @@ -66,7 +66,7 @@ let export lt_cv_deplibs_check_method=pass_all ''; - extraNativeBuildInputsCygwin = [ + extraDepsBuildHostCygwin = [ ../cygwin/all-buildinputs-as-runtimedep.sh ../cygwin/wrap-exes-to-find-dlls.sh ] ++ (if system == "i686-cygwin" then [ @@ -78,7 +78,7 @@ let # A function that builds a "native" stdenv (one that uses tools in # /usr etc.). makeStdenv = - { cc, fetchurl, extraPath ? [], overrides ? (self: super: { }), extraNativeBuildInputs ? [] }: + { cc, fetchurl, extraPath ? [], overrides ? (self: super: { }), extraDepsBuildHost ? [] }: import ../generic { buildPlatform = localSystem; @@ -94,9 +94,9 @@ let if system == "x86_64-cygwin" then prehookCygwin else prehookBase; - extraNativeBuildInputs = extraNativeBuildInputs ++ - (if system == "i686-cygwin" then extraNativeBuildInputsCygwin else - if system == "x86_64-cygwin" then extraNativeBuildInputsCygwin else + extraDepsBuildHost = extraDepsBuildHost ++ + (if system == "i686-cygwin" then extraDepsBuildHostCygwin else + if system == "x86_64-cygwin" then extraDepsBuildHostCygwin else []); initialPath = extraPath ++ path; @@ -163,7 +163,7 @@ in inherit (prevStage.stdenv) cc fetchurl; extraPath = [ prevStage.xz ]; overrides = self: super: { inherit (prevStage) xz; }; - extraNativeBuildInputs = if localSystem.isLinux then [ prevStage.patchelf ] else []; + extraDepsBuildHost = if localSystem.isLinux then [ prevStage.patchelf ] else []; }; }) From f6bb114cc18db2ee443d1785ac34579b62ab1f5f Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 23 Apr 2023 16:13:03 -0700 Subject: [PATCH 3/3] make-derivation: update dependency set names in computed{ImpureHostDeps,SandboxProfile} --- pkgs/stdenv/generic/make-derivation.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index d613d43c19637..bc2916bd82777 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -274,8 +274,8 @@ else let computedSandboxProfile = lib.concatMap (input: input.__propagatedSandboxProfile or []) - (stdenv.extraNativeBuildInputs - ++ stdenv.extraBuildInputs + (stdenv.extraDepsBuildHost + ++ stdenv.extraDepsHostTarget ++ lib.concatLists dependencies); computedPropagatedSandboxProfile = @@ -284,8 +284,8 @@ else let computedImpureHostDeps = lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) - (stdenv.extraNativeBuildInputs - ++ stdenv.extraBuildInputs + (stdenv.extraDepsBuildHost + ++ stdenv.extraDepsHostTarget ++ lib.concatLists dependencies)); computedPropagatedImpureHostDeps =