fix(fnos): stabilize runtime content fingerprint

This commit is contained in:
2026-08-12 17:35:16 +08:00
parent 1babec1b85
commit 10f2c078ec
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ for candidate in "$STAGE/app/runtime/"imagefind-*.whl; do
done
[ -n "$STAGED_APP_WHEEL" ] || { printf 'built application wheel is missing\n' >&2; exit 1; }
PACKAGE_ID=$("$PYTHON_BIN" -c \
'import hashlib,sys; h=hashlib.sha256(); [h.update(open(path,"rb").read()) for path in sys.argv[1:]]; print(h.hexdigest())' \
'import hashlib,sys,zipfile; h=hashlib.sha256(); z=zipfile.ZipFile(sys.argv[1]); [(h.update(n.encode()),h.update(z.read(n))) for n in sorted(z.namelist())]; h.update(open(sys.argv[2],"rb").read()); print(h.hexdigest())' \
"$STAGED_APP_WHEEL" "$STAGE/app/runtime/runtime-core.txt")
printf '%s\n%s\n%s\n' "$PACKAGE_VERSION" "$APP_VERSION" "$PACKAGE_ID" >"$STAGE/app/runtime/VERSION"
"$PYTHON_BIN" "$PROJECT_ROOT/scripts/make_icons.py" "$STAGE"