From df78d490387128c79a80e0e8345f08f793906456 Mon Sep 17 00:00:00 2001 From: eymeric Date: Mon, 29 Jun 2026 08:46:18 +0700 Subject: [PATCH] cockpit-zfs: fix build by pinning nodejs to 22 --- pkgs/by-name/co/cockpit-zfs/package.nix | 28 +++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/co/cockpit-zfs/package.nix b/pkgs/by-name/co/cockpit-zfs/package.nix index 58e5fc00e1c8..99de320d99f9 100644 --- a/pkgs/by-name/co/cockpit-zfs/package.nix +++ b/pkgs/by-name/co/cockpit-zfs/package.nix @@ -15,7 +15,7 @@ mbuffer, msmtp, nix-update-script, - nodejs, + nodejs_22, openssh, samba, shadow, @@ -27,6 +27,22 @@ yarn-berry, zfs, }: +let + # Pin to Node <24.15.0: Yarn Berry's PnP linker breaks `require.cache` on + # newer Node, which crashes tailwindcss mid-build (and ESLint, per + # yarnpkg/berry#7106). See NixOS/nixpkgs#530137. + # + # `nodejs` is rebound here (rather than touched at every call site below) + # so the rest of this file is unaffected. + # + # yarn-berry's own `yarn` binary gets patchShebang'd against whatever + # `nodejs` *it* was built with, so overriding nativeBuildInputs alone does + # nothing - we have to rebuild yarn-berry itself against nodejs_22, for + # both the host and build-platform (cross-compilation) variants. + nodejs = nodejs_22; + yarnBerry = yarn-berry.override { inherit nodejs; }; + yarnBerryForBuild = buildPackages.yarn-berry.override { nodejs = buildPackages.nodejs_22; }; +in stdenv.mkDerivation (finalAttrs: { pname = "cockpit-zfs"; @@ -49,17 +65,17 @@ stdenv.mkDerivation (finalAttrs: { missingHashes = ./missing-hashes.json; # Use buildPackages for cross-compilation support - offlineCache = buildPackages.yarn-berry.fetchYarnBerryDeps { + offlineCache = yarnBerryForBuild.fetchYarnBerryDeps { inherit (finalAttrs) src missingHashes patches; hash = "sha256-Tdxe5bXN9psSrnUXL1f+1nh4WPzuvOI7j0I+VPU2/1s="; }; nativeBuildInputs = [ makeWrapper - nodejs + nodejs_22 jq - yarn-berry - buildPackages.yarn-berry.yarnBerryConfigHook + yarnBerry + yarnBerryForBuild.yarnBerryConfigHook ]; disallowedRequisites = [ finalAttrs.offlineCache ]; @@ -76,7 +92,7 @@ stdenv.mkDerivation (finalAttrs: { lsscsi mbuffer msmtp - nodejs + nodejs_22 openssh samba shadow