From 8f2a08cc527de1c69ee517008b22f90a28e6b4e5 Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Wed, 31 Dec 2025 13:22:57 +0000 Subject: [PATCH] fix(npins): fetch dependencies from correct ref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: mlmuvqqtptltptrpoplrqrskvkxuptzn We would previously get this error when fetching on new machines … while fetching the input 'git+https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch?rev=398c9fa782843d8b3aeaa5ebb1c1b3db35c3382f' error: Cannot find Git revision '398c9fa782843d8b3aeaa5ebb1c1b3db35c3382f' in ref 'refs/heads/master' of repository 'https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit. Now, this is what I'd expect - because we're not meant to be fetching master of this extension - we're meant to be fetching a branch! This seems to be an issue with npins' fetchgit call, which misses out the ref Due to a nilla bug, fetching dependencies is required for evaluation so this prevented any evaluation --- packetmix/npins/default.nix | 42 +++++++++++++++++++++++++++--------- packetmix/npins/sources.json | 8 +++---- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/packetmix/npins/default.nix b/packetmix/npins/default.nix index b844b313..f4cc2aa4 100644 --- a/packetmix/npins/default.nix +++ b/packetmix/npins/default.nix @@ -85,14 +85,25 @@ let url, submodules, rev, + branch ? null, name, narHash, }: - pkgs.fetchgit { - inherit url rev name; - fetchSubmodules = submodules; - hash = narHash; - }; + pkgs.fetchgit ( + { + inherit url rev name; + fetchSubmodules = submodules; + hash = narHash; + } + // ( + if branch == null then + { } + else + { + ref = "refs/heads/${branch}"; + } + ) + ); }; # Dispatch to the correct code path based on the type @@ -124,6 +135,7 @@ let repository, revision, url ? null, + branch ? null, submodules, hash, ... @@ -159,12 +171,22 @@ let "${if matched == null then "source" else builtins.head matched}${appendShort}"; name = urlToName url revision; in - fetchGit { - rev = revision; - narHash = hash; + fetchGit ( + { + rev = revision; + narHash = hash; - inherit name submodules url; - }; + inherit name submodules url; + } + // ( + if branch == null then + { } + else + { + ref = "refs/heads/${branch}"; + } + ) + ); mkPyPiSource = { fetchurl, ... }: diff --git a/packetmix/npins/sources.json b/packetmix/npins/sources.json index 33bc959b..746abaa0 100644 --- a/packetmix/npins/sources.json +++ b/packetmix/npins/sources.json @@ -22,7 +22,7 @@ "submodules": false, "revision": "12fb5f6d1a4bcfd1741b02fd60ec3c9ff6ec5faa", "url": null, - "hash": "sha256-vaSNVdiU9tLA5DujSFKAvY4fUiHVGEMvBzuswyPG22k=" + "hash": "sha256-yks79QtWndY2+ESKFcO2EPlj886TDLV+DldK+GpiMXI=" }, "AutoCreateCategoryPages": { "type": "GitRelease", @@ -520,9 +520,9 @@ }, "branch": "master", "submodules": false, - "revision": "f4e3698681704e74196fa0f905c7dfdd43cf5c86", - "url": "https://github.com/andir/npins/archive/f4e3698681704e74196fa0f905c7dfdd43cf5c86.tar.gz", - "hash": "sha256-8lkiistkBemkRN4aTqGW3SvI1CqibOnvFvNJS9OOdnU=" + "revision": "0d6aaa4b3dcd1d8badbed2b66e0c50867330a86e", + "url": "https://github.com/andir/npins/archive/0d6aaa4b3dcd1d8badbed2b66e0c50867330a86e.tar.gz", + "hash": "sha256-9N14/tliOiA49Us2uFUWHcrhYN8AmJjR+bnwzcxejgs=" }, "scriptfs": { "type": "Git", -- 2.43.0