From 16111aa32e02fd4067483d251455193480fad580 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 21 Feb 2023 10:15:24 -0500 Subject: [PATCH] Fix `isStatic` arguments to `commonDeps` Some dependencies supposed to be skipped in the cross build, along with not using the gold linker. But in https://github.com/NixOS/nix/pull/6538 this was accidentally not preserved. Also since https://github.com/NixOS/nix/pull/6538 we saw some new aarch64-linux static build failures. This is a first attempt to try to fix those failures. If this is not sufficient, there are other things we can try next. --- flake.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index c399a5304..9baa63bd6 100644 --- a/flake.nix +++ b/flake.nix @@ -57,7 +57,11 @@ cross = forAllCrossSystems (crossSystem: make-pkgs crossSystem "stdenv"); }); - commonDeps = { pkgs, isStatic ? false }: with pkgs; rec { + commonDeps = + { pkgs + , isStatic ? pkgs.stdenv.hostPlatform.isStatic + }: + with pkgs; rec { # Use "busybox-sandbox-shell" if present, # if not (legacy) fallback and hope it's sufficient. sh = pkgs.busybox-sandbox-shell or (busybox.override { @@ -293,7 +297,13 @@ # Forward from the previous stage as we don’t want it to pick the lowdown override nixUnstable = prev.nixUnstable; - nix = with final; with commonDeps { inherit pkgs; }; let + nix = + with final; + with commonDeps { + inherit pkgs; + inherit (currentStdenv.hostPlatform) isStatic; + }; + let canRunInstalled = currentStdenv.buildPlatform.canExecute currentStdenv.hostPlatform; in currentStdenv.mkDerivation { name = "nix-${version}";