From df22fb01dfdd4e35ddb6b8edbb3c709deaa353a2 Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Fri, 22 Dec 2023 01:15:42 -0700 Subject: [PATCH] julia.withPackages: better error message on missing nix-sha256 hash --- pkgs/development/julia-modules/python/sources_nix.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/julia-modules/python/sources_nix.py b/pkgs/development/julia-modules/python/sources_nix.py index 99a952753e80..989bf6bf186f 100755 --- a/pkgs/development/julia-modules/python/sources_nix.py +++ b/pkgs/development/julia-modules/python/sources_nix.py @@ -45,10 +45,14 @@ with open(out_path, "w") as f: path = registry_info["path"] packageToml = toml.load(registry_path / path / "Package.toml") - all_versions = toml.load(registry_path / path / "Versions.toml") + versions_toml = registry_path / path / "Versions.toml" + all_versions = toml.load(versions_toml) if not pkg["version"] in all_versions: continue version_to_use = all_versions[pkg["version"]] + if not "nix-sha256" in version_to_use: + raise KeyError(f"""Couldn't find nix-sha256 hash for {pkg["name"]} {pkg["version"]} in {versions_toml}. This might indicate that we failed to prefetch the hash when computing the augmented registry. Was there a relevant failure in {registry_path / "failures.yml"}?""") + repo = packageToml["repo"] f.write(f""" "{uuid}" = {{ src = fetchgit {{