4 lines
2.3 KiB
JavaScript
4 lines
2.3 KiB
JavaScript
#!/usr/bin/env node
|
|
import crypto from "node:crypto"; import fs from "node:fs"; import path from "node:path"; import {execFileSync} from "node:child_process"; import {fileURLToPath} from "node:url";
|
|
const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),".."); const sourceRoot=path.join(root,"freecad-source"); const build=path.resolve(process.argv[2]??path.join(sourceRoot,"build-web/configure/bin")); const smoke=path.join(sourceRoot,"src/WebAssembly/FreeCADCoreProbe/points-runtime-smoke.js"); const out=execFileSync(process.execPath,[smoke,build],{cwd:sourceRoot,encoding:"utf8"}); const result=JSON.parse(out.trim().split(/\r?\n/).filter(Boolean).at(-1)); const boundary=JSON.parse(fs.readFileSync(path.join(root,"docs/p6/points-source-boundary.json"),"utf8")); const wasm=path.join(build,"FreeCADWebPointsRuntimeProbe.wasm"); const hash=f=>crypto.createHash("sha256").update(fs.readFileSync(f)).digest("hex"); const report={schema:"freecad-web-points-runtime/v1",task_id:"FW-P6-PTS-B",status:"pass",source_revision:boundary.source_revision,input_sha256:hash(path.join(root,"docs/p6/points-source-boundary.json")),result,commands:["EM_CONFIG=/absolute/build-web/emscripten-config.py env -u EM_FROZEN_CACHE ninja -C build-web/configure FreeCADWebPointsRuntimeProbe -j8","node src/WebAssembly/FreeCADCoreProbe/points-runtime-smoke.js build-web/configure/bin"],artifacts:{javascript:{path:"freecad-source/build-web/configure/bin/FreeCADWebPointsRuntimeProbe.js",sha256:hash(path.join(build,"FreeCADWebPointsRuntimeProbe.js"))},wasm:{path:"freecad-source/build-web/configure/bin/FreeCADWebPointsRuntimeProbe.wasm",bytes:fs.statSync(wasm).size,sha256:hash(wasm)}},boundaries:["Real Points App/Points.a is initialized through PyInit_Points; PointsGui is intentionally unavailable in GUI-free Web.","This B card closes registration/dependency behavior only; point document actions remain later cards."]}; const docs=path.join(root,"docs/p6");fs.writeFileSync(path.join(docs,"points-runtime.json"),`${JSON.stringify(report,null,2)}\n`);fs.writeFileSync(path.join(root,"docs/freecad-p6-points-b-smoke.log"),`${JSON.stringify({status:report.status,runs:result.runs,registered:result.registered,wasmSha256:report.artifacts.wasm.sha256})}\n`);console.log(JSON.stringify({status:report.status,runs:result.runs,registered:result.registered,wasmSha256:report.artifacts.wasm.sha256}));
|