Add Windows and MacOS configuration section#4662
Add Windows and MacOS configuration section#4662Romerolweb wants to merge 3 commits intowailsapp:masterfrom
Conversation
Added configuration sections for Windows and MacOS in the IDEs guide.
|
|
Thanks. This will only apple to v2.10 of the docs. Please update the main docs (not versioned docs). Thanks 🙏 |
As requested by maintainer, adding the platform-specific configuration sections to the main docs instead of just the versioned v2.10 docs. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe changes add Windows and macOS specific Visual Studio Code debugging configurations to IDE documentation. Windows configuration targets myproject.exe with a build task, while macOS configuration specifies GOOS=darwin, GOARCH=amd64, and a custom binary path. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@website/versioned_docs/version-v2.10/guides/ides.mdx`:
- Around line 69-86: The macOS launch.json is inconsistent with the build task
and hardcodes an incompatible GOARCH; update launch.json so its "program"
matches the binary produced by the build task (the same path used in tasks.json)
and remove the hardcoded "env": { "GOARCH": "amd64" } from launch.json (env in
launch.json only affects the debuggee, not the build). If you need to control
GOARCH for cross-building, move that setting into the build task's options.env
in tasks.json (or omit it entirely to use the host architecture), and ensure
"preLaunchTask": "build" produces the same output filename referenced by
"program".
♻️ Duplicate comments (1)
website/docs/guides/ides.mdx (1)
69-86: Same macOS mismatch as the versioned docs.
The macOS launch config points tobuild/bin/myproject, but the shown build task outputsbuild/bin/myproject.exe, andGOARCHis hardcoded toamd64. Please align the macOS docs with a macOS-specific build output and arch (arm64 on Apple Silicon or host default).VS Code Go debugger launch.json macOS GOARCH GOOS recommended settings and whether to omit GOARCH
| ### MacOS configuration | ||
|
|
||
| ```json title="launch.json" | ||
| { | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Wails: Debug myproject (macOS)", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "exec", | ||
| "program": "${workspaceFolder}/build/bin/myproject", | ||
| "preLaunchTask": "build", | ||
| "cwd": "${workspaceFolder}", | ||
| "env": { | ||
| "GOOS": "darwin", | ||
| "GOARCH": "amd64" | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cat "website/versioned_docs/version-v2.10/guides/ides.mdx" | head -120Repository: wailsapp/wails
Length of output: 2956
🌐 Web query:
VS Code Go debugger launch.json macOS GOARCH environment variable best practices
💡 Result:
Best practices: GOARCH in VS Code Go debug (launch.json) on macOS
-
Don’t set
GOARCHunless you truly need it.
For normal local debugging, let Go/Delve use your host defaults (Apple Silicon:darwin/arm64; Intel:darwin/amd64).GOARCHis primarily a build target selector (often paired withGOOS). [2] -
If you do set
GOARCH, ensure the whole toolchain matches (Go +dlv+ the binary).
Debugging generally assumes the compiled binary matches the architecture Delve is running under. Practically:- Apple Silicon: prefer
GOARCH=arm64and an arm64dlv. - If you need to debug an x86_64 (
amd64) build on Apple Silicon, use a consistent x86_64 toolchain (often meaning running the relevant tools under Rosetta and using an amd64dlv). (Mixing arch is a common cause of “breakpoints don’t hit / weird debugger behavior”.)
- Apple Silicon: prefer
-
Use
env/envFilecorrectly: they apply to the debuggee process environment.
Inlaunch.json,envdefines environment variables passed to the launched program, and it merges withenvFile(andgo.toolsEnvVars) with precedenceenv>envFile>go.toolsEnvVars. [1] -
If you need a different
GOARCHonly for the build, build in apreLaunchTaskand debug with"mode": "exec"—don’t rely onlaunch.json envto affect the build step.
The VS Code Go docs explicitly note that settings likeenvinlaunch.jsonapply to running the compiled binary, not building it—so put build env/flags in the task. [3]
Example: build amd64 binary via task, then debug it (recommended pattern)
.vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "go: build (debug, amd64)",
"type": "shell",
"command": "go",
"args": ["build", "-gcflags=all=-N -l", "-o", "${workspaceFolder}/__debug_bin_amd64", "./cmd/myapp"],
"options": {
"env": { "GOARCH": "amd64" }
}
}
]
}.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug exec (amd64 build)",
"type": "go",
"request": "launch",
"mode": "exec",
"program": "${workspaceFolder}/__debug_bin_amd64",
"preLaunchTask": "go: build (debug, amd64)"
}
]
}Sources: VS Code Go debug config env/envFile behavior [1]; what GOARCH does for builds [2]; why build env should live in the pre-launch task (launch env doesn’t apply to building) [3].
macOS launch config is inconsistent with the shown build task and hardcodes incompatible GOARCH.
The generic tasks.json builds to build/bin/myproject.exe, but the macOS launch.json targets build/bin/myproject (no .exe), causing a mismatch. Additionally, hardcoding GOARCH: "amd64" fails on Apple Silicon (arm64 hosts). If GOARCH must differ for builds, it belongs in the task's options.env, not in launch.json (where env only affects the debuggee process, not the build). For local debugging on macOS, omit GOARCH entirely to use the host default, or conditionally set it based on the actual machine architecture.
💡 Proposed doc fix (align macOS config with proper build/arch handling)
### MacOS configuration
+Before using this configuration on macOS, ensure your build task outputs to `build/bin/myproject` (without `.exe`),
+and remove the hardcoded `GOARCH: "amd64"` to use your machine's native architecture (arm64 for Apple Silicon, amd64 for Intel).
+Alternatively, if a specific `GOARCH` is needed, define it in your `tasks.json` build command instead of `launch.json`.
+
```json title="launch.json"
{
"version": "0.2.0",🤖 Prompt for AI Agents
In `@website/versioned_docs/version-v2.10/guides/ides.mdx` around lines 69 - 86,
The macOS launch.json is inconsistent with the build task and hardcodes an
incompatible GOARCH; update launch.json so its "program" matches the binary
produced by the build task (the same path used in tasks.json) and remove the
hardcoded "env": { "GOARCH": "amd64" } from launch.json (env in launch.json only
affects the debuggee, not the build). If you need to control GOARCH for
cross-building, move that setting into the build task's options.env in
tasks.json (or omit it entirely to use the host architecture), and ensure
"preLaunchTask": "build" produces the same output filename referenced by
"program".
|



Added configuration sections for Windows and MacOS in the IDEs guide.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please select the option that is relevant.
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.If you checked Linux, please specify the distro and version.
Test Configuration
Please paste the output of
wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.Checklist:
website/src/pages/changelog.mdxwith details of this PRSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.