You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by as...@apache.org on 2026/09/03 20:14:15 UTC

(maka) 02/05: fix(desktop): remove variable Windows linker metadata

This is an automated email from the ASF dual-hosted git repository.

Astro-Han pushed a commit to branch fix/windows-reproducible-payload
in repository https://gitbox.apache.org/repos/asf/maka.git

commit 6b9c0ae14099795344fa7cbab19776f9fe106379
Author: AstroHan <le...@outlook.com>
AuthorDate: Wed Sep 2 23:48:22 2026 +0800

    fix(desktop): remove variable Windows linker metadata
    
    Apply /Brepro and /DEBUG:NONE through the existing Windows command runner. /Brepro derives PE timestamps from content; /DEBUG:NONE removes unshipped PDB identity and paths after node-gyp adds /DEBUG.
    
    Two clean builds remained byte-identical after removing /INCREMENTAL:NO. Removing /DEBUG:NONE reintroduced four unpacked-payload differences, so the two remaining flags are the minimal set.
    
    Generated-by: Codex
---
 scripts/package-windows-x64.mjs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/scripts/package-windows-x64.mjs b/scripts/package-windows-x64.mjs
index c3194af0f2..ce957306e3 100644
--- a/scripts/package-windows-x64.mjs
+++ b/scripts/package-windows-x64.mjs
@@ -66,12 +66,19 @@ export function runCommand(
   { spawnProcess = spawn, platform = process.platform } = {},
 ) {
   return new Promise((resolve, reject) => {
+    // The release does not ship PDBs. Remove their random IDs and paths from
+    // native binaries, and let the linker derive timestamps from the content.
+    // _LINK_ is appended after command-line flags, including node-gyp's /DEBUG.
+    const env = {
+      ...process.env,
+      _LINK_: [process.env._LINK_, '/Brepro /DEBUG:NONE'].filter(Boolean).join(' '),
+    };
     // Every command here is a repository constant, so the shell that Windows
     // needs to reach npm.cmd introduces no quoting concern.
     const child = spawnProcess(
       command,
       args,
-      npmSpawnOptions({ cwd: repoRoot, env: process.env, stdio: 'inherit' }, platform),
+      npmSpawnOptions({ cwd: repoRoot, env, stdio: 'inherit' }, platform),
     );
     child.once('error', reject);
     child.once('exit', (code, signal) => {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org