From 5838729f9e97689554d994fe59521f9a2ea35ce1 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sat, 6 May 2023 23:19:49 -0700 Subject: [PATCH] release-cross.nix: fix the fix in #188339 The `bootstrapTools.bootstrapTools` attribute, which *unpacks* the bootstrapFiles, lies about its `system`: https://github.com/NixOS/nixpkgs/blob/78963777a40a63333520c5c8f4567b4059b68c4d/pkgs/stdenv/linux/make-bootstrap-tools.nix#L236 Unfortunately because of this, when building `bootstrapTools.*`, Hydra will try to execute the cross-compiled bootstrapFiles' `busybox` on the wrong architecture, and fail. I originally submitted a fix for this, by filtering out the `.bootstrapTools` attribute, in https://github.com/NixOS/nixpkgs/pull/188339 Unfortunately my fix filtered at the wrong level of the attrset hierarchy, and neglected to filter the `test` attribute as well. This PR corrects those mistakes --- pkgs/top-level/release-cross.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix index 663c35335df2..cecf9e8fbe33 100644 --- a/pkgs/top-level/release-cross.nix +++ b/pkgs/top-level/release-cross.nix @@ -242,8 +242,9 @@ in # so it will fail unless buildPlatform.canExecute hostPlatform. # Unfortunately `bootstrapTools` also clobbers its own `system` # attribute, so there is no way to detect this -- we must add it - # as a special case. - (builtins.removeAttrs tools ["bootstrapTools"]); + # as a special case. We filter the "test" attribute (only from + # *cross*-built bootstrapTools) for the same reason. + (builtins.mapAttrs (_: v: builtins.removeAttrs v ["bootstrapTools" "test"]) tools); # Cross-built nixStatic for platforms for enabled-but-unsupported platforms mips64el-nixCrossStatic = mapTestOnCross lib.systems.examples.mips64el-linux-gnuabi64 nixCrossStatic;