From 839c0423e1aac42f03bb0a2906387ca2a9290ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sat, 2 Nov 2024 20:10:40 +0000 Subject: [PATCH] Unlink missing-symbols.c after compilation --- scripts/build-wasm.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build-wasm.mjs b/scripts/build-wasm.mjs index b02586c..f6a056e 100644 --- a/scripts/build-wasm.mjs +++ b/scripts/build-wasm.mjs @@ -1,6 +1,6 @@ import { spawn } from 'node:child_process'; import * as events from 'node:events'; -import { mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises'; +import { mkdir, readdir, readFile, stat, unlink, writeFile } from 'node:fs/promises'; const buildDir = 'wasm/gen'; const depDir = 'deps/PQClean'; @@ -127,5 +127,7 @@ if (code !== 0) { throw new Error(`emcc exited with ${code !== null ? `code ${code}` : `signal ${signal}`}`); } +await unlink(`${buildDir}/missing-symbols.c`); + const { size } = await stat(`${buildDir}/pqclean.wasm`); console.log(`WebAssembly module size is ${(size / 1024).toFixed(1)} KiB`);