Skip to content

fix(setup): fix three Linux wizard QA issues (GOTOOLCHAIN, gcc version, defaults omitempty)#5357

Open
leaanthony wants to merge 1 commit intov3/feature/setupfrom
agent/engineer-linux/b85e86d1
Open

fix(setup): fix three Linux wizard QA issues (GOTOOLCHAIN, gcc version, defaults omitempty)#5357
leaanthony wants to merge 1 commit intov3/feature/setupfrom
agent/engineer-linux/b85e86d1

Conversation

@leaanthony
Copy link
Copy Markdown
Member

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 installed wails3 successfully via go 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 to findToolchainGo() which:

  1. If GOTOOLCHAIN is off, gives up immediately (upgrade really is required).
  2. If GOTOOLCHAIN names a specific version ≥ 1.25 (e.g. go1.25.0+auto), returns that version.
  3. If 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):

Go  status=installed  version='1.23.4'  msg='Go 1.25 available via GOTOOLCHAIN (1.25.0)'

Fix B — gcc binary version (wizard_linux.go)

The apt package map uses build-essential as the system package for gcc. The dependency checker was reporting build-essential's meta-package version (12.10ubuntu1) as the gcc version, which does not match what gcc --version shows (13.3.0).

Now, when the package manager reports gcc as installed, the code additionally runs gcc --version and extracts the real binary version from the first line.

Result:

gcc  status=installed  version='13.3.0'

Fix C — ProjectDefaults omitempty (defaults.go)

String fields in ProjectDefaults lacked omitempty YAML/JSON tags. A POST /api/defaults that omitted fields (e.g. only updating author.name and defaultTemplate) would zero out CopyrightTemplate, DescriptionTemplate, DefaultVersion, etc. in the saved YAML. On next load, those defaults (baked into Default()) would be shadowed by the empty strings.

Added omitempty to all string fields in ProjectDefaults. The UseInterfaces bool is left without omitempty because false is a meaningful user-set value that must be preserved.

Result — partial POST with only {"author":{"name":"Test"},"project":{"defaultTemplate":"svelte"}}:

author:
    name: Test
    company: ""
project:
    defaultTemplate: svelte
    useInterfaces: false

CopyrightTemplate and DefaultVersion are omitted from YAML; Load() fills them from Default()"© {year}, {company}" and "0.1.0" respectively.

Test environment

  • Ubuntu 24.04 LTS, kernel 6.8.0-111-generic
  • System Go: 1.23.4; GOTOOLCHAIN-cached: 1.25.0
  • gcc 13.3.0 (build-essential 12.10ubuntu1)

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>
Copilot AI review requested due to automatic review settings May 6, 2026 20:46
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • v3-alpha
  • master

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 81481dad-d248-49b6-9210-02480b008933

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 agent/engineer-linux/b85e86d1

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 --version instead of relying on meta-package versions.
  • Add omitempty to ProjectDefaults string fields to avoid writing empty strings into defaults.yaml and 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.

Comment on lines +152 to +159
// 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 ""
Comment on lines +164 to +167
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"`
@leaanthony
Copy link
Copy Markdown
Member Author

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 reviewed ✅ label.

CC @leaanthony

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.

2 participants