From 4d8c66ec6fee1f476c495297c48e3167fd6378ed Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Tue, 9 Jul 2024 22:49:10 +0200 Subject: [PATCH 1/2] add aarch64-linux as a cross-build target we want to be sure we can cross-build to aarch64 for releases, add a target to our crossSystems list to make those cheacks easier to run. Change-Id: Ieb65c1333a5232641ace0ba4d122fc7d528ebc04 --- doc/manual/src/contributing/hacking.md | 1 + flake.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/manual/src/contributing/hacking.md b/doc/manual/src/contributing/hacking.md index 8577a6a2e..37c96a5c0 100644 --- a/doc/manual/src/contributing/hacking.md +++ b/doc/manual/src/contributing/hacking.md @@ -175,6 +175,7 @@ These are specified in `crossSystems` in `flake.nix`; feel free to submit change - `armv6l-linux` - `armv7l-linux` +- `aarch64-linux` - `riscv64-linux` For example, to cross-compile Lix for `armv6l-linux` from another Linux, use the following: diff --git a/flake.nix b/flake.nix index d2eefca76..2b8c95f70 100644 --- a/flake.nix +++ b/flake.nix @@ -90,6 +90,7 @@ "armv6l-linux" "armv7l-linux" "riscv64-linux" + "aarch64-linux" # FIXME: still broken in 24.05: fails to build rustc(??) due to missing -lstdc++ dep # "x86_64-freebsd" # FIXME: broken dev shell due to python From f5aa5b6815e6cd9194c7dec03651066e4cab5783 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Tue, 9 Jul 2024 22:50:51 +0200 Subject: [PATCH 2/2] releng: add releaseTests flake output, test script this is supposed to be a set of outputs we want to always succeed for releases. sadly we can't add nixos installer tests using lix to these because the nixos test framework does not allow overriding nix in the installer test suites due to unfortunate oversights in the framework. Change-Id: I815520181ccca70a47205d38ba27e73529347f04 --- flake.nix | 19 +++++++++++++++++++ releng/release-tests.sh | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100755 releng/release-tests.sh diff --git a/flake.nix b/flake.nix index 2b8c95f70..c29111ed2 100644 --- a/flake.nix +++ b/flake.nix @@ -329,6 +329,25 @@ pkgs = nixpkgsFor.x86_64-linux.native; }; + releaseTests = lib.foldl lib.recursiveUpdate { } [ + (lib.genAttrs (linux64BitSystems ++ darwinSystems) (system: { + nativeBuild = self.packages.${system}.nix; + })) + (lib.genAttrs (linux64BitSystems) (system: { + staticBuild = self.packages.${system}.nix-static; + })) + { + x86_64-linux = { + # TODO add more cross/static release targets? + crossBuild.aarch64-linux = self.packages.x86_64-linux.nix-aarch64-linux; + + # TODO wire up a nixos installer test with that lix and + # run it, once nixpkgs can actually do that (again). :/ + # # nix build .#nixosTests.installer.{btrfsSimple,luksroot,lvm,simple,switchToFlake} + }; + } + ]; + # NOTE *do not* add fresh derivations to checks, always add them to # hydraJobs first (so CI will pick them up) and only link them here checks = forAvailableSystems ( diff --git a/releng/release-tests.sh b/releng/release-tests.sh new file mode 100755 index 000000000..c0a9b2e33 --- /dev/null +++ b/releng/release-tests.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -euo pipefail +shopt -s inherit_errexit failglob + +nixpkgss=( + "$(nix eval --impure --raw --expr '(import ./flake.nix).inputs.nixpkgs.url')" + "github:NixOS/nixpkgs/nixos-unstable-small" +) +jobs=( + $(nix eval \ + --json --apply ' + let f = n: t: + if builtins.isAttrs t + then (if t.type or "" == "derivation" + then [ n ] + else builtins.concatMap (m: f "${n}.${m}" t.${m}) (builtins.attrNames t)) + else []; + in f ".#.releaseTests" + ' \ + '.#.releaseTests' \ + | jq -r '.[]' + ) +) + +for override in "${nixpkgss}" +do + ( + set -x + nix build \ + --log-format multiline \ + --no-link \ + --override-input nixpkgs "$override" \ + "${jobs[@]}" + ) +done