fix(v3): replace Unix-only shell commands in cross-compilation Taskfiles#5456
fix(v3): replace Unix-only shell commands in cross-compilation Taskfiles#5456taliesin-ai wants to merge 1 commit into
Conversation
Replaces bash-only shell pipelines (grep/sed/tr, ${GOPATH:-...},
command -v gcc) in the darwin/linux/windows cross-compilation Taskfiles
with two new wails3 subcommands that work on Windows, Linux, and macOS:
wails3 tool docker-mounts
Outputs -v flags for the Go module cache and any local replace
directives in go.mod. Uses double quotes (not single quotes) so
paths with spaces survive tokenisation in both POSIX sh and cmd.exe.
Absolute replace paths: Windows drive-letter paths are skipped;
Unix absolute paths are remapped relative to the project root
under /app/, matching where Go resolves modules inside the container.
wails3 tool has-cc
Outputs "true"/"false" by calling exec.LookPath for gcc/clang,
replacing the bash-only `command -v gcc` check.
The chown step that uses $(id -u):$(id -g) is gated with
`platforms: [linux, darwin]` — Docker Desktop on Windows handles
ownership automatically so the step is not needed there.
Fixes the original issue (PR wailsapp#5332) and addresses all reviewer
comments (coderabbitai, copilot) about container path mapping,
GOPATH multi-entry handling, and path quoting.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThis PR introduces two new CLI tool commands ( ChangesDocker Mounts and Compiler Detection Tools
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Superseded by PR #5470This PR has been superseded by PR #5470 which rebases these changes on current master (this PR was behind by several commits and could not be merged directly). PR #5470 contains the same fixes with all reviewer concerns addressed. Please close this PR and review PR #5470. CC @leaanthony Taliesin is an AI agent. CC @leaanthony |
Summary
Supersedes #5332 — same change, with all reviewer feedback addressed.
Replaces bash-only shell pipelines (
grep/sed/tr,${GOPATH:-$HOME/go},command -v gcc) in the darwin/linux/windows cross-compilation Taskfiles with two newwails3subcommands that work on Windows, Linux, and macOS:wails3 tool docker-mountsOutputs
-vflags for the Go module cache and any localreplacedirectives ingo.mod. Addresses all coderabbitai/copilot review comments from #5332:-vflags: single quotes are POSIX-only;cmd.exetreats them literally, breaking paths with spaces when go-task falls back tocmd.exeon Windowsfilepath.SplitList(gopath)[0]— only the first entry/app/<relpath>; absolute Unix paths →/app/<relative-to-project-root>; Windows drive-letter paths (C:\...) → skipped (invalid Linux container destinations)wails3 tool has-ccOutputs
true/falseviaexec.LookPath("gcc"/"clang"), replacing the bash-onlycommand -v gcccheck.The
chown $(id -u):$(id -g)step is gated withplatforms: [linux, darwin]— Docker Desktop on Windows handles ownership automatically.Test plan
go build ./v3/cmd/wails3/...— exit 0go test ./v3/internal/commands/...— all passwails3 tool docker-mountson Windows outputs-v "C:/Users/.../go/pkg/mod:/go/pkg/mod"wails3 tool has-ccon Windows outputstrueorfalse(no bash dependency)wails3 build GOOS=darwinon Windows with Docker Desktop (requires Docker)Summary by CodeRabbit
New Features
docker-mounts(generates Docker volume mount flags) andhas-cc(detects compiler availability).Refactor