Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(macos): keep the app-icon iconset inside Apple's member-name grammar

rubenluetke10-beep72580643a5a7
diff --git a/jarvis/setup/macos_app_bundle.py b/jarvis/setup/macos_app_bundle.py
index 4dd37e0ee4..09820ad247 100644
--- a/jarvis/setup/macos_app_bundle.py
+++ b/jarvis/setup/macos_app_bundle.py
@@ -310,7 +310,11 @@ def _try_build_icns(resources_dir: Path) -> str | None:
iconset = Path(raw_tmp) / "jarvis.iconset"
iconset.mkdir()
image = Image.open(source).convert("RGBA")
- for size in (16, 32, 64, 128, 256, 512):
+ # Apple's iconset grammar allows exactly 16/32/128/256/512 (+@2x);
+ # a 64x64 member is outside it and iconutil rejects the whole
+ # iconset over one bad name, so the app shipped without any icon.
+ # The 64 px slot is already covered by [email protected].
+ for size in (16, 32, 128, 256, 512):
image.resize((size, size)).save(iconset / f"icon_{size}x{size}.png")
image.resize((size * 2, size * 2)).save(iconset / f"icon_{size}x{size}@2x.png")
output = resources_dir / "jarvis.icns"
diff --git a/tests/unit/setup/test_macos_app_bundle.py b/tests/unit/setup/test_macos_app_bundle.py
index 9524542734..02b2caf61b 100644
--- a/tests/unit/setup/test_macos_app_bundle.py
+++ b/tests/unit/setup/test_macos_app_bundle.py
@@ -513,6 +513,40 @@ def test_launcher_identity_probe_uses_main_bundle(tmp_path: Path, monkeypatch) -
}
+def test_icns_iconset_members_use_only_apple_valid_names(
+ tmp_path: Path, monkeypatch
+) -> None:
+ """iconutil accepts exactly icon_{16,32,128,256,512}x*[@2x].png — one
+ out-of-grammar member (icon_64x64.png) makes it reject the whole iconset,
+ so the app silently shipped without an icon."""
+ pytest.importorskip("PIL")
+ import jarvis.setup.macos_app_bundle as mab
+
+ monkeypatch.setattr(mab.sys, "platform", "darwin")
+ captured: list[str] = []
+
+ def _fake_iconutil(command, **_kwargs):
+ iconset = Path(command[3])
+ captured.extend(sorted(entry.name for entry in iconset.glob("*")))
+ output = Path(command[command.index("-o") + 1])
+ output.write_bytes(b"icns")
+ return SimpleNamespace(returncode=0, stdout="", stderr="")
+
+ monkeypatch.setattr(mab.subprocess, "run", _fake_iconutil)
+ resources = tmp_path / "Resources"
+ resources.mkdir()
+
+ assert mab._try_build_icns(resources) == "jarvis"
+
+ valid = {
+ f"icon_{size}x{size}{scale}.png"
+ for size in (16, 32, 128, 256, 512)
+ for scale in ("", "@2x")
+ }
+ assert captured, "no iconset members were generated"
+ assert set(captured) <= valid
+
+
def test_tcc_reset_needed_only_on_a_real_signature_change() -> None:
from jarvis.setup.macos_app_bundle import _tcc_reset_needed