It dosen't make sense to parse stdout and stderr to get a necessary
information like clang command. Actually envClang sometimes didn't work
correctly due to this.
Fixesgolang/go#53316
Change-Id: Ia2c518c44c0003b4f9b50dba85fb971c2ef4340d
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/620315
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Change-Id: I94b7d1c7029102c252a77f75929066281040b9f2
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/564856
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com>
An app containing a framework can't be validated and distributed without these two entries in the framework bundle's `Info.plist`.
Using `0.0.epoch` format per discussion here: https://go.dev/issue/66500#issuecomment-2025767017
Tested Xcode 15.3 with:
- without keys, fails to validate
- with keys: passing validation, distribution upload, and Apple's server validation ("Ready to test" server check).
Fixesgolang/go#66500
Change-Id: I2e0718247301ec7db36f8d85aea81b203ca7848b
GitHub-Last-Rev: 1455c5e816
GitHub-Pull-Request: golang/mobile#100
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/575115
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
This patch updates the framework generation code to follow the Apple spec for placing content:
https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle
Previously, we setup the framework in MacOS format, and used symlinks to make it compatible with iOS format. This approach no longer works (it works locally in simulator, but causes signing issues when attempting to upload apps for distribution, or running on real hardware). We now setup the expected bundle format for each platform.
Other benefits:
- Thirds the size of the xcframework and resulting app binary when distributing the xcframework by zip (common for SPM and other formats). The symlinks resulted in duplicate files after zipping, which made it into the final app.
- Set MinimumOSVersion, fixing SPM compatibility issue
- Eliminates the blank Info.plist
- Initial testing shows this also fixesgolang/go#66406 (code signing issues) as a side effect of using the proper format
Testing:
- Tested all 4 platforms (iOS, simulator, macOS, Catalyst) on Xcode 15.3
Fixesgolang/go#66406Fixesgolang/go#66500
Change-Id: I8538989efe67cb0d2d0496087dcbeca923c3dffe
GitHub-Last-Rev: 28dca85888
GitHub-Pull-Request: golang/mobile#98
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/574055
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This change adds compatibility for Xcode 15.3 to "gomobile bind" for building xcframeworks.
- New blank Info.plist in the *.framework target root
- Add CFBundleExecutable and CFBundleIdentifier to the resource level Info.plist
Tested locally on my framework on Xcode 15.3 (fixes issue) and 15.2 (doesn't create new issues).
Would love to get some more folks to try this fix, to make sure it works broadly.
Note: I'm using the framework name as the bundleID. Some chance of collision here, but didn't want to add a required top level cmd parameter. I don't *think* a collision is a serious concern, but I'm not an apple build system expert.
To test:
- sync my branch
- build go mobile: `go build` in the `cmd/gomobile` dir
- Build your xcframework with this version of go mobile: `gomobile bind ... `
- Launch a project using the xcframework in Xcode 15.3, and run in simulator
Fixesgolang/go#66018
Change-Id: I3e8ee99adb09071aa89a541dc97271a44b552ea3
GitHub-Last-Rev: 6277c7d66a
GitHub-Pull-Request: golang/mobile#96
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/572175
TryBot-Result: Gopher Robot <gobot@golang.org>
TryBot-Bypass: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
On macOS, a temporary directory starts with /var, which is a symbolic
link to /private/var. And in gomobile, a temporary directory is usually
used as a working directly. Unfortunately, xcodebuild in Xcode 15 seems
to have a bug and might not be able to understand fullpaths with
symbolic links. As a workaround, resolve the path with symbolic links by
filepath.EvalSymlinks.
Fixesgolang/go#63141
Change-Id: Ieb684223192fc3e354b79dededaecdb0b25937e6
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/530135
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Hajime Hoshi <hajimehoshi@gmail.com>
go.mod files are automatically generated in a temporary working
directory in order to resolve dependencies. The go.mod files didn't
include go statements, which means a Go compiler tried to resolve
dependencies in the most conservative way. In this way, some paths could
not be resolved as ambiguous paths (e.g. golang.org/x/exp vs
golang.org/x/exp/shiny).
This CL fixes this issue by giving a go statement to the go.mod files.
Fixesgolang/go#62458
Change-Id: Ibabd1974f8cd7a3e01eb89994080e32a7115693a
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/525695
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Change-Id: Ib2d256f59ec759100f8c25e52acf24547a6528fb
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/489735
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: shuang cui <imcusg@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This change makes building archive files for iOS concurrent for each
architecture and each platform. The strategy is basically the same as
my previous CL for Android: https://go.dev/cl/426274.
This change also specifies GOMODCACHE explicitly when executing Go
commands so that the existing cache is always used. The default
GOMODCACHE is $GOPATH/pkg/mod, and this path varies when a temporary
GOPATH is specified, which results in cold cache.
Before this change (on my MacBook Pro 2020):
$ time go run ./cmd/gomobile/ bind -target ios ./example/bind/hello/
real 0m23.274s
user 0m15.751s
sys 0m10.469s
After this change:
$ time go run ./cmd/gomobile/ bind -target ios ./example/bind/hello/
real 0m8.059s
user 0m13.763s
sys 0m9.004s
Updates golang/go#37902
Updates golang/go#54770
Change-Id: Iaeb077b58c22ab63d28f78972a0af76660883a05
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/442195
Reviewed-by: Changkun Ou <mail@changkun.de>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Gobind utilizes golang.org/x/tools/go/packages.Load to find
the directory of a package. Configure the load configuration
to just find the list of files. Zero load mode is equivalent
to combining NeedName+NeedFiles+NeedCompiledGoFiles bits.
That is unnecessary, and can increase the chance of load
failures. For example, load with the zero load mode may fail
if all the necessary cgo dependencies aren't available in the
system, but that shouldn't be critical for gobind's use case.
Updates golang/go#56292
Change-Id: Ifaf4f43e9053cf4a43fd657a9a394fc13f611576
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/443935
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Using the test binary as the "gobind" command not only avoids the
overhead of recompiling the command, but also allows commands like "go
test -race" to actually test the requested configuration of the
command.
Logging stderr and stdout separately — and logging only stderr by
default — makes the failure messages much easier to spot. (Logging the
combined output as before produced a massive wall of text that tends
to bury the actual errors.)
For golang/go#56292.
Change-Id: Ia11fad19418d9b9004608c76fe512ceab4f247bc
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/443655
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: David Chase <drchase@google.com>
This CL cleans up the code using gobind by these fixes:
- Run the gobind command for each platform, instead of each target (=
platform + arch).
- Run the gobind command in parallel with errgroup.Group.
This CL doesn't improve performance significantly, but should improve
readability by splitting the long for-range loop.
Updates golang/go#54770
Change-Id: I881810b95db0fa6a6d17982154591af467f1ebfe
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/437035
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Changkun Ou <mail@changkun.de>
Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
This speeds up gomobile-bind for Android by concurrent building for
each architecture.
Before this change (on my MacBook Pro 2020):
```
$ time go run ./cmd/gomobile/ bind -target android ./example/bind/hello/
real 0m22.555s
user 0m14.859s
sys 0m10.232s
```
After this change:
```
$ time go run ./cmd/gomobile/ bind -target android ./example/bind/hello/
real 0m9.404s
user 0m15.846s
sys 0m11.044s
```
For #54770
Change-Id: I5a709dd4422a569e9244e924bd43ad2da1ede164
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/426274
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Changkun Ou <mail@changkun.de>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
This change removes Gomobile's dependency on ANDROID_HOME and
ANDROID_NDK_HOME. Setting ANDROID_HOME is generally optional,
and ANDROID_NDK_HOME is deprecated.
This change also increases the minimum API version to 16, as
all SDKs that supported API 15 are now deprecated.
Fixesgolang/go#52470
Change-Id: I546365774a089e5d7ae1be0a538efd72741d92ac
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/401574
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Daniel Skinner <daniel@dasa.cc>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Gofmt to update doc comments to the new formatting.
For golang/go#51082.
Change-Id: I9b4c287e2d25aa108adfa9fe2f972c8fd3d68fe1
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/399597
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Go install requires a version to be provided after the package name.
gomobile init command is updated to reflect this new requirement
Fixesgolang/go#50994
Change-Id: I014bd6815d9620415ceb43dd7e0aea3afac60556
GitHub-Last-Rev: 3a07fa6691
GitHub-Pull-Request: golang/mobile#75
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/384414
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
cmd/gomobile depends on cmd/gobind. Code generated by cmd/gobind
depends on packages under golang.org/x/mobile/bind. Explicitly
list those (with build tags) so the go command can take into account
these implicit dependencies (e.g. go mod tidy or go mod vendor).
We use tag `mobile_implicit`.
Updates golang/go#43736
Change-Id: I09c519556ffe8e8c4db0754571c5173b1613c210
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/377754
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
It is a full of unused code. Remove it.
Change-Id: I086f244adde57c8c9f1fc73b46e25550f15562f7
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/369197
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
The TODO message was introduced in CL 13041, but later resolved
in CL 77070 because it allows bundle id customization.
Remove the oudated TODO message.
Change-Id: Ib32793ace937f67b5c95d6efadd6d4eef48a8986
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/369200
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Alex Rakoczy <alex@golang.org>
Run-TryBot: Alex Rakoczy <alex@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Starting from NDK 23, GNU binutils are fully migrated to LLVM binutils.
Use LLVM if GNU binutils are missing.
Fixesgolang/go#49808
Change-Id: Iccb40780390a66081fc811d717c7357194b92acf
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/369195
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
fix file data align to 4
Change-Id: Ie88c46521e216b3f83a8dc3495591cd19bce83c6
GitHub-Last-Rev: aebf3cd7ff
GitHub-Pull-Request: golang/mobile#73
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/351789
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
The default Xcode project settings do not specify any team ID.
If we open the Xcode project in Xcode, it won't compile and deploy
the app directly via Xcode unless a user manually selects the team
account. This is an extra effort. Since we can detect team ID
automatically embeds the teamID directly into the project settings
so it better helps the user to compile and deploy apps without getting
into the project settings.
Change-Id: I268653f66280bb6cf013f0a28891e4382e4de576
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/351409
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
This is is a follow-up from my previous PR (#65). It makes gomobile
aware of GOOS=ios and adds support for specifying specific Apple
platforms, instead of overloading the "ios" platform.
Supported platforms: ios, iossimulator, macos, and maccatalyst
These can now be specified the -target argument to gomobile, e.g.:
gomobile build -target=ios,iossimulator,macos,maccatalyst
It preserves the current behavior of -target=ios, which will build for
ios and iossimulator on supported architectures (arm64 and amd64).
It adds platform-specific build tags so Go code can discriminate between
different Apple platforms like maccatalyst (UIKit on macOS).
This PR also fixes a number of broken tests.
TODO: cgo has a bug where c-archive builds targeting Catalyst will fail
unless -tags=ios is supplied. See https://golang.org/issues/47228
Fixes https://golang.org/issues/47212
Updates https://golang.org/issues/47228
Change-Id: Ib1a2f5302c5edd0704c13ffbe8f4061211f50d4e
GitHub-Last-Rev: 01ab28e63f
GitHub-Pull-Request: golang/mobile#70
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/334689
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Hajime Hoshi <hajimehoshi@gmail.com>
As discussed in CL 346150, conditional bitcode build flag was introduced
in CL 214899, for Go >= 1.14 but not Go 1.13.
Since we have dropped the support for 1.13, all bitcode conditions
can be removed.
Hence this CL removes it.
Updates golang/go#47952
Change-Id: I0436cad8d5ab5675b647e25e7dfa85af85996a7e
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/346390
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
This change permits gomobile to build iOS applications by properly
set GOOS=ios in the build process. The change is locally tested on
darwin/arm64, and golang.org/x/mobile/example/basic can be build
using the following commands:
gomobile build -target=android -o=basic.apk \
golang.org/x/mobile/example/basic
gomobile build -target=ios -bundleid=org.golang.gomobiletest \
-o=basic.app golang.org/x/mobile/example/basic
The built binaries are also tested on iOS 15 beta7 and Android 12 API31.
Updates golang/go#47952Fixesgolang/go#47238
Change-Id: Ibf40a77933ac957640c78d0dbc1af043477e4b3a
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/346150
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
There are several tests are skipped for Android but they may still be
tested on iOS. This will leads to trybot failure.
This CL skips those tests and allow them to pass on iOS.
Furthermore, deprecated C function warning are promoted to errors on
builders, this CL also fixes a deprecated asl_log for iOS in mobileinit.
Change-Id: Ie9da57a20dd75ef3d29b393e30aef01051bab454
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/346391
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
The removed binary XML was introduced in CL 2653 for the TestBinaryXML.
But in CL 16150, the test was reworked and the binary XML was never
used since then.
Delete it.
Change-Id: I80fd90264142bdcd4a6d88a377e36cba64088a5a
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/346389
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
In darwin/arm64, with Xcode13 toolchain, the nm shows a prefix `_` in
the import path, which was previously not handled.
Such as:
000000010009cd70 t _golang.org/x/mobile/app.(*app).Events
000000010009ce70 t _golang.org/x/mobile/app.(*app).Filter
000000010009cdf0 t _golang.org/x/mobile/app.(*app).Publish
000000010009cd80 t _golang.org/x/mobile/app.(*app).Send
000000010009d870 t _golang.org/x/mobile/app.(*app).loop
000000010009d7f0 t _golang.org/x/mobile/app.(*app).loop.func1
This change fixes the regexp for import package extraction and permits
TestRegexImportGolangXPackage to pass.
Change-Id: I5f8b02177c8b022283276f2ddffaa8bb277aa255
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/346154
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
The current TestNdkRoot may fail if ANDROID_HOME and ANDROID_NDK_HOME
are both set from the environment. This is because ndkRoot will first
check ANDROID_HOME, if fails, then check ANDROID_NDK_HOME.
The test was intended to reset the ANDROID_HOME and expecting an error
for fetching ANDROID_NDK_HOME. However, if ANDROID_NDK_HOME is set,
the ndkRoot will not return an error, which may fail the test.
This change moves the environment settings around to permit TestNdkRoot
to pass.
Change-Id: I17ce6dbeec186d35f7a4ba2d8275a43a862c306d
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/346152
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Apple Development Program was introduced in WWDC2015. It is 2021 today,
and there should have no possibility to use iPhone Developer certificate
for code signing.
This CL replaces "iPhone Developer" by "Apple Development" so that
cmd/gomobile can use the correct certificate to sign the building
application. Otherwise, gomobile throws an error gomobile: failed to
pull the signing certificate to determine your team ID: exit status 44
Updates golang/go#47238
Change-Id: Ia48c03ff7cda39a95159e0f77e7ba7042776f9ef
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/346151
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
This reverts commit 76c259c465.
Reason for revert: Regression. Specifying architectures doesn't work. See golang/go#47212
Change-Id: I3200316cf28535cfb48e37636bc3b9d14d13e91e
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/334590
Trust: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
As golang/go#32963 has been fixed, gomobile-build test on iOS now
works.
Updates golang/go#32963
Change-Id: I96add914d1f97de6506f26e4ae0c07e8c884cb6a
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/214957
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The check when looking for android platform is unnecessarily stringent
in that the error would be caught by the call to os.Stat, and
it fails when the android platform folder is a symlink,
which is the case when developing on NixOs.
Change-Id: I07a96c969ffa29dea8bf8e353264e8597dcdc550
GitHub-Last-Rev: c684b80402
GitHub-Pull-Request: golang/mobile#55
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/267081
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).
Not strictly necessary but will avoid spurious changes
as files are edited.
Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild
Change-Id: I30822eb504168b037ed3ec0f7759da1f41251f52
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/294374
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
As of Go1.16, `go build` fails if go.sum does not exist. This change
fixes this issue by forcing to create go.sum by calling `go mod tidy`.
Closesgolang/go#44162
Change-Id: Ibba738503d1a58c6533b2427dd4efa6954b8eaa3
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/290409
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Than McIntosh <thanm@google.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TestWriter is flaky and often fails on the trybots. Skip this as a
tentative solution.
Updates golang/go#40290
Change-Id: I3a8aa74fb6cb727a216da4046edaa159f9aa2dc3
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/243839
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Go 1.15 no longer supports darwin/386 and supports only arm64 and amd64
for darwin.
Updates golang/go#39575
Change-Id: I89e43f195f87baf5ea647da40614c579fbe45f88
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/243838
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This is a remaining task for golang/go#39575.
Updates golang/go#39575
Change-Id: I10c021a9349461a7a773d4e93e80601b906741b2
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/243837
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Go 1.15 no longer supports darwin/arm. arm64 is still supported by
Android and iOS.
Updates golang/go#39575
Change-Id: I91f09477ae68de148e4d63eef38d7d28f553d16c
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/241717
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Go 1.15 no longer supports darwin/arm. This CL fixes by replacing
'allArchs' variable with a function taking a target OS, and excludes
'arm' when the target OS is iOS.
Updates golang/go#39575
Change-Id: I0623ed4cda2c679d2762fd80a7919f24dd5ce016
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/243477
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
When the module name in *.modulemap and the framework name don't match,
Xcode fails to find the framework.
This CL fixes this issue by using the specified .framework name for the
module name.
Fixesgolang/go#35641
Change-Id: I0df5335f2d64f0529e7357c2d04af5eaf760a879
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/239237
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Before this change, the main module specifies the module version of the
package to bind, the version might not be adopted by gomobile because
gomobile trims some dependencies information. If a dependency is not
a main module nor a replaced module, the dependency information is
omitted.
For example, if you have this go.mod in a workspace:
module example.com/m
requier (
github.com/foo/bar v0.1.0-123456
)
and then run `gomobile bind github.com/foo/bar` there, the specified
version might not be used because github.com/foo/bar is not a main nor
a replaced module.
This change keeps the dependency information as much as possible
to avoid this confusion.
Updates golang/go#37048
Change-Id: I875a1b9485438bdee336f3fc2d131775353004f5
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/226279
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Previously, gomobile bind's go.mod generation logic assumed
replacing module was always located in the disk, but is not
always true. It's valid to replace a module(version) with
another module&version.
For example,
replace golang.org/x/tools => ../
causes:
{
"Path": "golang.org/x/tools",
"Version": "v0.0.0-20191017151554-a3bc800455d5",
"Replace": {
"Path": "../",
"Dir": "/usr/local/google/home/hakim/go/src/golang.org/x/tools",
"GoMod": "/usr/local/google/home/hakim/go/src/golang.org/x/tools/go.mod",
"GoVersion": "1.11"
},
"Dir": "/usr/local/google/home/hakim/go/src/golang.org/x/tools",
"GoMod": "/usr/local/google/home/hakim/go/src/golang.org/x/tools/go.mod",
"GoVersion": "1.11"
}
replace github.com/anacrolix/torrent v1.13.0 => gitlab.com/axet/torrent v0.0.0-20200205141541-92b4b9e7387e
causes:
{
"Path": "github.com/anacrolix/torrent",
"Version": "v1.13.0",
"Replace": {
"Path": "gitlab.com/axet/torrent",
"Version": "v0.0.0-20200205141541-92b4b9e7387e",
"Time": "2020-02-05T14:15:41Z",
"Dir": "/usr/local/google/home/hakim/go/pkg/mod/gitlab.com/axet/torrent@v0.0.0-20200205141541-92b4b9e7387e",
"GoMod": "/usr/local/google/home/hakim/go/pkg/mod/cache/download/gitlab.com/axet/torrent/@v/v0.0.0-20200205141541-92b4b9e7387e.mod"
},
"Dir": "/usr/local/google/home/hakim/go/pkg/mod/gitlab.com/axet/torrent@v0.0.0-20200205141541-92b4b9e7387e",
"GoMod": "/usr/local/google/home/hakim/go/pkg/mod/cache/download/gitlab.com/axet/torrent/@v/v0.0.0-20200205141541-92b4b9e7387e.mod"
}
Also, while we are here, trim down the entries added to the generated
go.mod. We need the main module, and the replaced module info.
We may want to pin golang.org/x/mobile version if possible, but I don't
know a reliable way to achieve that yet.
Fixesgolang/go#37048
Change-Id: Ibd7332338c0a3c4165a642c3e86852061f6ab13b
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/218057
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
go-list without a given module/package tries to analyze the module
at the current directory. If the current directory's module doesn't
have any Go files and is empty, go-list fails. This is the cause
of the problem that gomobile-init fails if the current directory
is such module.
This CL fixes this issue by giving an arbitrary standard library
when executing go-list.
Fixesgolang/go#36668
Change-Id: If72d88081c94c2b9ef19d2870b41956a07102122
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/217700
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>