mirror of
https://github.com/sartoopjj/thefeed.git
synced 2026-05-19 09:54:36 +03:00
fix: update Android build process to use cgo for DNS resolution and streamline HTTP client configuration
This commit is contained in:
@@ -91,12 +91,20 @@ jobs:
|
||||
if [ "${{ matrix.goos }}" = "android" ]; then
|
||||
BUILD_MODE="-buildmode=pie"
|
||||
fi
|
||||
# Go's internal linker can do PIE for android/arm64 with CGO=0,
|
||||
# but android/arm (32-bit) needs an external linker via cgo.
|
||||
# Wire the NDK clang for the v7 build; arm64 stays CGO-less.
|
||||
if [ "${{ matrix.goos }}" = "android" ] && [ "${{ matrix.goarch }}" = "arm" ]; then
|
||||
# Android: build with cgo so DNS resolution goes through bionic
|
||||
# libc / netd instead of Go's pure-Go resolver, which on Android
|
||||
# finds /etc/resolv.conf empty and dies with "[::1]:53 connection
|
||||
# refused". Wire the right NDK clang per architecture.
|
||||
if [ "${{ matrix.goos }}" = "android" ]; then
|
||||
export CGO_ENABLED=1
|
||||
export CC="$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi26-clang"
|
||||
case "${{ matrix.goarch }}" in
|
||||
arm)
|
||||
export CC="$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi26-clang"
|
||||
;;
|
||||
arm64)
|
||||
export CC="$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang"
|
||||
;;
|
||||
esac
|
||||
test -x "$CC" || { echo "NDK clang not found at $CC"; exit 1; }
|
||||
fi
|
||||
if [ "${{ matrix.goos }}" = "android" ] && [ "${{ matrix.goarch }}" = "arm64" ]; then
|
||||
|
||||
Reference in New Issue
Block a user