fix(#70): include with_gvisor build tag in goClash archive#71
Merged
Conversation
The embedded mihomo core (goClash.a) was built without the with_gvisor
tag, causing WireGuard proxy creation to fail at config-load time:
proxy 0: create WireGuard device: gVisor is not included in this
build, rebuild with -tags with_gvisor
mihomo's WireGuard implementation depends on gVisor's userspace network
stack, gated behind the with_gvisor build tag. The standalone mihomo_core
binary already included this tag; the c-archive linked into the main app
process did not, so any config containing a WireGuard proxy failed to
load.
Add -tags with_gvisor to build_clash so goClash.a matches mihomo_core.
Verified locally: archive grew from 165 MB -> 184 MB and now contains
~7350 gvisor symbols (vs 2 forward declarations before).
Fixes #70
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #70 — config loading fails for any profile containing a WireGuard proxy:
Root Cause
The mihomo core ships in two flavors in this project:
with_gvisorgoClash.agoClash/main.go(-buildmode=c-archive)mihomo_coregoClash/mihomo-bin/main.go(standalone binary)build_clash_universal.pyalready passed-tags with_gvisorformihomo_core(line 51), but not forgoClash.a(line 25). Since config loading and WireGuard device creation happen inside the main process viagoClash.a, mihomo's tag-gated WireGuard implementation was unavailable and rejected every WireGuard proxy.The
github.com/metacubex/gvisordependency is already present ingo.mod, so this is purely a missing build flag — no new dependency, no Go code changes.Change
One-line addition of
-tags with_gvisorto thebuild_clasharchive command, matching whatbuild_mihomo_binalready does.Local Verification
Rebuilt with the patch, then compared symbol tables:
goClash.asizegvisorsymbols (nm goClash.a | grep -ic gvisor)Build completes cleanly through both
arm64andamd64arches and the universallipomerge.Impact
sing-tun, not gVisor.