diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d9489431..a8432f4cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,7 +95,14 @@ jobs: if: steps.cache-libhysteria2-restore.outputs.cache-hit != 'true' uses: actions/setup-go@v5 with: - go-mod-file: 'AndroidLibXrayLite/go.mod' + go-version-file: 'AndroidLibXrayLite/go.mod' + + - name: Patch Go use 600296 + if: steps.cache-libhysteria2-restore.outputs.cache-hit != 'true' + #https://go-review.googlesource.com/c/go/+/600296 + run: | + cd "$(go env GOROOT)" + curl "https://go-review.googlesource.com/changes/go~600296/revisions/5/patch" | base64 -d | patch --verbose -p 1 - name: Build libhysteria2 if: steps.cache-libhysteria2-restore.outputs.cache-hit != 'true' diff --git a/libhysteria2.sh b/libhysteria2.sh index 5c0d6fd02..b2a721170 100644 --- a/libhysteria2.sh +++ b/libhysteria2.sh @@ -14,7 +14,7 @@ for target in "${targets[@]}"; do echo "Building for ${abi} with ${ndk_target} (${goarch})" - CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/${ndk_target}-clang" CGO_ENABLED=1 CGO_LDFLAGS="-Wl,-z,max-page-size=16384" GOOS=android GOARCH=$goarch go build -o libs/$abi/libhysteria2.so -trimpath -ldflags "-s -w -buildid=" ./app + CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/${ndk_target}-clang" CGO_ENABLED=1 CGO_LDFLAGS="-Wl,-z,max-page-size=16384" GOOS=android GOARCH=$goarch go build -o libs/$abi/libhysteria2.so -trimpath -ldflags "-s -w -buildid=" -buildvcs=false ./app echo "Built libhysteria2.so for ${abi}" done