-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(deps): update go to 1.22 #2760
Changes from all commits
82477f6
3ddb71d
684e62e
505177a
eac3a04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export ANDROID_SDK_ROOT := /opt/android-sdk | ||
export ANDROID_NDK_HOME := /opt/android-sdk/ndk/21.2.6472646 | ||
# gomodcache location for gomobile build pkgs. Set to tmp folder, because writing access is needed. | ||
export GOMODCACHE_ROOT := /tmp/gomodcache/pkg/mod | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this? Is it required? If so, please add a comment why. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a comment. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
include ../../android-env.mk.inc | ||
|
||
# go mod makes the Android build hang forever. Remove this once we move to go modules in a controlled fashion. | ||
# Probably a variation of https://github.com/golang/go/issues/27234 - solution is to build it using vendored deps | ||
# by turning off GO111MODULE. See also: https://github.com/golang/go/issues/34181#issuecomment-640260162 | ||
# GOMODCACHE to /tmp directory, because gomobile needs to write pkgs. | ||
# Also set -glflags to fix the vendor issue with gomobile, see: https://github.com/golang/go/issues/67927#issuecomment-2241523694 | ||
build-android: | ||
GO111MODULE=off ANDROID_HOME=${ANDROID_SDK_ROOT} gomobile bind -x -a -ldflags="-s -w" -target android . | ||
GOMODCACHE=${GOMODCACHE_ROOT} ANDROID_HOME=${ANDROID_SDK_ROOT} gomobile bind -x -a -glflags="-mod=readonly" -ldflags="-s -w" -target android . | ||
build-ios: | ||
GO111MODULE=off gomobile bind -x -a -ldflags="-s -w" -target ios,iossimulator . | ||
GOMODCACHE=${GOMODCACHE_ROOT} gomobile bind -x -a -glflags="-mod=readonly" -ldflags="-s -w" -target ios,iossimulator . | ||
clean: | ||
rm -f mobileserver.aar mobileserver-sources.jar |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// This file imports the packages required by gomobile so they can be vendored. | ||
|
||
package mobileserver | ||
|
||
import ( | ||
_ "golang.org/x/mobile/bind" | ||
_ "golang.org/x/mobile/bind/java" | ||
_ "golang.org/x/mobile/bind/objc" | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we have a problem.
Above on line 31 there is:
This fails in Go 1.22 because
go get
is now disabled outside of modules. I locally built an image simply removing this line, but thencd backend/mobileserver; make
fails withRunning
go get golang.org/x/mobile/bind
did not actually fix it for me.Any idea how to resolve this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tried adding a dummy import
_ "golang.org/x/mobile/bind"
to force it to be vendored, butgo mod vendor
only vendors files in Go folders, butbind
has files like these that are then missing:EDIT: according to golang/go#43736 (comment) this should have been fixed 🤔
EDIT2: With the
_ "golang.org/x/mobile/cmd/gobind"
import path the Java files are vendored, but the generated code is not modules aware it seems:I filed an issue here: golang/go#67927
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A workaround that seems to work is to
mv vendor vendor.disabled
beforemake android
and move it back after 🙀