Skip to content

fix(darwin): build fails if APP_NAME contains whitespaces - #5210

Merged
leaanthony merged 2 commits into
wailsapp:v3-alphafrom
patopesto:v3-alpha-bugfix/darwin-whitespace
Apr 22, 2026
Merged

leaanthony merged 2 commits into
wailsapp:v3-alphafrom
patopesto:v3-alpha-bugfix/darwin-whitespace

Conversation

@patopesto

@patopesto patopesto commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #5209

Fix darwin tasks when the binary name contains whitespaces.

Tasks impacted:

  • build:native
  • run

Type of change

Please select the option that is relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • Windows
  • macOS
  • Linux

If you checked Linux, please specify the distro and version.

Test Configuration


# System

┌──────────────────────────────────────────────────┐
| Name          | MacOS                            |
| Version       | 15.7.5                           |
| ID            | 24G624                           |
| Branding      | Sequoia                          |
| Platform      | darwin                           |
| Architecture  | arm64                            |
| Apple Silicon | true                             |
| CPU           | Apple M2 Pro                     |
| CPU 1         | Apple M2 Pro                     |
| CPU 2         | Apple M2 Pro                     |
| GPU           | 16 cores, Metal Support: Metal 3 |
| Memory        | 32 GB                            |
└──────────────────────────────────────────────────┘

# Build Environment

┌──────────────────────────────────────────────────────────────────────┐
| Wails CLI      | v3.0.0-alpha.78                                     |
| Go Version     | go1.26.2                                            |
| -buildmode     | exe                                                 |
| -compiler      | gc                                                  |
| CGO_CFLAGS     |                                                     |
| CGO_CPPFLAGS   |                                                     |
| CGO_CXXFLAGS   |                                                     |
| CGO_ENABLED    | 1                                                   |
| CGO_LDFLAGS    |                                                     |
| DefaultGODEBUG | cryptocustomrand=1,tlssecpmlkem=0,urlstrictcolons=0 |
| GOARCH         | arm64                                               |
| GOARM64        | v8.0                                                |
| GOOS           | darwin                                              |
└──────────────────────────────────────────────────────────────────────┘

# Dependencies

┌────────────────────────────────────────────────────────────────────────┐
| Xcode cli tools | 2410                                                 |
| npm             | 11.12.1                                              |
| *NSIS           | Not Installed. Install with `brew install makensis`. |
| docker          | *Not installed (optional - for cross-compilation)    |
|                                                                        |
└─────────────────────── * - Optional Dependency ────────────────────────┘

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Bug Fixes
    • Improved macOS build and local app execution by ensuring build outputs and app paths are quoted, making builds and dev runs more reliable across path configurations (e.g., spaces or special characters).

@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4f785dc6-2196-4805-9e5a-752a855d36d0

📥 Commits

Reviewing files that changed from the base of the PR and between 920cc97 and 4e869f3.

📒 Files selected for processing (1)
  • v3/internal/commands/build_assets/darwin/Taskfile.yml

Walkthrough

Quoted the macOS build output and the dev .app execution path in the Darwin Taskfile to preserve spaces in app/binary names. (No other task structure, variables, or signing behavior changed.)

Changes

Cohort / File(s) Summary
macOS build configuration
v3/internal/commands/build_assets/darwin/Taskfile.yml
Changed go build output flag from -o {{.OUTPUT}} to -o "{{.OUTPUT}}" and quoted the dev .app execution path ('{{.BIN_DIR}}/.../{{.APP_NAME}}' → '"{{.BIN_DIR}}/.../{{.APP_NAME}}"') to handle paths with spaces.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

cli, v3-alpha

Poem

🐰 I hopped through paths both wide and neat,
Quoted the output, kept names complete.
A dot and a quote, a tiny tweak true,
Now "My App" builds—huzzah! — from me to you. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description includes the linked issue reference (#5209), clearly states it's a bug fix, lists affected tasks, and provides test configuration details.
Linked Issues check ✅ Passed The changes directly address issue #5209 by quoting the output path and adding './' prefix to handle whitespace in BIN_NAME.
Out of Scope Changes check ✅ Passed All changes are focused on fixing the whitespace issue in darwin tasks; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The PR title mentions APP_NAME but the actual changes and objectives focus on BIN_NAME containing whitespaces. However, the title does accurately describe the core fix: enabling builds to work when names contain whitespaces on macOS.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@patopesto patopesto changed the title fix(darwin): build fails if BIN_NAME contains whitespaces fix(darwin): build fails if APP_NAME contains whitespaces Apr 22, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@v3/internal/commands/build_assets/darwin/Taskfile.yml`:
- Line 177: Remove the leading ./ prefix and switch to double-quoted path
expansion so the command works with absolute BIN_DIR and paths containing
spaces: replace the argument
./'{{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/MacOS/{{.APP_NAME}}' with a
double-quoted expansion referencing the same template (e.g.,
"{{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/MacOS/{{.APP_NAME}}") used
elsewhere in the file to ensure both absolute and relative BIN_DIR values
resolve correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e6d9a2e3-74c8-4dd4-ac05-d70c63b3ceb6

📥 Commits

Reviewing files that changed from the base of the PR and between 89ffda9 and 920cc97.

📒 Files selected for processing (1)
  • v3/internal/commands/build_assets/darwin/Taskfile.yml

Comment thread v3/internal/commands/build_assets/darwin/Taskfile.yml Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@leaanthony

Copy link
Copy Markdown
Member

Thanks!

@leaanthony
leaanthony merged commit b1fd8e9 into wailsapp:v3-alpha Apr 22, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants