feat(build): skip backend-manifest.json during macOS universal builds to ensure identical non-binary files

This commit is contained in:
Ivan
2026-04-07 16:02:41 -05:00
parent d03f32df1a
commit 2f7cec32ce
4 changed files with 23 additions and 4 deletions
+13 -1
View File
@@ -122,7 +122,19 @@ try {
stripPythonBytecodeArtifacts(buildDir);
}
const manifestPath = path.join(buildDir, "backend-manifest.json");
generateManifest(buildDir, manifestPath);
const skipManifest =
process.env.MESHCHATX_SKIP_BACKEND_MANIFEST === "1" ||
process.env.MESHCHATX_SKIP_BACKEND_MANIFEST === "true";
if (skipManifest) {
if (fs.existsSync(manifestPath)) {
fs.unlinkSync(manifestPath);
}
console.log(
"Skipping backend-manifest.json (MESHCHATX_SKIP_BACKEND_MANIFEST); universal merge requires identical non-binary files."
);
} else {
generateManifest(buildDir, manifestPath);
}
} else {
console.error(`Build directory not found (${buildDir}), manifest generation skipped.`);
}
+6
View File
@@ -7,6 +7,12 @@ set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
# @electron/universal merges x64 and arm64 app bundles and requires every non-binary
# file present in both trees to have identical bytes. Per-arch backend-manifest.json
# contents always differ, so skip embedding it here; electron/main.js treats a missing
# manifest as "skip integrity check" (see verifyBackendIntegrity).
export MESHCHATX_SKIP_BACKEND_MANIFEST=1
pnpm run electron-postinstall
pnpm run version:sync
pnpm run build-frontend