From c1efa3b6fc31c66ae8411b7e93a17a81cbdfdd89 Mon Sep 17 00:00:00 2001 From: ClashFX Team Date: Thu, 7 May 2026 10:34:32 +0800 Subject: [PATCH] fix(#70): include with_gvisor build tag in goClash archive 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 --- ClashFX/goClash/build_clash_universal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClashFX/goClash/build_clash_universal.py b/ClashFX/goClash/build_clash_universal.py index bca853e8..e6271cae 100644 --- a/ClashFX/goClash/build_clash_universal.py +++ b/ClashFX/goClash/build_clash_universal.py @@ -22,7 +22,7 @@ def get_version(): def build_clash(version, build_time, arch): command = f""" -{go_bin} build -trimpath -ldflags '-X "github.com/metacubex/mihomo/constant.Version={version}" \ +{go_bin} build -trimpath -tags with_gvisor -ldflags '-X "github.com/metacubex/mihomo/constant.Version={version}" \ -X "github.com/metacubex/mihomo/constant.BuildTime={build_time}"' \ -buildmode=c-archive -o goClash_{arch}.a """ envs = os.environ.copy()