import assert from "node:assert/strict"; import crypto from "node:crypto"; import fs from "node:fs"; import { execFileSync } from "node:child_process"; const creator = new URL("./create-offline-release.mjs", import.meta.url); const archive = new URL("../../release/blender-web-offline.tar.gz", import.meta.url); const sourceArchive = new URL("../../release/blender-web-corresponding-source.tar.gz", import.meta.url); const digest = (file) => crypto.createHash("sha256").update(fs.readFileSync(file)).digest("hex"); execFileSync(process.execPath, [creator.pathname], { stdio: "inherit" }); const first = [digest(archive), digest(sourceArchive)]; execFileSync(process.execPath, [creator.pathname], { stdio: "inherit" }); const second = [digest(archive), digest(sourceArchive)]; assert.deepEqual(second, first, "offline binary/source archives are not reproducible"); process.stdout.write(`offline-reproducibility-ok binary=${second[0]} source=${second[1]}\n`);