Draft
Conversation
…builder pass The previous workflow used: 1. electron-builder --mac --dir (build unpacked .app) 2. codesign.sh (ad-hoc sign) 3. electron-builder --mac dmg --prepackaged (create DMG) This produced a working DMG but a broken app — Python failed at runtime. The --prepackaged step may re-process extraResources and overwrite the signed Python environment, and the custom codesign.sh step with --options runtime --deep can conflict with macOS library loading for the embedded Python. Replace all three steps with a single `electron-builder --mac` call that builds the .app and creates the DMG in one pass. This correctly embeds python-embed/ via extraResources without interference. Signing/notarization disabled (CSC_IDENTITY_AUTO_DISCOVERY=false, --config.mac.notarize=false) — produces an unsigned DMG for testing. Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix builder issues with build GitHub action
Fix macOS build: replace segmented 3-step build with single electron-builder pass
Mar 9, 2026
The previous build produced either an unsigned app (requiring xattr -dr to clear quarantine from all files including the embedded python3 binary) or an ad-hoc signed app with --options runtime (hardened runtime) which blocked Python from loading pip-installed unsigned .so extensions. Fix: apply ad-hoc signing WITHOUT --options runtime. Without hardened runtime, macOS does not enforce library validation — Python loads its extensions freely. Because the whole bundle is consistently signed (all executables with the same ad-hoc identity), Gatekeeper's "Open Anyway" button approves the entire bundle including the embedded python3 binary. No shell commands (no xattr) are required. Changes: - build/macos/codesign.sh: remove --options runtime from ad-hoc path; keep --options runtime + --timestamp only for real Developer ID certs - .github/workflows/build-mac-dmg.yml: restore 3-step build (build app → codesign.sh → create DMG); fix find -maxdepth ordering - docs/INSTALLER.md: replace xattr -dr instructions with Open Anyway steps - README.md: add macOS Gatekeeper note to Install section Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot
AI
changed the title
Fix macOS build: replace segmented 3-step build with single electron-builder pass
macOS DMG: ad-hoc sign without hardened runtime so "Open Anyway" is sufficient
Mar 9, 2026
Three focused fixes for the crash at ltx2_server.py:221:
1. zit_image_generation_pipeline.py: make ZImagePipeline import lazy
- Moved `from diffusers.pipelines.auto_pipeline import ZImagePipeline`
from module level into __init__, consistent with how every other
pipeline defers its heavy imports.
- Previously this import ran as part of build_default_service_bundle()
at startup — the exact call site of the line-221 crash. If diffusers
doesn't expose ZImagePipeline (version mismatch, partial install, etc.)
the whole backend would refuse to start even before any ZIT model is
requested.
2. electron/window.ts: fix production icon path
- getCurrentDir() returns path.dirname(app.getPath('exe')) = Contents/MacOS
on macOS, so the old path looked for the icon at Contents/MacOS/resources/
which never exists. Use process.resourcesPath (= Contents/Resources/)
in production builds.
3. electron-builder.yml: add icon.png to mac extraResources
- Ensures icon.png is present at Contents/Resources/icon.png
(= process.resourcesPath) so the corrected path actually finds it.
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot
AI
changed the title
macOS DMG: ad-hoc sign without hardened runtime so "Open Anyway" is sufficient
Fix macOS startup crash and enable "Open Anyway" to fully unblock the app
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The macOS DMG required
xattr -dr com.apple.quarantineafter "Open Anyway" because the Python backend crashed at startup due to two independent issues. After these fixes, clicking "Open Anyway" once in Privacy & Security is sufficient.Signing: remove hardened runtime from ad-hoc signing (
build/macos/codesign.sh)The 3-step build (build → sign → DMG) applied
--options runtimeeven for ad-hoc identity"-". Hardened runtime enables library validation; pip-installed.soextensions are unsigned → blocked → crash atltx2_server.py:221insidebuild_initial_state. PyTorch's pre-signed.sofiles passed, masking the issue until later imports.CI workflow restored to 3-step (build → codesign.sh → DMG) with
CSC_IDENTITY_AUTO_DISCOVERY=falsepreventing electron-builder from re-signing.Lazy
ZImagePipelineimport (zit_image_generation_pipeline.py)ZImagePipelinewas imported at module level, which ran at exactly thebuild_initial_statecall site. Any diffusers version skew would crash the backend before any ZIT model was ever requested. Moved inside__init__, consistent with how every other pipeline in the codebase defers heavy imports.Icon path fix (
electron/window.ts,electron-builder.yml)getCurrentDir()resolves toContents/MacOSon macOS in production (the exe's directory), notContents/Resources. Icon lookup was always failing silently. Fixed to useprocess.resourcesPath, andicon.pngadded to macextraResourcesso it's actually present there.Docs
docs/INSTALLER.mdandREADME.mdupdated to replace thexattr -drworkaround with Privacy & Security → Open Anyway instructions.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
releases.astral.sh/home/REDACTED/.local/bin/uv uv run pytest tests/test_import_safety.py tests/test_runtime_policy.py tests/test_settings.py -v --tb=short(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.