Rod Hynes 4 lat temu
rodzic
commit
fd2db21d43

+ 1 - 1
.github/workflows/tests.yml

@@ -15,7 +15,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [ "ubuntu" ]
-        go: [ "1.14.12" ]
+        go: [ "1.17.1" ]
         test-type: [ "detector", "coverage", "memory" ]
 
     runs-on: ${{ matrix.os }}-latest

+ 1 - 1
ClientLibrary/Dockerfile

@@ -21,7 +21,7 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
 
 # Install Go.
 # NOTE: Go 1.10+ is required to build c-shared for windows (https://github.com/golang/go/commit/bb0bfd002ada7e3eb9198d4287b32c2fed6e8da6)
-ENV GOVERSION=go1.14.12 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1
+ENV GOVERSION=go1.17.1 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1
 
 RUN curl -L https://storage.googleapis.com/golang/$GOVERSION.linux-amd64.tar.gz -o /tmp/go.tar.gz \
    && tar -C /usr/local -xzf /tmp/go.tar.gz \

+ 7 - 8
ClientLibrary/build-darwin.sh

@@ -9,9 +9,12 @@ if [ -z ${2+x} ]; then BUILD_TAGS=""; else BUILD_TAGS="$2"; fi
 # Note:
 #   clangwrap.sh needs to be updated when the Go version changes.
 #   The last version was:
-#   https://github.com/golang/go/blob/go1.14.12/misc/ios/clangwrap.sh
+#   https://github.com/golang/go/blob/go1.17.1/misc/ios/clangwrap.sh
 #     - with a patch to lower -mios-version-min to 7.0
-GO_VERSION_REQUIRED="1.14.12"
+GO_VERSION_REQUIRED="1.17.1"
+
+# At this time, we don't support modules
+export GO111MODULE=off
 
 BASE_DIR=$(cd "$(dirname "$0")" ; pwd -P)
 cd ${BASE_DIR}
@@ -113,17 +116,13 @@ build_for_ios () {
 
   prepare_build darwin
 
-  CC=${BASE_DIR}/clangwrap.sh \
-  CXX=${BASE_DIR}/clangwrap.sh \
-  CGO_LDFLAGS="-arch armv7 -isysroot $(xcrun --sdk iphoneos --show-sdk-path)" \
-  CGO_CFLAGS=-isysroot$(xcrun --sdk iphoneos --show-sdk-path) \
-  CGO_ENABLED=1 GOOS=darwin GOARCH=arm GOARM=7 go build -buildmode=c-archive -ldflags "$LDFLAGS" -tags "${BUILD_TAGS}" -o ${IOS_BUILD_DIR}/arm7/libpsiphontunnel.a PsiphonTunnel.go
+  # As of Go 1.15, "ios/arm" is no longer supported: https://golang.org/doc/go1.15#darwin
 
   CC=${BASE_DIR}/clangwrap.sh \
   CXX=${BASE_DIR}/clangwrap.sh \
   CGO_LDFLAGS="-arch arm64 -isysroot $(xcrun --sdk iphoneos --show-sdk-path)" \
   CGO_CFLAGS=-isysroot$(xcrun --sdk iphoneos --show-sdk-path) \
-  CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -buildmode=c-archive -ldflags "$LDFLAGS" -tags "${BUILD_TAGS}" -o ${IOS_BUILD_DIR}/arm64/libpsiphontunnel.a PsiphonTunnel.go
+  CGO_ENABLED=1 GOOS=ios GOARCH=arm64 go build -buildmode=c-archive -ldflags "$LDFLAGS" -tags "${BUILD_TAGS}" -o ${IOS_BUILD_DIR}/arm64/libpsiphontunnel.a PsiphonTunnel.go
 
 }
 

+ 11 - 11
ClientLibrary/clangwrap.sh

@@ -2,19 +2,19 @@
 # This uses the latest available iOS SDK, which is recommended.
 # To select a specific SDK, run 'xcodebuild -showsdks'
 # to see the available SDKs and replace iphoneos with one of them.
-SDK=iphoneos
+if [ "$GOARCH" == "arm64" ]; then
+	SDK=iphoneos
+	PLATFORM=ios
+	CLANGARCH="arm64"
+else
+	SDK=iphonesimulator
+	PLATFORM=ios-simulator
+	CLANGARCH="x86_64"
+fi
+
 SDK_PATH=`xcrun --sdk $SDK --show-sdk-path`
 export IPHONEOS_DEPLOYMENT_TARGET=5.1
 # cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang.
 CLANG=`xcrun --sdk $SDK --find clang`
 
-if [ "$GOARCH" == "arm" ]; then
-	CLANGARCH="armv7"
-elif [ "$GOARCH" == "arm64" ]; then
-	CLANGARCH="arm64"
-else
-	echo "unknown GOARCH=$GOARCH" >&2
-	exit 1
-fi
-
-exec $CLANG -arch $CLANGARCH -isysroot $SDK_PATH -mios-version-min=7.0 "$@"
+exec "$CLANG" -arch $CLANGARCH -isysroot "$SDK_PATH" -m${PLATFORM}-version-min=7.0 "$@"

+ 2 - 0
ClientLibrary/make.bash

@@ -16,6 +16,8 @@ if [ ! -d ${BUILD_DIR} ]; then
   mkdir ${BUILD_DIR}
 fi
 
+# At this time, we don't support modules
+export GO111MODULE=off
 
 prepare_build () {
 

+ 1 - 1
ConsoleClient/Dockerfile

@@ -22,7 +22,7 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
   && rm -rf /var/lib/apt/lists/*
 
 # Install Go.
-ENV GOVERSION=go1.14.12 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1
+ENV GOVERSION=go1.17.1 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1
 
 RUN curl -L https://storage.googleapis.com/golang/$GOVERSION.linux-amd64.tar.gz -o /tmp/go.tar.gz \
    && tar -C /usr/local -xzf /tmp/go.tar.gz \

+ 3 - 0
ConsoleClient/make.bash

@@ -10,6 +10,9 @@ fi
 # $2, if specified, is go build tags
 if [ -z ${2+x} ]; then BUILD_TAGS=""; else BUILD_TAGS="$2"; fi
 
+# At this time, we don't support modules
+export GO111MODULE=off
+
 EXE_BASENAME="psiphon-tunnel-core"
 
 prepare_build () {

+ 2 - 2
MobileLibrary/Android/Dockerfile

@@ -19,7 +19,7 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
   && rm -rf /var/lib/apt/lists/*
 
 # Install Go.
-ENV GOVERSION=go1.14.12 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1
+ENV GOVERSION=go1.17.1 GOROOT=/usr/local/go GOPATH=/go PATH=$PATH:/usr/local/go/bin:/go/bin CGO_ENABLED=1
 
 RUN curl -L https://storage.googleapis.com/golang/$GOVERSION.linux-amd64.tar.gz -o /tmp/go.tar.gz \
   && tar -C /usr/local -xzf /tmp/go.tar.gz \
@@ -61,7 +61,7 @@ RUN mkdir -p $GOPATH/pkg/gomobile/dl \
   && mv ./cmd/gomobile/build.go ./cmd/gomobile/build.go.orig \
   && sed -e 's/"strconv"//g' ./cmd/gomobile/build.go.orig > ./cmd/gomobile/build.go \
   && echo "master: $(git rev-parse master)\npinned: $(git rev-parse pinned)" | tee $GOROOT/MOBILE \
-  && go install golang.org/x/mobile/cmd/gomobile \
+  && GO111MODULE=off go install golang.org/x/mobile/cmd/gomobile \
   && gomobile init -v
 
 WORKDIR $GOPATH/src

+ 1 - 1
MobileLibrary/Android/README.md

@@ -65,7 +65,7 @@ When that command completes, the compiled `.aar` files (suitable for use in an A
 ##### Prerequisites:
 
  - The `build-essential` package (on Debian based systems - or its equivalent for your platform)
- - Go 1.13 or later
+ - Go 1.15 or later
  - Full JDK
  - Android NDK
  - Android SDK

+ 4 - 0
MobileLibrary/iOS/PsiphonTunnel/PsiphonTunnel/Info.plist

@@ -20,5 +20,9 @@
 	<string>$(CURRENT_PROJECT_VERSION)</string>
 	<key>NSPrincipalClass</key>
 	<string></string>
+	<key>UIRequiredDeviceCapabilities</key>
+	<array>
+		<string>arm64</string>
+	</array>
 </dict>
 </plist>

+ 1 - 1
MobileLibrary/iOS/SampleApps/TunneledWebRequest/TunneledWebRequest/Info.plist

@@ -42,7 +42,7 @@
 	<string>Main</string>
 	<key>UIRequiredDeviceCapabilities</key>
 	<array>
-		<string>armv7</string>
+		<string>arm64</string>
 	</array>
 	<key>UISupportedInterfaceOrientations</key>
 	<array>

+ 1 - 1
MobileLibrary/iOS/SampleApps/TunneledWebView/TunneledWebView/Info.plist

@@ -44,7 +44,7 @@
 	<string>Main</string>
 	<key>UIRequiredDeviceCapabilities</key>
 	<array>
-		<string>armv7</string>
+		<string>arm64</string>
 	</array>
 	<key>UISupportedInterfaceOrientations</key>
 	<array>

+ 1 - 1
MobileLibrary/iOS/USAGE.md

@@ -37,7 +37,7 @@ This code is a canonical guide for integrating the Library.
 
 ## Compiling and testing
 
-The following architecture targets are compiled into the Library's framework binary: `armv7`, `arm64`, and `x86_64`. This means that the Library can run on phones or in a simulator (on a 64-bit host system).
+The following architecture targets are compiled into the Library's framework binary: `arm64`, and `x86_64`. This means that the Library can run on phones or in a simulator (on a 64-bit host system).
 
 When run in a simulator, there may be errors shown in the device log. This does not seem to affect the execution of the app (or Library).
 

+ 6 - 4
MobileLibrary/iOS/build-psiphon-framework.sh

@@ -5,7 +5,7 @@ set -e -u -x
 if [ -z ${1+x} ]; then BUILD_TAGS=""; else BUILD_TAGS="$1"; fi
 
 # Modify this value as we use newer Go versions.
-GO_VERSION_REQUIRED="1.14.12"
+GO_VERSION_REQUIRED="1.17.1"
 
 # At this time, gomobile doesn't support modules
 export GO111MODULE=off
@@ -81,10 +81,11 @@ function gomobile_build_for_platform() {
   # gomobile pinned version 92f3b9c list of
   # valid archs are "arm", "arm64", "386", "amd64".
   # https://github.com/golang/mobile/blob/92f3b9caf7ba8f4f9c10074225afcba0cba47a62/cmd/gomobile/env.go#L26
-
+  #
+  # As of Go 1.15, "ios/arm" is no longer supported: https://golang.org/doc/go1.15#darwin
   case "${PLATFORM}" in
     ios)
-      TARGETS="ios/arm,ios/arm64" 
+      TARGETS="ios/arm64"
       ;;
     simulator)
       TARGETS="ios/amd64"
@@ -245,7 +246,8 @@ CODE_SIGNING_ALLOWED="NO" \
 STRIP_BITCODE_FROM_COPIED_FILES="NO" \
 BUILD_LIBRARY_FOR_DISTRIBUTION="YES" \
 ONLY_ACTIVE_ARCH="NO" \
-SKIP_INSTALL="NO"
+SKIP_INSTALL="NO" \
+EXCLUDED_ARCHS="armv7"
 
 # Build PsiphonTunnel framework for simulator.
 #

+ 1 - 1
Server/Dockerfile-binary-builder

@@ -1,6 +1,6 @@
 FROM alpine:3.10.2
 
-ENV GOLANG_VERSION 1.14.12
+ENV GOLANG_VERSION 1.17.1
 ENV GOLANG_SRC_URL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz
 
 RUN set -ex \

+ 1 - 1
Server/README.md

@@ -2,7 +2,7 @@
 
 ### Build
 Prerequisites:
- - Go 1.13 or later
+ - Go 1.15 or later
 
 Build Steps:
  - Build: `go build -o psiphond main.go`

+ 3 - 0
Server/make.bash

@@ -13,6 +13,9 @@ fi
 # $1, if specified, is go build tags
 if [ -z ${1+x} ]; then BUILD_TAGS=""; else BUILD_TAGS="$1"; fi
 
+# At this time, we don't support modules
+export GO111MODULE=off
+
 prepare_build () {
   BUILDINFOFILE="psiphond_buildinfo.txt"
   BUILDDATE=$(date -Iseconds)