From c20fbabd9bf3f6e5c1cefb79ad5aa0da7681c8a7 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 26 Sep 2021 00:55:09 +0200 Subject: [PATCH] yarn2nix: run `nix-prefetch-git` with `--fetch-submodules` `pkgs.fetchgit` uses `fetchSubmodules = true;` by default, however `nix-prefetch-git` doesn't. This means that hashes for a Git repository with fetched submodules will be wrong in `yarn.nix`. Considering that this got unnoticed before, it seems as if this case is an exception to a certain degree. An exemplary problem is the last `hedgedoc` update[1] where `js-sequence-diagrams` - a Git repo with submodules - from upstream's package.json caused a hash mismatch. This got unnoticed because `nix-build --check` doesn't seem to reveal these issues for fixed-output derivations. [1] https://github.com/NixOS/nixpkgs/pull/139238 (cherry picked from commit 46c98ae1327b7d14af1927fda971762e5ee53dfe) --- .../tools/yarn2nix-moretea/yarn2nix/lib/generateNix.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/generateNix.js b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/generateNix.js index cebe7c715d1..144f1fdc987 100644 --- a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/generateNix.js +++ b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/generateNix.js @@ -33,7 +33,7 @@ const { execFileSync } = require('child_process') function prefetchgit(url, rev) { return JSON.parse( - execFileSync("nix-prefetch-git", ["--rev", rev, url], { + execFileSync("nix-prefetch-git", ["--rev", rev, url, "--fetch-submodules"], { stdio: [ "ignore", "pipe", "ignore" ], timeout: 60000, })