File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+ cd " $( dirname " $0 " ) /.."
4+
5+ nix_file=" nix/packages.nix"
6+
7+ # 1. Zero out pnpmDeps.hash so the build fails with a hash mismatch.
8+ sed -i -E ' s|(hash = )"sha256-[^"]*";|\1"";|' " $nix_file "
9+
10+ # 2. Build pnpmDeps; it will fail and print the expected hash.
11+ got=$( nix build .# pnpmDeps 2>&1 | grep -oP 'got:\s+\Ksha256-\S+' || true)
12+
13+ if [[ -z " $got " ]]; then
14+ echo " error: could not extract hash from build output" >&2
15+ echo " (restoring file from git)" >&2
16+ git checkout -- " $nix_file "
17+ exit 1
18+ fi
19+
20+ # 3. Write the real hash back.
21+ sed -i " s|hash = \"\" ;|hash = \" $got \" ;|" " $nix_file "
22+
23+ echo " updated pnpmDeps.hash to $got "
Original file line number Diff line number Diff line change 8787 src = pkgs . fetchCrate {
8888 pname = "wasm-bindgen-cli" ;
8989 version = "0.2.121" ;
90- hash = "sha256-ZOMgFNOcGkO66Jz/Z83eoIu+DIzo3Z/vq6Z5g6BDY/w =" ;
90+ hash = "sha256-bD5kbL9i3F9uAbmw71jomSbrVDTBmREN647NSKsFXCI =" ;
9191 } ;
9292 cargoDeps = pkgs . rustPlatform . fetchCargoVendor {
9393 inherit src ;
9494 inherit ( src ) pname version ;
95- hash = "sha256-DPdCDPTAPBrbqLUqnCwQu1dePs9lGg85JCJOCIr9qjU =" ;
95+ hash = "sha256-bD5kbL9i3F9uAbmw71jomSbrVDTBmREN647NSKsFXCI =" ;
9696 } ;
9797 } ;
9898
474474 blit
475475 blit-release
476476 ;
477+ inherit pnpmDeps ;
477478 demo-image = demoImage ;
478479 push-demo = pushDemo ;
479480 publish-demo = publishDemo ;
You can’t perform that action at this time.
0 commit comments