From efff2acc5b10cd97cd616c617487e9652ef19a03 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Thu, 13 Jun 2024 14:11:50 -0400 Subject: [PATCH 1/2] fetchYarnDeps: properly accept src argument --- pkgs/build-support/node/fetch-yarn-deps/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/node/fetch-yarn-deps/default.nix b/pkgs/build-support/node/fetch-yarn-deps/default.nix index 7f0e0692f81f..e2724ab3a98b 100644 --- a/pkgs/build-support/node/fetch-yarn-deps/default.nix +++ b/pkgs/build-support/node/fetch-yarn-deps/default.nix @@ -97,7 +97,7 @@ in { ''; outputHashMode = "recursive"; - } // hash_ // (removeAttrs args ["src" "name" "hash" "sha256"])); + } // hash_ // (removeAttrs args (["name" "hash" "sha256"] ++ (lib.optional (src == null) "src")))); in lib.setFunctionArgs f (lib.functionArgs f) // { inherit tests; From 882cf1800592fa033666c47b5b0ce4a3435b5c64 Mon Sep 17 00:00:00 2001 From: Atemu Date: Fri, 14 Jun 2024 17:34:37 +0200 Subject: [PATCH 2/2] fetch-yarn-deps: reference files to be copied directly This would cause any drv to be rebuilt when any part of the default.nix changes. What we actually care about is the two JS files though, so simply reference them directly. Co-authored-by: Infinidoge --- pkgs/build-support/node/fetch-yarn-deps/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/node/fetch-yarn-deps/default.nix b/pkgs/build-support/node/fetch-yarn-deps/default.nix index e2724ab3a98b..4ef74c0cab88 100644 --- a/pkgs/build-support/node/fetch-yarn-deps/default.nix +++ b/pkgs/build-support/node/fetch-yarn-deps/default.nix @@ -25,7 +25,8 @@ in { tar --strip-components=1 -xf ${yarnpkg-lockfile-tar} package/index.js mv index.js $out/libexec/yarnpkg-lockfile.js - cp ${./.}/common.js ${./.}/index.js $out/libexec/ + cp ${./common.js} $out/libexec/common.js + cp ${./index.js} $out/libexec/index.js patchShebangs $out/libexec makeWrapper $out/libexec/index.js $out/bin/prefetch-yarn-deps \ @@ -53,7 +54,8 @@ in { tar --strip-components=1 -xf ${yarnpkg-lockfile-tar} package/index.js mv index.js $out/libexec/yarnpkg-lockfile.js - cp ${./.}/common.js ${./.}/fixup.js $out/libexec/ + cp ${./common.js} $out/libexec/common.js + cp ${./fixup.js} $out/libexec/fixup.js patchShebangs $out/libexec makeWrapper $out/libexec/fixup.js $out/bin/fixup-yarn-lock