From dbb29bda44fd7b17128b7b218adf843cc182dc98 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 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packetmix/npins/default.nix b/packetmix/npins/default.nix index b844b313..d23c2b74 100644 --- a/packetmix/npins/default.nix +++ b/packetmix/npins/default.nix @@ -85,14 +85,17 @@ let url, submodules, rev, + branch ? null, name, narHash, }: - pkgs.fetchgit { + 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 +127,7 @@ let repository, revision, url ? null, + branch ? null, submodules, hash, ... @@ -159,12 +163,14 @@ let "${if matched == null then "source" else builtins.head matched}${appendShort}"; name = urlToName url revision; in - fetchGit { + fetchGit ({ rev = revision; narHash = hash; inherit name submodules url; - }; + } // (if branch == null then {} else { + ref = "refs/heads/${branch}"; + })); mkPyPiSource = { fetchurl, ... }: -- 2.43.0