fix(darwin): sanitize CFBundleIdentifier to comply with Apple requirements#5231
Conversation
…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
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThe PR fixes macOS bundle identifier compliance by introducing a ChangesBundle ID Sanitization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" 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. Comment |
|
🤖 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 |
Summary
safeBundleIDtemplate function that lowercases and replaces non-alphanumeric characters with hyphensCFBundleIdentifierin both plist templates to use{{safeBundleID .Name}}com.wails.My Fab Applicationbecomecom.wails.my-fab-applicationTest
v2/pkg/buildassets/safebundleid_test.go— tests various inputs including spaces, special chars, underscoresFixes #4866
Summary by CodeRabbit
Bug Fixes
Tests