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
+2 -2
View File
@@ -105,7 +105,7 @@ The project favors predictable SQL behavior and explicit migration control, whic
- Auth and access-attempt tracking integrated with IP/User-Agent aware controls
- Debug endpoints provide visibility into logs and access-attempt records
This is also very well tested, but I still would not recommend exposing MeshChatX to the internet.
This is also very well tested, but I still would not recommend exposing MeshChatX to the internet.
## Security Model
@@ -155,4 +155,4 @@ When adding features, prefer:
- identity-scoped state over global mutable state,
- explicit migration/version changes for DB schema updates,
- endpoint-level tests plus focused manager unit tests.
- endpoint-level tests plus focused manager unit tests.
+2 -1
View File
@@ -141,7 +141,8 @@
"from": "build/exe/darwin-${arch}",
"to": "backend",
"filter": [
"**/*"
"**/*",
"!backend-manifest.json"
]
}
]
+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