Skip to content

fix(darwin): sanitize CFBundleIdentifier to comply with Apple requirements#5231

Draft
leaanthony wants to merge 1 commit intomasterfrom
fix/4866-plist-bundle-id-sanitize
Draft

fix(darwin): sanitize CFBundleIdentifier to comply with Apple requirements#5231
leaanthony wants to merge 1 commit intomasterfrom
fix/4866-plist-bundle-id-sanitize

Conversation

@leaanthony
Copy link
Copy Markdown
Member

Summary

  • Adds a safeBundleID template function that lowercases and replaces non-alphanumeric characters with hyphens
  • Updates CFBundleIdentifier in both plist templates to use {{safeBundleID .Name}}
  • Ensures bundle identifiers like com.wails.My Fab Application become com.wails.my-fab-application

Test

  • v2/pkg/buildassets/safebundleid_test.go — tests various inputs including spaces, special chars, underscores

Fixes #4866

…ments

CFBundleIdentifier was generated as com.wails.{{.Name}} which could
contain spaces and special characters, violating Apple's requirement
that bundle identifiers only contain [A-Za-z0-9.-].

Add a safeBundleID template function that lowercases and replaces
non-alphanumeric runs with hyphens, then strips leading/trailing
dashes. Applied to both Info.plist and Info.dev.plist templates.

Fixes #4866
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 671b8efe-d092-41a4-940d-59fd6bd2c90c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/4866-plist-bundle-id-sanitize

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@leaanthony
Copy link
Copy Markdown
Member Author

🤖 PR Triage Review

Accepted

Sanitizes CFBundleIdentifier to comply with Apple packaging requirements. Important for App Store distribution.

Platform: macOS (v2-only)

Next Steps: Dispatching for Mac testing.


Reviewed by Wails PR Reviewer Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wails' default Info.plist configuration can result in broken macOS packaging

1 participant