dub-to-nix: fetch submodules for git dependencies (#548514)

This commit is contained in:
Toma
2026-08-02 19:37:53 +00:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -41,6 +41,7 @@ let
src = fetchgit {
url = repository;
rev = version;
fetchSubmodules = true; # this is the default, but let's be explicit
inherit sha256;
};
};

View File

@@ -57,7 +57,7 @@ for pname in depsDict:
repository = depDict["repository"]
strippedRepo = repository[4:]
eprint(f"Fetching {pname}@{version} ({strippedRepo})")
command = ["nix-prefetch-git", strippedRepo, version]
command = ["nix-prefetch-git", "--fetch-submodules", strippedRepo, version]
rawRes = subprocess.run(command, check=True, text=True, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL).stdout
sha256 = json.loads(rawRes)["sha256"]
lockedDepsDict[pname] = {"version": version, "repository": strippedRepo, "sha256": sha256}