Skip to content

wails3 update build-assets leaves stub {{.Ext}}/{{.Role}}/{{.Scheme}} literals when migrating older-format Info.plist #5259

Description

@randalmurphal

Description

wails3 update build-assets does not fully process older-format Info.plist templates that use Go-template {{if}}{{range}}{{end}} blocks. The outer directives are stripped, but inner field literals like {{.Ext}}, {{.IconName}}, {{.Name}}, {{.Role}}, {{.Scheme}} remain in the output. The result is a syntactically valid plist that contains garbage placeholder strings — CFBundleDocumentTypes ends up registering a file association for files with extension {{.Ext}}, etc.

The whole point of update:build-assets is to bring an existing project's build assets up to date. If it can't fully migrate older templates, it should warn or error rather than emit silently invalid output.

Reproduction

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

  1. Create a fresh project:

    wails3 init -t vanilla -n freshtest
    cd freshtest/build
  2. Replace darwin/Info.plist with an older-format template (representative of what older alpha versions emitted):

    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
        <dict>
            <key>CFBundleIconFile</key>
            <string>iconfile</string>
            {{if .Info.FileAssociations}}
            <key>CFBundleDocumentTypes</key>
            <array>
              {{range .Info.FileAssociations}}
              <dict>
                <key>CFBundleTypeExtensions</key>
                <array><string>{{.Ext}}</string></array>
                <key>CFBundleTypeIconFile</key>
                <string>{{.IconName}}</string>
                <key>CFBundleTypeName</key>
                <string>{{.Name}}</string>
                <key>CFBundleTypeRole</key>
                <string>{{.Role}}</string>
              </dict>
              {{end}}
            </array>
            {{end}}
            {{if .Info.Protocols}}
            <key>CFBundleURLTypes</key>
            <array>
              {{range .Info.Protocols}}
              <dict>
                <key>CFBundleURLName</key>
                <string>com.wails.{{.Scheme}}</string>
                <key>CFBundleURLSchemes</key>
                <array><string>{{.Scheme}}</string></array>
                <key>CFBundleTypeRole</key>
                <string>{{.Role}}</string>
              </dict>
              {{end}}
            </array>
            {{end}}
        </dict>
    </plist>
  3. With config.yml in the default state (commented-out fileAssociations and protocols), run:

    wails3 update build-assets -name freshtest -binaryname freshtest -config config.yml -dir .

Observed

Generated Info.plist contains stub literals:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array><string>{{.Ext}}</string></array>
        <key>CFBundleTypeIconFile</key>
        <string>{{.IconName}}</string>
        <key>CFBundleTypeName</key>
        <string>{{.Name}}</string>
        <key>CFBundleTypeRole</key>
        <string>{{.Role}}</string>
    </dict>
</array>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>{{.Role}}</string>
        <key>CFBundleURLName</key>
        <string>com.wails.{{.Scheme}}</string>
        <key>CFBundleURLSchemes</key>
        <array><string>{{.Scheme}}</string></array>
    </dict>
</array>

The outer {{if}}{{range}}{{end}} directives were stripped (so the block renders unconditionally), but the inner {{.Ext}}, {{.IconName}}, {{.Name}}, {{.Role}}, {{.Scheme}} literals were preserved as raw strings.

plutil -lint reports the file as OK (it's valid XML — just contains nonsense strings).

Expected

One of:

  • Old-format {{if .Info.FileAssociations}} blocks evaluated correctly so the block is omitted when the array is empty/null (matching the behavior on a fresh init's new-format template, which correctly omits CFBundleDocumentTypes when there are no fileAssociations).
  • A warning that the template uses an obsolete format and recommending re-scaffold or manual migration.

Impact

Anyone who scaffolded a project on an older alpha and runs update:build-assets to refresh their build assets gets these stubs silently injected. The resulting Info.plist registers nonsense file associations and URL schemes, and the bundle ships to production with garbage in its manifest.

System

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

Activity

  1. leaanthony commented on May 1, 2026

    @leaanthony
    Member

    🤖 Triage: Confirmed wails3 update build-assets leaves stub Go template literals in Info.plist. High-confidence bug with clear impact.

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

    Classification: macOS CLI bug. Template migration incomplete.

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

  2. leaanthony commented on May 3, 2026

    @leaanthony
    Member

    🤖 Triage by Wails Maintainer: Confirmed bug in wails3 update build-assets template processing.

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

    Classification: macOS CLI bug. Template migration incomplete - inner Go-template literals not evaluated.

    Action: Dispatched to Engineer - Mac as WAI-131 for investigation and fix.

  3. added a commit that references this issue on May 10, 2026
    921e329
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingDocumentationImprovements or additions to documentationcliv3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions