fix(setup): fix three Linux wizard QA issues (GOTOOLCHAIN, gcc version, defaults omitempty)#5357
fix(setup): fix three Linux wizard QA issues (GOTOOLCHAIN, gcc version, defaults omitempty)#5357leaanthony wants to merge 1 commit intov3/feature/setupfrom
Conversation
Issue A: checkGo() now detects GOTOOLCHAIN (go env GOTOOLCHAIN ≠ "off")
and scans the module cache for a downloaded go1.25+ toolchain. Users
who installed wails3 via GOTOOLCHAIN auto-download will see "installed"
rather than "needs_update" for Go.
Issue B: gcc version now comes from `gcc --version` (e.g. "13.3.0")
instead of the build-essential meta-package version ("12.10ubuntu1").
Issue C: ProjectDefaults string fields gain omitempty YAML/JSON tags so
a partial POST to /api/defaults does not zero out CopyrightTemplate,
DescriptionTemplate, DefaultVersion, etc. in the saved YAML.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Pull request overview
This PR addresses Linux QA issues in the v3 setup wizard by improving dependency/version detection (Go toolchain via GOTOOLCHAIN, gcc binary version reporting) and preventing unintended persistence of empty string defaults when saving global project defaults.
Changes:
- Update Linux Go dependency check to treat
GOTOOLCHAIN-provided Go 1.25+ as satisfying the requirement even when system Go is older. - Improve Linux gcc version reporting by querying
gcc --versioninstead of relying on meta-package versions. - Add
omitemptytoProjectDefaultsstring fields to avoid writing empty strings intodefaults.yamland shadowing built-in defaults on reload.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| v3/internal/setupwizard/wizard_linux.go | Enhances Linux dependency checking for Go toolchains (GOTOOLCHAIN) and gcc version reporting. |
| v3/internal/defaults/defaults.go | Adds omitempty tags to project default string fields to prevent empty-string persistence in YAML/JSON. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // GOTOOLCHAIN=auto|path: scan the module cache for a downloaded toolchain. | ||
| gopath, err := execCommand("go", "env", "GOPATH") | ||
| if err != nil || gopath == "" { | ||
| return "" | ||
| } | ||
| entries, err := os.ReadDir(gopath + "/pkg/mod/golang.org") | ||
| if err != nil { | ||
| return "" |
| if !strings.HasPrefix(name, "toolchain@v0.0.1-go") { | ||
| continue | ||
| } | ||
| ver := strings.TrimPrefix(name, "toolchain@v0.0.1-go") |
| CopyrightTemplate string `json:"copyrightTemplate,omitempty" yaml:"copyrightTemplate,omitempty"` | ||
| DescriptionTemplate string `json:"descriptionTemplate,omitempty" yaml:"descriptionTemplate,omitempty"` | ||
| DefaultVersion string `json:"defaultVersion,omitempty" yaml:"defaultVersion,omitempty"` | ||
| UseInterfaces bool `json:"useInterfaces" yaml:"useInterfaces"` |
|
Good bug fixes for the Linux setup wizard! The GOTOOLCHAIN detection and ProjectDefaults omitempty fixes address real QA issues. I've dispatched cross-platform test sub-issues: Once all platforms report back with successful test results, I'll apply the CC @leaanthony |
Summary
Fixes three issues found during Linux QA of the setup wizard on
v3/feature/setup.Fix A — Go GOTOOLCHAIN detection (
wizard_linux.go)checkGo()previously reported "needs_update" for any system Go < 1.25, including systems where GOTOOLCHAIN is active and Go 1.25 is available from the module cache. Users who installedwails3successfully viago install(which auto-downloaded Go 1.25 via GOTOOLCHAIN) would see a confusing red "needs update" indicator in the very wizard launched by that binary.Now
checkGo()falls through tofindToolchainGo()which:GOTOOLCHAINisoff, gives up immediately (upgrade really is required).GOTOOLCHAINnames a specific version ≥ 1.25 (e.g.go1.25.0+auto), returns that version.GOTOOLCHAIN=auto|path, scans$GOPATH/pkg/mod/golang.org/toolchain@v0.0.1-go1.25*for a downloaded cache entry.Result on the QA VM (system go 1.23.4, GOTOOLCHAIN auto-downloaded 1.25.0):
Fix B — gcc binary version (
wizard_linux.go)The apt package map uses
build-essentialas the system package forgcc. The dependency checker was reportingbuild-essential's meta-package version (12.10ubuntu1) as the gcc version, which does not match whatgcc --versionshows (13.3.0).Now, when the package manager reports
gccas installed, the code additionally runsgcc --versionand extracts the real binary version from the first line.Result:
Fix C —
ProjectDefaultsomitempty (defaults.go)String fields in
ProjectDefaultslackedomitemptyYAML/JSON tags. APOST /api/defaultsthat omitted fields (e.g. only updatingauthor.nameanddefaultTemplate) would zero outCopyrightTemplate,DescriptionTemplate,DefaultVersion, etc. in the saved YAML. On next load, those defaults (baked intoDefault()) would be shadowed by the empty strings.Added
omitemptyto all string fields inProjectDefaults. TheUseInterfacesbool is left withoutomitemptybecausefalseis a meaningful user-set value that must be preserved.Result — partial POST with only
{"author":{"name":"Test"},"project":{"defaultTemplate":"svelte"}}:CopyrightTemplateandDefaultVersionare omitted from YAML;Load()fills them fromDefault()→"© {year}, {company}"and"0.1.0"respectively.Test environment