Преглед на файлове

Revert to GOPATH mode for gomobile builds

- Temporary GOPATH setup and gomobile install need to be reworked for Go
  modules mode.

- `gomobile init` executes `go install golang.org/x/mobile/cmd/gobind@latest`,
  and so may not be respecting our gomobile version pin.

  See: https://github.com/golang/mobile/blob/ce6a79cf6a13dd77095a6f8dbee5f39848fa7da1/cmd/gomobile/init.go#L80-L81
Rod Hynes преди 3 години
родител
ревизия
b62ca356d5
променени са 3 файла, в които са добавени 7 реда и са изтрити 0 реда
  1. 1 0
      MobileLibrary/Android/Dockerfile
  2. 3 0
      MobileLibrary/Android/make.bash
  3. 3 0
      MobileLibrary/iOS/build-psiphon-framework.sh

+ 1 - 0
MobileLibrary/Android/Dockerfile

@@ -54,6 +54,7 @@ RUN mkdir -p $GOPATH/pkg/gomobile/dl \
   && mv ./cmd/gomobile/init.go ./cmd/gomobile/init.go.orig \
   && sed -e 's/golang.org\/x\/mobile\/cmd\/gobind@latest/golang.org\/x\/mobile\/cmd\/gobind/g' ./cmd/gomobile/init.go.orig > ./cmd/gomobile/init.go \
   && echo "master: $(git rev-parse master)\npinned: $(git rev-parse master)" | tee $GOROOT/MOBILE \
+  && export GO111MODULE=off \
   && go get golang.org/x/mod/modfile \
   && go get golang.org/x/tools/go/packages \
   && go install golang.org/x/mobile/cmd/gomobile \

+ 3 - 0
MobileLibrary/Android/make.bash

@@ -10,6 +10,9 @@ fi
 # $1, if specified, is go build tags
 if [ -z ${1+x} ]; then BUILD_TAGS=""; else BUILD_TAGS="$1"; fi
 
+# At this time, psiphon-tunnel-core doesn't support modules
+export GO111MODULE=off
+
 BUILDINFOFILE="psiphon-tunnel-core_buildinfo.txt"
 BUILDDATE=$(date --iso-8601=seconds)
 BUILDREPO=$(git config --get remote.origin.url)

+ 3 - 0
MobileLibrary/iOS/build-psiphon-framework.sh

@@ -7,6 +7,9 @@ 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.19.2"
 
+# At this time, psiphon-tunnel-core doesn't support modules
+export GO111MODULE=off
+
 # Reset the PATH to macOS default. This is mainly so we don't execute the wrong
 # gomobile executable.
 PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin