about summary refs log tree commit diff
path: root/pkgs/development/tools/yarn2nix-moretea
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2021-09-26 00:55:09 +0200
committerYuka <yuka@yuka.dev>2021-09-26 21:05:28 +0200
commitca4e61d58607c65691f32c31e4add106b27dfd2b (patch)
treeac67f195745728a6708fcae4552c696064688faa /pkgs/development/tools/yarn2nix-moretea
parent3d85bb08106a3d32350df2786fda62aa7fd49cd8 (diff)
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
Diffstat (limited to 'pkgs/development/tools/yarn2nix-moretea')
-rw-r--r--pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/generateNix.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/generateNix.js b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/generateNix.js
index b82372fd5b6d5..407a602dc5a79 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,
     })