From 2142bc8d338fcaa05c739016349d1acce4f4c836 Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 2 Feb 2023 18:07:55 +0200 Subject: systemd: don't reference build bash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the .install files retained references to build bash $ pwd /nix/store/yfzncfa577cbc0r1bm1fjdc1szyy0dif-systemd-aarch64-unknown-linux-gnu-252.4/lib $ tree kernel kernel ├── install.conf └── install.d ├── 50-depmod.install └── 90-loaderentry.install --- pkgs/os-specific/linux/systemd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index e871d6618c3..b1b6644a60e 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -339,7 +339,7 @@ stdenv.mkDerivation { # when cross-compiling. + '' shopt -s extglob - patchShebangs tools test src/!(rpm) + patchShebangs tools test src/!(rpm|kernel-install) src/kernel-install/test-kernel-install.sh ''; outputs = [ "out" "man" "dev" ]; -- cgit 1.4.1 From 1db242213092dc1ba1038edbe0bb5660d0fb5e00 Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 2 Feb 2023 18:57:21 +0200 Subject: systemd: disallowedReferences nativeBuildInputs add cross to passthru.tests to prevent cross breaking --- pkgs/os-specific/linux/systemd/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index b1b6644a60e..f1f6bfb6f0a 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -3,6 +3,7 @@ { stdenv , lib , nixosTests +, pkgsCross , fetchFromGitHub , fetchpatch , fetchzip @@ -63,6 +64,7 @@ , withKexectools ? lib.meta.availableOn stdenv.hostPlatform kexec-tools , kexec-tools , bashInteractive +, bash , libmicrohttpd , libfido2 , p11-kit @@ -139,7 +141,7 @@ let # jq '.created_at|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime' releaseTimestamp = "1667246393"; in -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { inherit pname version; # We use systemd/systemd-stable for src, and ship NixOS-specific patches inside nixpkgs directly @@ -362,6 +364,7 @@ stdenv.mkDerivation { docbook_xsl docbook_xml_dtd_42 docbook_xml_dtd_45 + bash (buildPackages.python3Packages.python.withPackages (ps: with ps; [ lxml jinja2 ])) ] ++ lib.optionals withLibBPF [ @@ -382,6 +385,7 @@ stdenv.mkDerivation { libuuid linuxHeaders pam + bashInteractive # for patch shebangs ] ++ lib.optional wantGcrypt libgcrypt @@ -695,6 +699,10 @@ stdenv.mkDerivation { mv $out/dont-strip-me $out/lib/systemd/boot/efi ''; + disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) + # 'or p' is for manually specified buildPackages as they dont have __spliced + (builtins.map (p: p.__spliced.buildHost or p) finalAttrs.nativeBuildInputs); + passthru = { # The interface version prevents NixOS from switching to an # incompatible systemd at runtime. (Switching across reboots is @@ -708,6 +716,7 @@ stdenv.mkDerivation { tests = { inherit (nixosTests) switchTest; + cross = pkgsCross.aarch64-multiplatform.systemd; }; }; @@ -722,4 +731,4 @@ stdenv.mkDerivation { priority = 10; maintainers = with maintainers; [ flokli kloenk mic92 ]; }; -} +}) -- cgit 1.4.1