From 8f5c8a8d758cec1a2d6320f3fba06ecdfef828e6 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Thu, 30 May 2024 18:16:01 -0600 Subject: [PATCH] flake: CI a *configure* test for static builds Adding an entire second Lix build to test the static version is too expensive for our current CI setup, but we can at least run the up to the configure phase, which is a good premise. Change-Id: I61e1ded7dd79698a9bb0f9a1d113b8b9963dfd44 --- flake.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 14ee8e1ad..397cf0eb8 100644 --- a/flake.nix +++ b/flake.nix @@ -140,10 +140,11 @@ config.permittedInsecurePackages = [ "nix-2.13.6" ]; }; stdenvs = forAllStdenvs (make-pkgs null); + static-stdenvs = forAllStdenvs (name: (make-pkgs null name).pkgsStatic); native = stdenvs.stdenvPackages; in { - inherit stdenvs native; + inherit stdenvs native static-stdenvs; static = native.pkgsStatic; cross = forAllCrossSystems (crossSystem: make-pkgs crossSystem "stdenv"); } @@ -288,6 +289,22 @@ ); }; + # Running a static build in CI for every CL is too expensive for us right now... + # But we can at least make sure it configures successfuly, which is cheap and where + # a good chunk of issues show up. + configure-static = forAvailableSystems ( + system: + let + staticConfigure = self.packages.${system}.nix-static.overrideAttrs { + dontBuild = true; + installPhase = '' + mkdir -p "$out" + ''; + }; + in + lib.optionalAttrs (self.packages.${system} ? nix-static) staticConfigure + ); + pre-commit = forAvailableSystems ( system: let @@ -316,6 +333,9 @@ // (lib.optionalAttrs (builtins.elem system linux64BitSystems)) { dockerImage = self.hydraJobs.dockerImage.${system}; } + // (lib.optionalAttrs (self.hydraJobs.configure-static ? "${system}")) { + configure-static = self.hydraJobs.configure-static.${system}; + } ); packages = forAllSystems (