wails icon indicating copy to clipboard operation
wails copied to clipboard

wails3 generate icons silently no-ops on Assets.car generation (-iconcomposerinput / -macassetdir)

Open randalmurphal opened this issue 7 months ago • 2 comments

Description

wails3 generate icons exits 0 with no output and no file changes when invoked with the documented -iconcomposerinput and -macassetdir flags, even when those flags are supposed to produce or update an Assets.car. Users assume the command worked because there is no error.

Reproduction

Tested on v3.0.0-alpha.78 (also reproduces on alpha.76).

  1. Create a fresh project (which scaffolds a default appicon.icon Icon Composer asset and a baseline darwin/Assets.car):

    wails3 init -t vanilla -n freshtest
    cd freshtest/build
    
  2. Note the Assets.car mtime:

    stat -f "%Sm" darwin/Assets.car
    
  3. Run icon generation with the documented Icon Composer flags:

    wails3 generate icons \
      -input appicon.png \
      -macfilename darwin/icons.icns \
      -windowsfilename windows/icon.ico \
      -iconcomposerinput appicon.icon \
      -macassetdir darwin
    

Observed

  • Exit code: 0
  • Stdout/stderr: empty
  • darwin/icons.icns: regenerated correctly
  • windows/icon.ico: regenerated correctly
  • darwin/Assets.car: mtime unchanged, contents unchanged

Expected

One of:

  • Emit a warning explaining the missing dependency. (On a clean macOS 26 install, even with full Xcode 16+ installed, xcrun --find iconcomposer fails — Apple ships Icon Composer as a GUI-only app at /Applications/Xcode.app/Contents/Applications/Icon Composer.app. There is no CLI binary by default.)
  • Fail with a non-zero exit code and a message indicating what's missing or how to compile the .icon.
  • Document the dependency in wails3 generate icons --help for -iconcomposerinput / -macassetdir.

Currently the command appears to succeed but produces stale output. This is especially confusing when:

  • The user has updated the source appicon.icon and assumes the new artwork was compiled.
  • A stale Assets.car ends up overriding a freshly-generated icons.icns in the bundled .app/Contents/Resources/ (macOS prefers Assets.car for icon-name-based lookups in modern bundles), causing the user to see the previous artwork in the dock and Cmd+Tab even after they've changed the icon and rebuilt.

Notes

  • This was painful to debug because every other piece of the pipeline reports success. The build task that invokes this command (the default Taskfile's generate:icons step) doesn't surface that anything was skipped, so users only notice when they ship and discover the icon didn't update.

System

  • Wails: v3.0.0-alpha.78 (also v3.0.0-alpha.76)
  • macOS: 26.0 (Tahoe), Xcode installed
  • Go: 1.25

randalmurphal avatar Apr 27 '26 00:04 randalmurphal

🤖 Triage: Confirmed silent no-op in wails3 generate icons for Assets.car generation. High-confidence bug with clear impact.

Labels: Bug ✓, v3 ✓, cli ✓ (all already applied)

Classification: macOS CLI bug. Icon Composer dependency not properly handled.

Action: Dispatching to Engineer - Mac for investigation and fix.

leaanthony avatar May 01 '26 22:05 leaanthony

Fixed in commit fe1c8bbef.

Root cause: generateMacAsset() returned a bare sentinel error on every early exit (non-macOS, macOS < 26, actool missing/old). GenerateIcons() silently swallowed it when -input was also provided — exit 0, no output, stale Assets.car.

Fix (2 files in v3/internal/commands/):

  • Each early exit in generateMacAsset() now returns a descriptive wrapped error, e.g. "Assets.car generation requires actool 26 or later (actool not found at /usr/bin/actool — install Xcode)". errors.Is semantics preserved via %w.
  • GenerateIcons() now prints Warning: <reason> to stderr when falling through to PNG-based generation instead of silently no-opping.
  • -iconcomposerinput and -macassetdir flag help updated to mention the macOS 26 + Xcode actool 26+ requirement.

After the fix:

$ wails3 generate icons -input appicon.png -macfilename darwin/icons.icns \
    -windowsfilename windows/icon.ico \
    -iconcomposerinput appicon.icon -macassetdir darwin
Warning: Assets.car generation requires actool 26 or later (actool not found at /usr/bin/actool — install Xcode): mac asset generation is only supported on macOS

Tests: 10 pass, 1 skip (Assets.car — needs full Xcode). New TestGenerateIconsFallthrough covers the fallthrough path on any platform.

PR pending.

leaanthony avatar May 02 '26 10:05 leaanthony