From 51ba23371779e1018fc89573f94ca414c09c4e61 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Wed, 17 Aug 2022 13:40:33 -0700 Subject: [PATCH 1/2] pkgs/stdenv/linux: bootstrap-files for third (and final) mips ABI: n32 This PR provides the Hydra-generated bootstrap tarballs for mips64el-linux-gnuabin32. With this PR we now have the bootstrap-file for all three little-endian ABIs on mips: n64, n32, and o32. I do not currently plan to do big-endian mips unless some motivation arises; all mips chips are bi-endian and Debian has dropped big-endian support due to lack of interest. I'll be following the script used in #151399, #168199, and #183487. Files came from [this](https://hydra.nixos.org/build/188389586#tabs-summary) Hydra build, which used nixpkgs revision 97d9c84e1df4397b43ecb39359f1bd003cd44585 to instantiate: ``` /nix/store/hakn8s85s9011v61r6svp5qy8x1y64fv-stdenv-bootstrap-tools-mips64el-unknown-linux-gnuabin32.drv ``` and then built: ``` /nix/store/rjgybpnf3yiqyhvl2n2lx31jf800fii2-stdenv-bootstrap-tools-mips64el-unknown-linux-gnuabin32 ``` I downloaded these files from Hydra and prefetched them into the nix store with the following commands: ``` STOREPATH=rjgybpnf3yiqyhvl2n2lx31jf800fii2-stdenv-bootstrap-tools-mips64el-unknown-linux-gnuabin32 OPTIONS="--option binary-caches https://cache.nixos.org --option trusted-public-keys cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" nix store prefetch-file \ file://$(nix store add-file --name bootstrap-tools.tar.xz $(nix-store ${OPTIONS} -r /nix/store/${STOREPATH})/on-server/bootstrap-tools.tar.xz) nix store prefetch-file --executable \ file://$(nix store add-path --name busybox $(nix-store ${OPTIONS} -r /nix/store/${STOREPATH})/on-server/busybox) ``` These commands produced the following output: ``` Downloaded 'file:///nix/store/w6zzd2fx2vhmjfcf5h5zc01m0swldpbw-bootstrap-tools.tar.xz' to '/nix/store/6w0f0mqblrghvh6yjwcb4xdqq9x50lbl-w6zzd2fx2vhmjfcf5h5zc01m0swldpbw-bootstrap-tools.tar.xz' (hash 'sha256-LWrpN6su2yNVurUyhZP34OiZyzgh7MfN13fIIbou8KI='). Downloaded 'file:///nix/store/nqagw1kgdz1zlmqi00qfjrmwqk3g3bgd-busybox' to '/nix/store/i361xhbdhhnvg7zd637xpm63vbl80s0s-nqagw1kgdz1zlmqi00qfjrmwqk3g3bgd-busybox' (hash 'sha256-4N3G1qYA7vitjhsIW17pR6UixIuzrq4vZXa8F0/X4iI='). ``` I used the hashes from the output above to create the `fetchurl` invocation which is part of this commit. I then started the bootstrap with the following command: ``` nix build -L -f . --arg localSystem '(import ./lib).systems.examples.mips64el-linux-gnuabin32' hello ``` As @lovesegfault requested, here are the the `sha256sum`s of all the `on-server` components for extra verification: ``` sha256sum /nix/store/${STOREPATH}/on-server/* ``` which produced the following output: ``` 2d6ae937ab2edb2355bab5328593f7e0e899cb3821ecc7cdd777c821ba2ef0a2 /nix/store/rjgybpnf3yiqyhvl2n2lx31jf800fii2-stdenv-bootstrap-tools-mips64el-unknown-linux-gnuabin32/on-server/bootstrap-tools.tar.xz 01633f71135cb9ab1b5ce3ebb67e80cbf288739729bffc1350c1552f6f8df34b /nix/store/rjgybpnf3yiqyhvl2n2lx31jf800fii2-stdenv-bootstrap-tools-mips64el-unknown-linux-gnuabin32/on-server/busybox ``` --- .../linux/bootstrap-files/mips64el-n32.nix | 25 +++++++++++++++++++ pkgs/stdenv/linux/default.nix | 5 +++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 pkgs/stdenv/linux/bootstrap-files/mips64el-n32.nix diff --git a/pkgs/stdenv/linux/bootstrap-files/mips64el-n32.nix b/pkgs/stdenv/linux/bootstrap-files/mips64el-n32.nix new file mode 100644 index 000000000000..9a28f8117bbc --- /dev/null +++ b/pkgs/stdenv/linux/bootstrap-files/mips64el-n32.nix @@ -0,0 +1,25 @@ +# +# Files came from this Hydra build: +# +# https://hydra.nixos.org/build/188389586 +# +# Which used nixpkgs revision 97d9c84e1df4397b43ecb39359f1bd003cd44585 +# to instantiate: +# +# /nix/store/hakn8s85s9011v61r6svp5qy8x1y64fv-stdenv-bootstrap-tools-mips64el-unknown-linux-gnuabin32.drv +# +# and then built: +# +# /nix/store/rjgybpnf3yiqyhvl2n2lx31jf800fii2-stdenv-bootstrap-tools-mips64el-unknown-linux-gnuabin32 +# +{ + busybox = import { + url = "http://tarballs.nixos.org/stdenv-linux/mips64el/97d9c84e1df4397b43ecb39359f1bd003cd44585/busybox"; + sha256 = "sha256-4N3G1qYA7vitjhsIW17pR6UixIuzrq4vZXa8F0/X4iI="; + executable = true; + }; + bootstrapTools = import { + url = "http://tarballs.nixos.org/stdenv-linux/mips64el/97d9c84e1df4397b43ecb39359f1bd003cd44585/bootstrap-tools.tar.xz"; + sha256 = "sha256-LWrpN6su2yNVurUyhZP34OiZyzgh7MfN13fIIbou8KI="; + }; +} diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 6e61b6f12be1..856280864f4b 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -16,7 +16,10 @@ armv7l-linux = import ./bootstrap-files/armv7l.nix; aarch64-linux = import ./bootstrap-files/aarch64.nix; mipsel-linux = import ./bootstrap-files/loongson2f.nix; - mips64el-linux = import ./bootstrap-files/mips64el.nix; + mips64el-linux = import + (if localSystem.isMips64n32 + then ./bootstrap-files/mips64el-n32.nix + else ./bootstrap-files/mips64el.nix); powerpc64le-linux = import ./bootstrap-files/powerpc64le.nix; riscv64-linux = import ./bootstrap-files/riscv64.nix; }; From 49878856e6cde3ae674f470da407e3bde2f55c9d Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 7 Mar 2023 02:11:30 -0800 Subject: [PATCH 2/2] https://github.com/NixOS/nixpkgs/pull/188334#issuecomment-1445425412 --- pkgs/stdenv/linux/bootstrap-files/mips64el-n32.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/linux/bootstrap-files/mips64el-n32.nix b/pkgs/stdenv/linux/bootstrap-files/mips64el-n32.nix index 9a28f8117bbc..cf26c2113ec8 100644 --- a/pkgs/stdenv/linux/bootstrap-files/mips64el-n32.nix +++ b/pkgs/stdenv/linux/bootstrap-files/mips64el-n32.nix @@ -14,12 +14,12 @@ # { busybox = import { - url = "http://tarballs.nixos.org/stdenv-linux/mips64el/97d9c84e1df4397b43ecb39359f1bd003cd44585/busybox"; + url = "http://tarballs.nixos.org/stdenv-linux/mips64el-n32/97d9c84e1df4397b43ecb39359f1bd003cd44585/busybox"; sha256 = "sha256-4N3G1qYA7vitjhsIW17pR6UixIuzrq4vZXa8F0/X4iI="; executable = true; }; bootstrapTools = import { - url = "http://tarballs.nixos.org/stdenv-linux/mips64el/97d9c84e1df4397b43ecb39359f1bd003cd44585/bootstrap-tools.tar.xz"; + url = "http://tarballs.nixos.org/stdenv-linux/mips64el-n32/97d9c84e1df4397b43ecb39359f1bd003cd44585/bootstrap-tools.tar.xz"; sha256 = "sha256-LWrpN6su2yNVurUyhZP34OiZyzgh7MfN13fIIbou8KI="; }; }