Skip to content

Commit 09d6847

Browse files
authored
Merge pull request #14589 from lovesegfault/fix-fetchers-substitute-test
tests: fix fetchers-substitute test for new narHash JSON format
2 parents 68d2292 + 53af111 commit 09d6847

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/nixos/fetchers-substitute.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@
120120
path_info_json = substituter.succeed(f"nix path-info --json {tarball_store_path}").strip()
121121
path_info_dict = json.loads(path_info_json)
122122
# nix path-info returns a dict with store paths as keys
123-
tarball_hash_sri = path_info_dict[tarball_store_path]["narHash"]
123+
narHash_obj = path_info_dict[tarball_store_path]["narHash"]
124+
# Convert from structured format {"algorithm": "sha256", "format": "base64", "hash": "..."} to SRI string
125+
tarball_hash_sri = f"{narHash_obj['algorithm']}-{narHash_obj['hash']}"
124126
print(f"Tarball NAR hash (SRI): {tarball_hash_sri}")
125127
126128
# Also get the old format hash for fetchTarball (which uses sha256 parameter)

0 commit comments

Comments
 (0)