From 307db8834663ea334938a8ca9cc26fdcd19f23da Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 10 Aug 2026 16:34:39 -0400 Subject: [PATCH] fix: normalize reproducible Planegcs artifacts --- config/planegcs-wasm-artifact.json | 2 +- native/planegcs/build.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config/planegcs-wasm-artifact.json b/config/planegcs-wasm-artifact.json index b4355cb..9486496 100644 --- a/config/planegcs-wasm-artifact.json +++ b/config/planegcs-wasm-artifact.json @@ -7,7 +7,7 @@ "javascript": { "path": "native/planegcs/dist/freecad-planegcs.js", "publicPath": "public/native/planegcs/freecad-planegcs.js", - "sha256": "702d267b856b8a1c9d1a031fbbd9780419c3e359a99d7d6922b5df668ed79d2e" + "sha256": "442eaafe2488baa10a3b5006d26264a2bc7c04c60a4b1261be37482ea28db0a1" }, "wasm": { "path": "native/planegcs/dist/freecad-planegcs.wasm", diff --git a/native/planegcs/build.sh b/native/planegcs/build.sh index 3a98edd..9e2b3b7 100755 --- a/native/planegcs/build.sh +++ b/native/planegcs/build.sh @@ -44,6 +44,11 @@ em++ \ -sNO_EXIT_RUNTIME=1 \ -o "${DIST_DIR}/freecad-planegcs.js" +# Emscripten output contains a version-sensitive trailing-space-only line. +# Normalize it before copying and hashing so native and public artifacts stay +# byte-identical across a clean rebuild. +perl -pi -e 's/[ \t]+$//' "${DIST_DIR}/freecad-planegcs.js" + cp "${ROOT_DIR}/native/planegcs/package.json" "${DIST_DIR}/package.json" cp "${DIST_DIR}/freecad-planegcs.js" "${PUBLIC_DIR}/freecad-planegcs.js" cp "${DIST_DIR}/freecad-planegcs.wasm" "${PUBLIC_DIR}/freecad-planegcs.wasm"