mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-13 03:37:26 +00:00
swiftpm2nix: fix hash mismatch when git submodules exist
This commit is contained in:
parent
9aafa9b258
commit
b732363eed
@ -29,6 +29,7 @@ in rec {
|
||||
url = dep.packageRef.location;
|
||||
rev = dep.state.checkoutState.revision;
|
||||
sha256 = hashes.${dep.subpath};
|
||||
fetchSubmodules = true;
|
||||
})) workspaceState.object.dependencies
|
||||
);
|
||||
|
||||
|
@ -23,7 +23,7 @@ hashes=""
|
||||
jq -r '.object.dependencies[] | "\(.subpath) \(.packageRef.location) \(.state.checkoutState.revision)"' $stateFile \
|
||||
| while read -r name url rev; do
|
||||
echo >&2 "-- Fetching $name"
|
||||
sha256="$(nix-prefetch-git $url $rev | jq -r .sha256)"
|
||||
sha256="$(nix-prefetch-git --fetch-submodules $url $rev | jq -r .sha256)"
|
||||
hashes+="
|
||||
\"$name\" = \"$sha256\";"
|
||||
echo >&2
|
||||
|
Loading…
Reference in New Issue
Block a user