about summary refs log tree commit diff
path: root/pkgs/top-level/release-cross.nix
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-05-06 23:19:49 -0700
committerAdam Joseph <adam@westernsemico.com>2023-05-07 00:11:56 -0700
commit5838729f9e97689554d994fe59521f9a2ea35ce1 (patch)
treea0970619a66e7c1a720dbdf13ae6ee34dcda1071 /pkgs/top-level/release-cross.nix
parent78963777a40a63333520c5c8f4567b4059b68c4d (diff)
downloadnixlib-5838729f9e97689554d994fe59521f9a2ea35ce1.tar
nixlib-5838729f9e97689554d994fe59521f9a2ea35ce1.tar.gz
nixlib-5838729f9e97689554d994fe59521f9a2ea35ce1.tar.bz2
nixlib-5838729f9e97689554d994fe59521f9a2ea35ce1.tar.lz
nixlib-5838729f9e97689554d994fe59521f9a2ea35ce1.tar.xz
nixlib-5838729f9e97689554d994fe59521f9a2ea35ce1.tar.zst
nixlib-5838729f9e97689554d994fe59521f9a2ea35ce1.zip
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
Diffstat (limited to 'pkgs/top-level/release-cross.nix')
-rw-r--r--pkgs/top-level/release-cross.nix5
1 files 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;