From e11d99eef0875308016624347e473fbfac3facb7 Mon Sep 17 00:00:00 2001 From: Daniel LaCosse <3759828+daniellacosse@users.noreply.github.com> Date: Mon, 5 Feb 2024 13:47:10 -0500 Subject: [PATCH 1/2] fix(cordova/apple): don't strip tun2socks debug symbols (#1824) --- Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9a9bf3a245..ac8d75adcf 100644 --- a/Makefile +++ b/Makefile @@ -21,14 +21,13 @@ $(BUILDDIR)/android/tun2socks.aar: $(GOMOBILE) mkdir -p "$(BUILDDIR)/android" $(ANDROID_BUILD_CMD) -o "$@" $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks -# TODO(fortuna): -s strips symbols and is obsolete. Why are we using it? $(BUILDDIR)/ios/Tun2socks.xcframework: $(GOMOBILE) # -iosversion should match what outline-client supports. - $(GOBIND) -iosversion=11.0 -target=ios,iossimulator -o $@ -ldflags '-s -w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks + $(GOBIND) -iosversion=11.0 -target=ios,iossimulator -o $@ -ldflags '-w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks $(BUILDDIR)/macos/Tun2socks.xcframework: $(GOMOBILE) # MACOSX_DEPLOYMENT_TARGET and -iosversion should match what outline-client supports. - export MACOSX_DEPLOYMENT_TARGET=10.14; $(GOBIND) -iosversion=13.1 -target=macos,maccatalyst -o $@ -ldflags '-s -w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks + export MACOSX_DEPLOYMENT_TARGET=10.14; $(GOBIND) -iosversion=13.1 -target=macos,maccatalyst -o $@ -ldflags '-w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks apple: $(BUILDDIR)/apple/Tun2socks.xcframework @@ -38,7 +37,7 @@ $(BUILDDIR)/apple/Tun2socks.xcframework: $(BUILDDIR)/ios/Tun2socks.xcframework $ XGO=$(GOBIN)/xgo TUN2SOCKS_VERSION=v1.16.11 -XGO_LDFLAGS='-s -w -X main.version=$(TUN2SOCKS_VERSION)' +XGO_LDFLAGS='-w -X main.version=$(TUN2SOCKS_VERSION)' ELECTRON_PKG=$(ROOT_PKG)/outline/electron # TODO: build directly when on linux From 6356371797cf882a9472f8be4aa9f8c7bbfb3d21 Mon Sep 17 00:00:00 2001 From: Daniel LaCosse <3759828+daniellacosse@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:22:17 -0500 Subject: [PATCH 2/2] fix(www): don't try to build tun2socks when developing for the browser (#1833) * fix(www): don't try to build tun2socks when developing for the browser * do it in the javascript --- src/tun2socks/build.action.mjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/tun2socks/build.action.mjs b/src/tun2socks/build.action.mjs index 86d4fb8900..c91c9889e6 100644 --- a/src/tun2socks/build.action.mjs +++ b/src/tun2socks/build.action.mjs @@ -27,8 +27,18 @@ export async function main(...parameters) { const currentPlatform = os.platform() === 'win32' ? 'windows' : os.platform(); + if (targetPlatform === 'browser') { + return; + } + if (targetPlatform === currentPlatform && ['linux', 'windows'].includes(targetPlatform)) { - return spawnStream('go', 'build', '-o', `output/build/${targetPlatform}/tun2socks`, 'github.com/Jigsaw-Code/outline-client/src/tun2socks/outline/electron'); + return spawnStream( + 'go', + 'build', + '-o', + `output/build/${targetPlatform}/tun2socks`, + 'github.com/Jigsaw-Code/outline-client/src/tun2socks/outline/electron' + ); } await spawnStream('make', ['ios', 'macos', 'maccatalyst'].includes(targetPlatform) ? 'apple' : targetPlatform);