From b2abe4df04f5920b84c5778d3e1a1f7e65bf637d Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 10 Aug 2026 16:39:22 -0400 Subject: [PATCH] fix: normalize reproducible OpenCAMLib artifact --- config/opencamlib-wasm-artifact.json | 4 ++-- scripts/build-opencamlib-wasm.mjs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/opencamlib-wasm-artifact.json b/config/opencamlib-wasm-artifact.json index c20ef9f..feb1373 100644 --- a/config/opencamlib-wasm-artifact.json +++ b/config/opencamlib-wasm-artifact.json @@ -10,8 +10,8 @@ "boostVersion": "1.83.0", "artifact": "public/vendor/opencamlib/ocl.js", "artifactFormat": "emscripten-single-file-embedded-wasm", - "byteLength": 504062, - "sha256": "0379040910f7af277c6e1f6411efb549292db0b071422a83954d93631253bf89", + "byteLength": 504060, + "sha256": "30ca7dd307a131f9df66288d530c3fbacf155f375f83a2d733c5c00a85a712e0", "algorithms": [ "path-drop-cutter", "adaptive-path-drop-cutter", diff --git a/scripts/build-opencamlib-wasm.mjs b/scripts/build-opencamlib-wasm.mjs index 73827e0..a4d02c0 100644 --- a/scripts/build-opencamlib-wasm.mjs +++ b/scripts/build-opencamlib-wasm.mjs @@ -37,5 +37,8 @@ const reproducibleLink = originalLink.replace(/\s+--closure\s+1\b/, '') if (reproducibleLink === originalLink) throw new Error('OpenCAMLib generated link command did not contain the expected optional Closure flag.') await writeFile(linkPath, reproducibleLink) execFileSync('cmake', ['--build', build, '--target', 'ocl', '--parallel', '4'], { cwd: root, stdio: 'inherit' }) +# Normalize the generated single-file loader before it becomes the public +# artifact. This removes Emscripten's version-sensitive whitespace-only line. +execFileSync('perl', ['-pi', '-e', 's/[ \\t]+$//', resolve(build, 'ocl.js')]) execFileSync('cmake', ['--install', build], { cwd: root, stdio: 'inherit' }) console.log(`Built OpenCAMLib ${revision} into ${install}`)