Skip to content

emrg: fix electron-builder icon resolution (buildResources) - #836

Merged
argszero merged 1 commit into
masterfrom
feature/electron-builder-icon-fix
Aug 18, 2026
Merged

emrg: fix electron-builder icon resolution (buildResources)#836
argszero merged 1 commit into
masterfrom
feature/electron-builder-icon-fix

Conversation

@argszero

Copy link
Copy Markdown
Owner

Fixes host rant 2026-08-18T11:35:25 (electron-builder 图标未生效 — icon 相对路径解析错误).

Root cause: electron-builder resolves build.mac.icon / build.win.icon / top-level build.icon relative to buildResources (default emrg/gui/build/), NOT the package.json directory. The old ../packaging/assets/icon.icns resolved to emrg/gui/packaging/assets/icon.icns (nonexistent) → electron-builder silently fell back to the default electron icon on every platform (24.x known behavior: missing icon file → default, no error). Verified: packaged EMRG.app contained only electron.icns, Windows exe showed the default icon.

Fix (recommended option A — declarative, zero-copy):

  • buildResources: "../packaging/assets" — electron-builder treats that dir as the resource root, and CI gen-assets already generates icon.icns/ico/png there
  • Icon paths become bare filenames: icon.icns (mac) / icon.ico (win) / icon.png (top-level + linux)
  • extraResources from entries untouched (project-dir-relative mechanism)

Verification: config JSON valid, icon assets present in packaging/assets (icon.icns 378540B / icon.ico / icon.png), GUI tests 257/257 pass. Full icon embedding is exercised by the next Build Release (v0.2.46 tag push → gen-assets → electron-builder dist on all platforms).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 702. CI test + test-windows PASS (32096355697). Verified locally: buildResources=../packaging/assets + bare icon filenames (icon.icns/ico/png) — config valid, assets present (icns 378540B), GUI tests 257/257. Icon embedding exercised at next Build Release.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 703 (2nd). Head e0294fc unchanged from cycle 702, CI test + test-windows PASS (32096355697), MERGEABLE.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 704 (3rd). Head e0294fc unchanged, CI test + test-windows PASS, MERGEABLE/CLEAN. 3 consecutive ✅ from cycles 702/703/704 — merging.

@argszero
argszero merged commit e037a1d into master Aug 18, 2026
2 checks passed
argszero added a commit that referenced this pull request Aug 18, 2026
…#838)

* emrg: fix electron-builder buildResources schema (v0.2.47 build gate)

#836 placed buildResources at the config root — electron-builder 24.13.3
rejects the unknown property and all 4 Build Release jobs fail at the
electron-builder schema validation stage. Correct location is
directories.buildResources. Adds a build-config guard test so the schema
constraint is enforced at PR-CI time (Test CI never runs electron-builder,
only the tag-triggered Build Release does).

* emrg: fix buildResources guard — assert committed icon.svg, not gitignored gen-assets products

icon.icns/ico/png are gitignored build-time products (packaging/gen-assets.sh
renders them from icon.svg); CI checks out fresh and fails the exists-check.
Guard now asserts the committed design source icon.svg exists + the schema
constraint (directories.buildResources placement).

---------

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
@argszero
argszero deleted the feature/electron-builder-icon-fix branch August 18, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant