diff --git a/flake.nix b/flake.nix index 1366a697f..9786cbaba 100644 --- a/flake.nix +++ b/flake.nix @@ -479,7 +479,10 @@ } // ( lib.optionalAttrs (builtins.elem system linux64BitSystems) { - nix-static = nixpkgsFor.${system}.static.nix; + # python doesn't work in static builds as of 2025-06-27 + nix-static = nixpkgsFor.${system}.static.nix.overrideAttrs (_: { + doCheck = false; + }); dockerImage = let pkgs = nixpkgsFor.${system}.native; diff --git a/package.nix b/package.nix index f1fd1b1f9..fb3d15f81 100644 --- a/package.nix +++ b/package.nix @@ -196,21 +196,26 @@ let ./tests/unit (fileset.fileFilter (f: lib.strings.hasPrefix "nix-profile" f.name) ./scripts) ]; - - # python3.withPackages does not splice properly, see https://github.com/NixOS/nixpkgs/issues/305858 - lixPythonForBuild = python3.pythonOnBuildForHost.withPackages (p: [ - p.pytest - p.pytest-xdist - p.ruff - p.python-frontmatter - p.aiohttp - p.toml - ]); in assert (lintInsteadOfBuild -> lix-clang-tidy != null); stdenv.mkDerivation (finalAttrs: { inherit pname version; + # python3.withPackages does not splice properly, see https://github.com/NixOS/nixpkgs/issues/305858 + lixPythonForBuild = python3.pythonOnBuildForHost.withPackages ( + p: + [ + p.python-frontmatter + ] + ++ lib.optionals finalAttrs.doCheck [ + p.pytest + p.pytest-xdist + p.ruff + p.aiohttp + p.toml + ] + ); + src = fileset.toSource { root = ./.; fileset = fileset.intersection baseFiles ( @@ -279,7 +284,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ - lixPythonForBuild + finalAttrs.lixPythonForBuild meson ninja cmake @@ -336,6 +341,10 @@ stdenv.mkDerivation (finalAttrs: { capnproto-lix dtrace-headers ] + # NOTE(Raito): I'd have expected that the LLVM packaging would inject the + # libunwind library path directly in the wrappers, but it does inject + # -lunwind without injecting the library path... + ++ lib.optionals stdenv.hostPlatform.isStatic [ llvmPackages.libunwind ] ++ lib.optionals hostPlatform.isLinux [ libseccomp busybox-sandbox-shell @@ -363,7 +372,7 @@ stdenv.mkDerivation (finalAttrs: { disallowedReferences = [ boost buildPackages.python3 - lixPythonForBuild + finalAttrs.lixPythonForBuild ]; # Needed for Meson to find Boost.