From 447654d348e36cdac65810aa73b4fc8e7b3ceef1 Mon Sep 17 00:00:00 2001 From: "Hana (Hyang-Ah) Kim" Date: Sun, 27 Feb 2022 20:45:14 -0500 Subject: [PATCH 01/68] example/ivy: update robpike.io/ivy/mobile to 0.2.7 Change-Id: I0db9c1396f003eca30196aab14523d1cf7b85197 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/388375 Trust: Hyang-Ah Hana Kim Run-TryBot: Hyang-Ah Hana Kim TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- example/ivy/go.mod | 2 +- example/ivy/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/ivy/go.mod b/example/ivy/go.mod index fe8775aef..884df3db7 100644 --- a/example/ivy/go.mod +++ b/example/ivy/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( golang.org/x/mobile v0.0.0-20210924032853-1c027f395ef7 - robpike.io/ivy v0.1.4 + robpike.io/ivy v0.2.7 ) require ( diff --git a/example/ivy/go.sum b/example/ivy/go.sum index 3f3354114..bd42ab121 100644 --- a/example/ivy/go.sum +++ b/example/ivy/go.sum @@ -36,5 +36,5 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -robpike.io/ivy v0.1.4 h1:H61eItFW1TGNhq02v9UFDz+x5z4GkC3PNjJUVyizWb8= -robpike.io/ivy v0.1.4/go.mod h1:6B/DGaft5rvYiF7MgCTiZAAvH5W7vtu0eS2BW77updo= +robpike.io/ivy v0.2.7 h1:XVYgWSm7THVm1bk1jfRBB9xhso459T22gbpotHbhk7M= +robpike.io/ivy v0.2.7/go.mod h1:6B/DGaft5rvYiF7MgCTiZAAvH5W7vtu0eS2BW77updo= From e579adbbc4a2bb7b98a904201d0200df2f08c2be Mon Sep 17 00:00:00 2001 From: Changkun Ou Date: Sat, 4 Dec 2021 12:55:19 +0100 Subject: [PATCH 02/68] app: allow app.Main to return on Windows Fixes golang/go#49499 Change-Id: Ia65b61b9e0707321439ea85d06bac5ed507b58c7 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/369196 Reviewed-by: Hyang-Ah Hana Kim Trust: Hyang-Ah Hana Kim Trust: Dmitri Shuralyov Run-TryBot: Changkun Ou TryBot-Result: Gopher Robot --- app/android.go | 6 +++++- app/shiny.go | 17 +++++++++++++++-- app/x11.go | 6 +++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/app/android.go b/app/android.go index 123502e27..08a6e0538 100644 --- a/app/android.go +++ b/app/android.go @@ -287,8 +287,12 @@ func mainUI(vm, jniEnv, ctx uintptr) error { donec := make(chan struct{}) go func() { + // close the donec channel in a defer statement + // so that we could still be able to return even + // if mainUserFn panics. + defer close(donec) + mainUserFn(theApp) - close(donec) }() var pixelsPerPt float32 diff --git a/app/shiny.go b/app/shiny.go index cffb84b62..dd1722a27 100644 --- a/app/shiny.go +++ b/app/shiny.go @@ -38,10 +38,23 @@ func main(f func(a App)) { } }() - go f(theApp) + donec := make(chan struct{}) + go func() { + // close the donec channel in a defer statement + // so that we could still be able to return even + // if f panics. + defer close(donec) + + f(theApp) + }() for { - theApp.Send(convertEvent(w.NextEvent())) + select { + case <-donec: + return + default: + theApp.Send(convertEvent(w.NextEvent())) + } } }) } diff --git a/app/x11.go b/app/x11.go index 49d1dea2a..ec8c90a54 100644 --- a/app/x11.go +++ b/app/x11.go @@ -52,8 +52,12 @@ func main(f func(App)) { donec := make(chan struct{}) go func() { + // close the donec channel in a defer statement + // so that we could still be able to return even + // if f panics. + defer close(donec) + f(theApp) - close(donec) }() // TODO: can we get the actual vsync signal? From ce6a79cf6a13dd77095a6f8dbee5f39848fa7da1 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 11 Apr 2022 13:11:08 -0400 Subject: [PATCH 03/68] all: gofmt 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 Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot Auto-Submit: Russ Cox --- app/darwin_desktop.go | 1 + app/doc.go | 17 +++++++------ app/internal/callfn/callfn.go | 1 + bind/testdata/testpkg/tagged.go | 1 + cmd/gobind/doc.go | 43 +++++++++++++++------------------ cmd/gomobile/bind_androidapp.go | 2 +- cmd/gomobile/build.go | 9 ++++--- cmd/gomobile/doc.go | 18 +++++--------- event/lifecycle/lifecycle.go | 7 +++--- event/paint/paint.go | 2 +- example/basic/main.go | 15 ++++++------ example/network/main.go | 17 +++++++------ exp/audio/al/al.go | 2 +- exp/f32/f32.go | 2 +- exp/f32/mat4.go | 2 ++ exp/sprite/portable/portable.go | 6 ++--- gl/doc.go | 2 +- internal/binres/binres.go | 22 ++++++++--------- internal/binres/pool.go | 39 ++++++++++++++++-------------- internal/binres/table.go | 15 +++++++----- internal/importers/ast.go | 14 +++++++---- internal/importers/java/java.go | 43 +++++++++++++++++---------------- 22 files changed, 147 insertions(+), 133 deletions(-) diff --git a/app/darwin_desktop.go b/app/darwin_desktop.go index 6b9ec946f..337717531 100644 --- a/app/darwin_desktop.go +++ b/app/darwin_desktop.go @@ -240,6 +240,7 @@ func convRune(r rune) rune { // into the standard keycodes used by the key package. // // To get a sense of the key map, see the diagram on +// // http://boredzo.org/blog/archives/2007-05-22/virtual-key-codes func convVirtualKeyCode(vkcode uint16) key.Code { switch vkcode { diff --git a/app/doc.go b/app/doc.go index 80e21a0e4..02bd6db80 100644 --- a/app/doc.go +++ b/app/doc.go @@ -18,7 +18,7 @@ OpenGL, audio, and other Android NDK-like APIs. An all-Go app should use this app package to initialize the app, manage its lifecycle, and receive events. -Building apps +# Building apps Apps written entirely in Go have a main function, and can be built with `gomobile build`, which directly produces runnable output for @@ -30,7 +30,7 @@ https://golang.org/x/mobile/cmd/gomobile. For detailed instructions and documentation, see https://golang.org/wiki/Mobile. -Event processing in Native Apps +# Event processing in Native Apps The Go runtime is initialized on Android when NativeActivity onCreate is called, and on iOS when the process starts. In both cases, Go init functions @@ -69,17 +69,20 @@ goroutine as other code that calls OpenGL. An event is represented by the empty interface type interface{}. Any value can be an event. Commonly used types include Event types defined by the following packages: - - golang.org/x/mobile/event/lifecycle - - golang.org/x/mobile/event/mouse - - golang.org/x/mobile/event/paint - - golang.org/x/mobile/event/size - - golang.org/x/mobile/event/touch + - golang.org/x/mobile/event/lifecycle + - golang.org/x/mobile/event/mouse + - golang.org/x/mobile/event/paint + - golang.org/x/mobile/event/size + - golang.org/x/mobile/event/touch + For example, touch.Event is the type that represents touch events. Other packages may define their own events, and send them on an app's event channel. Other packages can also register event filters, e.g. to manage resources in response to lifecycle events. Such packages should call: + app.RegisterFilter(etc) + in an init function inside that package. */ package app // import "golang.org/x/mobile/app" diff --git a/app/internal/callfn/callfn.go b/app/internal/callfn/callfn.go index 42dd02818..7a3d0506e 100644 --- a/app/internal/callfn/callfn.go +++ b/app/internal/callfn/callfn.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build android && (arm || 386 || amd64 || arm64) // +build android // +build arm 386 amd64 arm64 diff --git a/bind/testdata/testpkg/tagged.go b/bind/testdata/testpkg/tagged.go index 69ebff00f..b5fe898e5 100644 --- a/bind/testdata/testpkg/tagged.go +++ b/bind/testdata/testpkg/tagged.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aaa && bbb // +build aaa,bbb // This file tests that tags work with gomobile. diff --git a/cmd/gobind/doc.go b/cmd/gobind/doc.go index 92f64aca0..31155c639 100644 --- a/cmd/gobind/doc.go +++ b/cmd/gobind/doc.go @@ -11,7 +11,7 @@ generated and automatically packaged for Android or iOS by `gomobile bind`. For more details on installing and using the gomobile tool, see https://golang.org/x/mobile/cmd/gomobile. -Binding Go +# Binding Go Gobind generates target language (Java or Objective-C) bindings for each exported symbol in a Go package. The Go package you choose to @@ -24,7 +24,7 @@ package can then be _ imported into a Go program, typically built with -buildmode=c-archive for iOS or -buildmode=c-shared for Android. These details are handled by the `gomobile bind` command. -Passing Go objects to target languages +# Passing Go objects to target languages Consider a type for counting: @@ -85,7 +85,7 @@ The equivalent of calling newCounter in Go is GoMypkgNewCounter in Objective-C. The returned GoMypkgCounter* holds a reference to an underlying Go *Counter. -Passing target language objects to Go +# Passing target language objects to Go For a Go interface: @@ -125,7 +125,6 @@ The Java implementation can be used like so: Printer printer = new SysPrint(); Myfmt.printHello(printer); - For Objective-C binding, gobind generates a protocol that declares methods corresponding to Go interface's methods. @@ -154,32 +153,31 @@ The Objective-C implementation can be used like so: SysPrint* printer = [[SysPrint alloc] init]; GoMyfmtPrintHello(printer); - -Type restrictions +# Type restrictions At present, only a subset of Go types are supported. All exported symbols in the package must have types that are supported. Supported types include: - - Signed integer and floating point types. + - Signed integer and floating point types. - - String and boolean types. + - String and boolean types. - - Byte slice types. Note that byte slices are passed by reference, - and support mutation. + - Byte slice types. Note that byte slices are passed by reference, + and support mutation. - - Any function type all of whose parameters and results have - supported types. Functions must return either no results, - one result, or two results where the type of the second is - the built-in 'error' type. + - Any function type all of whose parameters and results have + supported types. Functions must return either no results, + one result, or two results where the type of the second is + the built-in 'error' type. - - Any interface type, all of whose exported methods have - supported function types. + - Any interface type, all of whose exported methods have + supported function types. - - Any struct type, all of whose exported methods have - supported function types and all of whose exported fields - have supported types. + - Any struct type, all of whose exported methods have + supported function types and all of whose exported fields + have supported types. Unexported symbols have no effect on the cross-language interface, and as such are not restricted. @@ -190,8 +188,7 @@ Go types, but this is a work in progress. Exceptions and panics are not yet supported. If either pass a language boundary, the program will exit. - -Reverse bindings +# Reverse bindings Gobind also supports accessing API from Java or Objective C from Go. Similar to how Cgo supports the magic "C" import, gobind recognizes @@ -225,7 +222,7 @@ For more details on binding the the native API, see the design proposals, https://golang.org/issues/16876 (Java) and https://golang.org/issues/17102 (Objective C). -Avoid reference cycles +# Avoid reference cycles The language bindings maintain a reference to each object that has been proxied. When a proxy object becomes unreachable, its finalizer reports @@ -246,7 +243,7 @@ We recommend that implementations of foreign interfaces do not hold references to proxies of objects. That is: if you implement a Go interface in Java, do not store an instance of Seq.Object inside it. -Further reading +# Further reading Examples can be found in http://golang.org/x/mobile/example. diff --git a/cmd/gomobile/bind_androidapp.go b/cmd/gomobile/bind_androidapp.go index 8ae9d4d27..77038686c 100644 --- a/cmd/gomobile/bind_androidapp.go +++ b/cmd/gomobile/bind_androidapp.go @@ -122,7 +122,7 @@ func buildSrcJar(src string) error { // These entries are directly at the root of the archive. // // AndroidManifest.xml (mandatory) -// classes.jar (mandatory) +// classes.jar (mandatory) // assets/ (optional) // jni//libgojni.so // R.txt (mandatory) diff --git a/cmd/gomobile/build.go b/cmd/gomobile/build.go index bd65f1c1a..a11865a4f 100644 --- a/cmd/gomobile/build.go +++ b/cmd/gomobile/build.go @@ -354,10 +354,11 @@ func goModTidyAt(at string, env []string) error { // parseBuildTarget parses buildTarget into 1 or more platforms and architectures. // Returns an error if buildTarget contains invalid input. // Example valid target strings: -// android -// android/arm64,android/386,android/amd64 -// ios,iossimulator,maccatalyst -// macos/amd64 +// +// android +// android/arm64,android/386,android/amd64 +// ios,iossimulator,maccatalyst +// macos/amd64 func parseBuildTarget(buildTarget string) ([]targetInfo, error) { if buildTarget == "" { return nil, fmt.Errorf(`invalid target ""`) diff --git a/cmd/gomobile/doc.go b/cmd/gomobile/doc.go index 8522dd62c..10e31278b 100644 --- a/cmd/gomobile/doc.go +++ b/cmd/gomobile/doc.go @@ -30,8 +30,7 @@ Commands: Use 'gomobile help [command]' for more information about that command. - -Build a library for Android and iOS +# Build a library for Android and iOS Usage: @@ -76,8 +75,7 @@ The -v flag provides verbose output, including the list of packages built. The build flags -a, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work are shared with the build command. For documentation, see 'go help build'. - -Compile android APK and iOS app +# Compile android APK and iOS app Usage: @@ -128,15 +126,13 @@ The -v flag provides verbose output, including the list of packages built. The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work are shared with the build command. For documentation, see 'go help build'. - -Remove object files and cached gomobile files +# Remove object files and cached gomobile files Usage: gomobile clean -Clean removes object files and cached NDK files downloaded by gomobile init - +# Clean removes object files and cached NDK files downloaded by gomobile init Build OpenAL for Android @@ -148,8 +144,7 @@ If a OpenAL source directory is specified with -openal, init will build an Android version of OpenAL for use with gomobile build and gomobile install. - -Compile android APK and install on device +# Compile android APK and install on device Usage: @@ -164,8 +159,7 @@ The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work shared with the build command. For documentation, see 'go help build'. - -Print version +# Print version Usage: diff --git a/event/lifecycle/lifecycle.go b/event/lifecycle/lifecycle.go index 9a5f54ed1..4c588582d 100644 --- a/event/lifecycle/lifecycle.go +++ b/event/lifecycle/lifecycle.go @@ -59,9 +59,10 @@ func (e Event) String() string { } // Crosses reports whether the transition from From to To crosses the stage s: -// - It returns CrossOn if it does, and the lifecycle change is positive. -// - It returns CrossOff if it does, and the lifecycle change is negative. -// - Otherwise, it returns CrossNone. +// - It returns CrossOn if it does, and the lifecycle change is positive. +// - It returns CrossOff if it does, and the lifecycle change is negative. +// - Otherwise, it returns CrossNone. +// // See the documentation for Stage for more discussion of positive and negative // crosses. func (e Event) Crosses(s Stage) Cross { diff --git a/event/paint/paint.go b/event/paint/paint.go index b7b4113d6..0f24b1ad1 100644 --- a/event/paint/paint.go +++ b/event/paint/paint.go @@ -9,7 +9,7 @@ package paint // import "golang.org/x/mobile/event/paint" // Event indicates that the app is ready to paint the next frame of the GUI. // -//A frame is completed by calling the App's Publish method. +// A frame is completed by calling the App's Publish method. type Event struct { // External is true for paint events sent by the screen driver. // diff --git a/example/basic/main.go b/example/basic/main.go index 697fe2147..94932db4f 100644 --- a/example/basic/main.go +++ b/example/basic/main.go @@ -13,19 +13,20 @@ // // Get the basic example and use gomobile to build or install it on your device. // -// $ go get -d golang.org/x/mobile/example/basic -// $ gomobile build golang.org/x/mobile/example/basic # will build an APK +// $ go get -d golang.org/x/mobile/example/basic +// $ gomobile build golang.org/x/mobile/example/basic # will build an APK // -// # plug your Android device to your computer or start an Android emulator. -// # if you have adb installed on your machine, use gomobile install to -// # build and deploy the APK to an Android target. -// $ gomobile install golang.org/x/mobile/example/basic +// # plug your Android device to your computer or start an Android emulator. +// # if you have adb installed on your machine, use gomobile install to +// # build and deploy the APK to an Android target. +// $ gomobile install golang.org/x/mobile/example/basic // // Switch to your device or emulator to start the Basic application from // the launcher. // You can also run the application on your desktop by running the command // below. (Note: It currently doesn't work on Windows.) -// $ go install golang.org/x/mobile/example/basic && basic +// +// $ go install golang.org/x/mobile/example/basic && basic package main import ( diff --git a/example/network/main.go b/example/network/main.go index 8375eb0be..4b23cbed4 100644 --- a/example/network/main.go +++ b/example/network/main.go @@ -11,7 +11,7 @@ // In order to access the network from the Android app, its AndroidManifest.xml // file must include the permission to access the network. // -// http://developer.android.com/guide/topics/manifest/manifest-intro.html#perms +// http://developer.android.com/guide/topics/manifest/manifest-intro.html#perms // // The gomobile tool auto-generates a default AndroidManifest file by default // unless the package directory contains the AndroidManifest.xml. Users can @@ -25,19 +25,20 @@ // // Get the network example and use gomobile to build or install it on your device. // -// $ go get -d golang.org/x/mobile/example/network -// $ gomobile build golang.org/x/mobile/example/network # will build an APK +// $ go get -d golang.org/x/mobile/example/network +// $ gomobile build golang.org/x/mobile/example/network # will build an APK // -// # plug your Android device to your computer or start an Android emulator. -// # if you have adb installed on your machine, use gomobile install to -// # build and deploy the APK to an Android target. -// $ gomobile install golang.org/x/mobile/example/network +// # plug your Android device to your computer or start an Android emulator. +// # if you have adb installed on your machine, use gomobile install to +// # build and deploy the APK to an Android target. +// $ gomobile install golang.org/x/mobile/example/network // // Switch to your device or emulator to start the network application from // the launcher. // You can also run the application on your desktop by running the command // below. (Note: It currently doesn't work on Windows.) -// $ go install golang.org/x/mobile/example/network && network +// +// $ go install golang.org/x/mobile/example/network && network package main import ( diff --git a/exp/audio/al/al.go b/exp/audio/al/al.go index bcddeefe3..b2396a51f 100644 --- a/exp/audio/al/al.go +++ b/exp/audio/al/al.go @@ -17,7 +17,7 @@ // On Ubuntu 14.04 'Trusty', you may have to install this library // by running the command below. // -// sudo apt-get install libopenal-dev +// sudo apt-get install libopenal-dev // // When compiled for Android, this package uses OpenAL Soft. Please add its // license file to the open source notices of your application. diff --git a/exp/f32/f32.go b/exp/f32/f32.go index d79439808..59e1b651c 100644 --- a/exp/f32/f32.go +++ b/exp/f32/f32.go @@ -18,7 +18,7 @@ // It is safe to use the destination address as the left-hand side, // that is, dst *= rhs is dst.Mul(dst, rhs). // -// WARNING +// # WARNING // // The interface to this package is not stable. It will change considerably. // Only use functions that provide package documentation. Semantics are diff --git a/exp/f32/mat4.go b/exp/f32/mat4.go index 75d3a5984..ffa1a8f32 100644 --- a/exp/f32/mat4.go +++ b/exp/f32/mat4.go @@ -92,6 +92,7 @@ func (m *Mat4) Perspective(fov Radian, aspect, near, far float32) { // Scale sets m to be a scale followed by p. // It is equivalent to +// // m.Mul(p, &Mat4{ // {x, 0, 0, 0}, // {0, y, 0, 0}, @@ -119,6 +120,7 @@ func (m *Mat4) Scale(p *Mat4, x, y, z float32) { // Translate sets m to be a translation followed by p. // It is equivalent to +// // m.Mul(p, &Mat4{ // {1, 0, 0, x}, // {0, 1, 0, y}, diff --git a/exp/sprite/portable/portable.go b/exp/sprite/portable/portable.go index 66b9f7915..28925d121 100644 --- a/exp/sprite/portable/portable.go +++ b/exp/sprite/portable/portable.go @@ -154,14 +154,14 @@ func (e *engine) Release() {} // affine draws each pixel of dst using bilinear interpolation of the // affine-transformed position in src. This is equivalent to: // -// for each (x,y) in dst: -// dst(x,y) = bilinear interpolation of src(a*(x,y)) +// for each (x,y) in dst: +// dst(x,y) = bilinear interpolation of src(a*(x,y)) // // While this is the simpler implementation, it can be counter- // intuitive as an affine transformation is usually described in terms // of the source, not the destination. For example, a scale transform // -// Affine{{2, 0, 0}, {0, 2, 0}} +// Affine{{2, 0, 0}, {0, 2, 0}} // // will produce a dst that is half the size of src. To perform a // traditional affine transform, use the inverse of the affine matrix. diff --git a/gl/doc.go b/gl/doc.go index 1eb1d773b..880d5f925 100644 --- a/gl/doc.go +++ b/gl/doc.go @@ -22,7 +22,7 @@ https://www.khronos.org/opengles/sdk/docs/man/ One notable departure from the C API is the introduction of types to represent common uses of GLint: Texture, Surface, Buffer, etc. -Debug Logging +# Debug Logging A tracing version of the OpenGL bindings is behind the `gldebug` build tag. It acts as a simplified version of apitrace. Build your Go binary diff --git a/internal/binres/binres.go b/internal/binres/binres.go index 86730635a..78b874f8b 100644 --- a/internal/binres/binres.go +++ b/internal/binres/binres.go @@ -12,9 +12,9 @@ // sent to unmarshalling. This allows tests to validate each struct representation // of the binary format as follows: // -// * unmarshal the output of aapt -// * marshal the struct representation -// * perform byte-to-byte comparison with aapt output per chunk header and body +// - unmarshal the output of aapt +// - marshal the struct representation +// - perform byte-to-byte comparison with aapt output per chunk header and body // // This process should strive to make structs idiomatic to make parsing xml text // into structs trivial. @@ -22,9 +22,9 @@ // Once the struct representation is validated, tests for parsing xml text // into structs can become self-referential as the following holds true: // -// * the unmarshalled input of aapt output is the only valid target -// * the unmarshalled input of xml text may be compared to the unmarshalled -// input of aapt output to identify errors, e.g. text-trims, wrong flags, etc +// - the unmarshalled input of aapt output is the only valid target +// - the unmarshalled input of xml text may be compared to the unmarshalled +// input of aapt output to identify errors, e.g. text-trims, wrong flags, etc // // This provides validation, byte-for-byte, for producing binary xml resources. // @@ -34,11 +34,11 @@ // // A simple view of binary xml document structure: // -// XML -// Pool -// Map -// Namespace -// [...node] +// XML +// Pool +// Map +// Namespace +// [...node] // // Additional resources: // https://android.googlesource.com/platform/frameworks/base/+/master/libs/androidfw/include/androidfw/ResourceTypes.h diff --git a/internal/binres/pool.go b/internal/binres/pool.go index 5e5958d12..273e94c72 100644 --- a/internal/binres/pool.go +++ b/internal/binres/pool.go @@ -25,28 +25,31 @@ func (ref PoolRef) Resolve(pl *Pool) string { // Pool is a container for string and style span collections. // // Pool has the following structure marshalled: -// chunkHeader -// uint32 number of strings in this pool -// uint32 number of style spans in pool -// uint32 SortedFlag, UTF8Flag -// uint32 index of string data from header -// uint32 index of style data from header -// []uint32 string indices starting at zero -// []uint16 or []uint8 concatenation of string entries +// +// chunkHeader +// uint32 number of strings in this pool +// uint32 number of style spans in pool +// uint32 SortedFlag, UTF8Flag +// uint32 index of string data from header +// uint32 index of style data from header +// []uint32 string indices starting at zero +// []uint16 or []uint8 concatenation of string entries // // UTF-16 entries are as follows: -// uint16 string length, exclusive -// uint16 [optional] low word if high bit of length set -// [n]byte data -// uint16 0x0000 terminator +// +// uint16 string length, exclusive +// uint16 [optional] low word if high bit of length set +// [n]byte data +// uint16 0x0000 terminator // // UTF-8 entries are as follows: -// uint8 character length, exclusive -// uint8 [optional] low word if high bit of character length set -// uint8 byte length, exclusive -// uint8 [optional] low word if high bit of byte length set -// [n]byte data -// uint8 0x00 terminator +// +// uint8 character length, exclusive +// uint8 [optional] low word if high bit of character length set +// uint8 byte length, exclusive +// uint8 [optional] low word if high bit of byte length set +// [n]byte data +// uint8 0x00 terminator type Pool struct { chunkHeader strings []string diff --git a/internal/binres/table.go b/internal/binres/table.go index 6c80affee..304736dbb 100644 --- a/internal/binres/table.go +++ b/internal/binres/table.go @@ -22,10 +22,11 @@ type TableRef uint32 // Resolve returns the Entry of TableRef in the given table. // // A TableRef is structured as follows: -// 0xpptteeee -// pp: package index -// tt: type spec index in package -// eeee: entry index in type spec +// +// 0xpptteeee +// pp: package index +// tt: type spec index in package +// eeee: entry index in type spec // // The package and type spec values start at 1 for the first item, // to help catch cases where they have not been supplied. @@ -127,8 +128,10 @@ func OpenTable() (*Table, error) { // indices. // // For example: -// tbl.SpecByName("@android:style/Theme.NoTitleBar") -// tbl.SpecByName("style") +// +// tbl.SpecByName("@android:style/Theme.NoTitleBar") +// tbl.SpecByName("style") +// // Both locate the spec by name "style". func (tbl *Table) SpecByName(name string) (int, *Package, int, *TypeSpec, error) { n := strings.TrimPrefix(name, "@android:") diff --git a/internal/importers/ast.go b/internal/importers/ast.go index b9e36ee0f..64da4a188 100644 --- a/internal/importers/ast.go +++ b/internal/importers/ast.go @@ -7,15 +7,17 @@ // It is used by the language specific importers to determine the set of // wrapper types to be generated. // -// For example, in the Go file +// # For example, in the Go file // // package javaprogram // // import "Java/java/lang" // // func F() { -// o := lang.Object.New() -// ... +// +// o := lang.Object.New() +// ... +// // } // // the java importer uses this package to determine that the "java/lang" @@ -39,7 +41,7 @@ import ( // References is the result of analyzing a Go file or set of Go packages. // -// For example, the Go file +// # For example, the Go file // // package pkg // @@ -124,7 +126,9 @@ func AnalyzePackages(pkgs []*packages.Package, pkgPrefix string) (*References, e // import "Prefix/some/Package" // // type T struct { -// Package.Class +// +// Package.Class +// // } func (v *refsSaver) findEmbeddingStructs(pkgpath string, pkg *ast.Package) { var names []string diff --git a/internal/importers/java/java.go b/internal/importers/java/java.go index 3a26dfb8b..5a813a116 100644 --- a/internal/importers/java/java.go +++ b/internal/importers/java/java.go @@ -178,16 +178,17 @@ func javapPath() (string, error) { // // Compiled from "System.java" // public final class java.lang.System { -// public static final java.io.InputStream in; -// descriptor: Ljava/io/InputStream; -// public static final java.io.PrintStream out; -// descriptor: Ljava/io/PrintStream; -// public static final java.io.PrintStream err; -// descriptor: Ljava/io/PrintStream; -// public static void setIn(java.io.InputStream); -// descriptor: (Ljava/io/InputStream;)V // -// ... +// public static final java.io.InputStream in; +// descriptor: Ljava/io/InputStream; +// public static final java.io.PrintStream out; +// descriptor: Ljava/io/PrintStream; +// public static final java.io.PrintStream err; +// descriptor: Ljava/io/PrintStream; +// public static void setIn(java.io.InputStream); +// descriptor: (Ljava/io/InputStream;)V +// +// ... // // } func (j *Importer) Import(refs *importers.References) ([]*Class, error) { @@ -409,27 +410,27 @@ func combineSigs(clsMap map[string]*Class, sigs ...CommonSig) CommonSig { // // For example, the class // -// class A { -// void f(); -// } +// class A { +// void f(); +// } // // is by itself represented by the Go interface // -// type A interface { -// f() -// } +// type A interface { +// f() +// } // // However, if class // -// class B extends A { -// void f(int); -// } +// class B extends A { +// void f(int); +// } // // is also imported, it will be represented as // -// type B interface { -// f(...int32) -// } +// type B interface { +// f(...int32) +// } // // To make Go B assignable to Go A, the signature of A's f must // be updated to f(...int32) as well. From 50dca8fc073d03ff0058102c8e4672ac302cb764 Mon Sep 17 00:00:00 2001 From: Changkun Ou Date: Sun, 5 Dec 2021 16:21:52 +0100 Subject: [PATCH 04/68] cmd/gomobile: tidy a few unused code and variables Change-Id: I979589adf74ec0cd097ef7acc6c120f6557c8f25 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/369201 Run-TryBot: Hyang-Ah Hana Kim TryBot-Result: Gopher Robot Reviewed-by: Bryan Mills Reviewed-by: David Chase Reviewed-by: Hyang-Ah Hana Kim --- cmd/gomobile/build.go | 5 ----- cmd/gomobile/env.go | 10 +++------- cmd/gomobile/init.go | 16 ---------------- 3 files changed, 3 insertions(+), 28 deletions(-) diff --git a/cmd/gomobile/build.go b/cmd/gomobile/build.go index a11865a4f..4c83ca0ee 100644 --- a/cmd/gomobile/build.go +++ b/cmd/gomobile/build.go @@ -271,11 +271,6 @@ func addBuildFlagsNVXWork(cmd *command) { cmd.flag.BoolVar(&buildWork, "work", false, "") } -type binInfo struct { - hasPkgApp bool - hasPkgAL bool -} - func init() { addBuildFlags(cmdBuild) addBuildFlagsNVXWork(cmdBuild) diff --git a/cmd/gomobile/env.go b/cmd/gomobile/env.go index a7f54850b..ff3251755 100644 --- a/cmd/gomobile/env.go +++ b/cmd/gomobile/env.go @@ -14,13 +14,9 @@ import ( // General mobile build environment. Initialized by envInit. var ( - gomobilepath string // $GOPATH/pkg/gomobile - - androidEnv map[string][]string // android arch -> []string - - appleEnv map[string][]string - - androidArmNM string + gomobilepath string // $GOPATH/pkg/gomobile + androidEnv map[string][]string // android arch -> []string + appleEnv map[string][]string appleNM string ) diff --git a/cmd/gomobile/init.go b/cmd/gomobile/init.go index 234b1c138..26da302b0 100644 --- a/cmd/gomobile/init.go +++ b/cmd/gomobile/init.go @@ -208,12 +208,6 @@ func installOpenAL(gomobilepath string) error { return nil } -var commonPkgs = []string{ - "golang.org/x/mobile/gl", - "golang.org/x/mobile/app", - "golang.org/x/mobile/exp/app/debug", -} - func mkdir(dir string) error { if buildX || buildN { printcmd("mkdir -p %s", dir) @@ -237,16 +231,6 @@ func symlink(src, dst string) error { return os.Symlink(src, dst) } -func rm(name string) error { - if buildX || buildN { - printcmd("rm %s", name) - } - if buildN { - return nil - } - return os.Remove(name) -} - func doCopyAll(dst, src string) error { return filepath.Walk(src, func(path string, info os.FileInfo, errin error) (err error) { if errin != nil { From eae5320c54e072ecf3984f8444c5e9de22c027c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hila=CC=81rio=20Coelho?= Date: Tue, 17 May 2022 14:48:02 +0000 Subject: [PATCH 05/68] bind: added protocol documentation to Objective-C generated file Fixes golang/go#46956 Change-Id: Ifa1b8e7f2a0e46034f0eccc32249f69a064199e3 GitHub-Last-Rev: 175fa08b1696fca4c11b35b691e0df550ed66864 GitHub-Pull-Request: golang/mobile#67 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/331429 Run-TryBot: Hyang-Ah Hana Kim Reviewed-by: Hajime Hoshi Reviewed-by: Hyang-Ah Hana Kim Reviewed-by: Michael Knyszek TryBot-Result: Gopher Robot --- bind/genobjc.go | 2 ++ bind/testdata/doc.objc.h.golden | 3 +++ 2 files changed, 5 insertions(+) diff --git a/bind/genobjc.go b/bind/genobjc.go index 7595fa0ff..d0982207d 100644 --- a/bind/genobjc.go +++ b/bind/genobjc.go @@ -894,6 +894,7 @@ func (g *ObjcGen) genInterfaceInterface(obj *types.TypeName, summary ifaceSummar } func (g *ObjcGen) genInterfaceH(obj *types.TypeName, t *types.Interface) { + doc := g.docs[obj.Name()] summary := makeIfaceSummary(t) if !summary.implementable { g.genInterfaceInterface(obj, summary, false) @@ -906,6 +907,7 @@ func (g *ObjcGen) genInterfaceH(obj *types.TypeName, t *types.Interface) { continue } s := g.funcSummary(nil, m) + g.objcdoc(doc.Member(m.Name())) g.Printf("- %s;\n", s.asMethod(g)) } g.Printf("@end\n") diff --git a/bind/testdata/doc.objc.h.golden b/bind/testdata/doc.objc.h.golden index 9279a10aa..f0ea479a3 100644 --- a/bind/testdata/doc.objc.h.golden +++ b/bind/testdata/doc.objc.h.golden @@ -18,6 +18,9 @@ @class DocI; @protocol DocI +/** + * IM is a method. + */ - (void)im; @end From 8578da9835fd365e78a6e63048c103b27a53a82c Mon Sep 17 00:00:00 2001 From: Ben Schwartz Date: Thu, 21 Apr 2022 13:45:00 -0400 Subject: [PATCH 06/68] all: modernize handling of Android SDK and NDK paths 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. Fixes golang/go#52470 Change-Id: I546365774a089e5d7ae1be0a538efd72741d92ac Reviewed-on: https://go-review.googlesource.com/c/mobile/+/401574 TryBot-Result: Gopher Robot Reviewed-by: Daniel Skinner Reviewed-by: Suzy Mueller Reviewed-by: Hajime Hoshi Reviewed-by: Hyang-Ah Hana Kim Run-TryBot: Hyang-Ah Hana Kim --- bind/java/seq_test.go | 9 +- cmd/gomobile/bind.go | 12 +- cmd/gomobile/bind_androidapp.go | 51 +------- cmd/gomobile/bind_test.go | 28 ++--- cmd/gomobile/build.go | 5 +- cmd/gomobile/build_androidapp.go | 2 +- cmd/gomobile/build_test.go | 10 +- cmd/gomobile/env.go | 158 +++++++++++++++++++++--- cmd/gomobile/env_test.go | 147 ++++++++++++++++++---- cmd/gomobile/gendex.go | 10 +- cmd/gomobile/init.go | 7 +- cmd/gomobile/version.go | 5 +- example/ivy/android/README.md | 6 +- internal/binres/binres.go | 15 ++- internal/binres/binres_test.go | 28 ++--- internal/binres/genarsc.go | 3 +- internal/binres/sdk.go | 18 ++- internal/binres/table.go | 96 ++++++++++++-- internal/binres/testdata/bootstrap.arsc | Bin 632 -> 644 bytes internal/binres/testdata/bootstrap.bin | Bin 2416 -> 2416 bytes internal/binres/testdata/gen.sh | 4 +- internal/sdkpath/sdkpath.go | 89 +++++++++++++ 22 files changed, 527 insertions(+), 176 deletions(-) create mode 100644 internal/sdkpath/sdkpath.go diff --git a/bind/java/seq_test.go b/bind/java/seq_test.go index 8f741c68a..a5151d40b 100644 --- a/bind/java/seq_test.go +++ b/bind/java/seq_test.go @@ -17,6 +17,7 @@ import ( "testing" "golang.org/x/mobile/internal/importers/java" + "golang.org/x/mobile/internal/sdkpath" ) var gomobileBin string @@ -98,8 +99,8 @@ func TestJavaSeqBench(t *testing.T) { // runTest runs the Android java test class specified with javaCls. If javaPkg is // set, it is passed with the -javapkg flag to gomobile. The pkgNames lists the Go // packages to bind for the test. -// This requires the gradle command in PATH and -// the Android SDK whose path is available through ANDROID_HOME environment variable. +// This requires the gradle command to be in PATH and the Android SDK to be +// installed. func runTest(t *testing.T, pkgNames []string, javaPkg, javaCls string) { if gomobileBin == "" { t.Skipf("no gomobile on %s", runtime.GOOS) @@ -108,8 +109,8 @@ func runTest(t *testing.T, pkgNames []string, javaPkg, javaCls string) { if err != nil { t.Skip("command gradle not found, skipping") } - if sdk := os.Getenv("ANDROID_HOME"); sdk == "" { - t.Skip("ANDROID_HOME environment var not set, skipping") + if _, err := sdkpath.AndroidHome(); err != nil { + t.Skip("Android SDK not found, skipping") } cwd, err := os.Getwd() diff --git a/cmd/gomobile/bind.go b/cmd/gomobile/bind.go index efbc89699..c4552e3e3 100644 --- a/cmd/gomobile/bind.go +++ b/cmd/gomobile/bind.go @@ -16,6 +16,7 @@ import ( "path/filepath" "strings" + "golang.org/x/mobile/internal/sdkpath" "golang.org/x/mod/modfile" "golang.org/x/tools/go/packages" ) @@ -42,9 +43,10 @@ example, in Android Studio (1.2+), an AAR file can be imported using the module import wizard (File > New > New Module > Import .JAR or .AAR package), and setting it as a new dependency (File > Project Structure > Dependencies). This requires 'javac' -(version 1.7+) and Android SDK (API level 15 or newer) to build the -library for Android. The environment variable ANDROID_HOME must be set -to the path to Android SDK. Use the -javapkg flag to specify the Java +(version 1.7+) and Android SDK (API level 16 or newer) to build the +library for Android. The ANDROID_HOME and ANDROID_NDK_HOME environment +variables can be used to specify the Android SDK and NDK if they are +not in the default locations. Use the -javapkg flag to specify the Java package prefix for the generated classes. By default, -target=android builds shared libraries for all supported @@ -85,7 +87,7 @@ func runBind(cmd *command) error { if bindPrefix != "" { return fmt.Errorf("-prefix is supported only for Apple targets") } - if _, err := ndkRoot(); err != nil { + if _, err := ndkRoot(targets[0]); err != nil { return err } } else { @@ -156,7 +158,7 @@ func bootClasspath() (string, error) { if bindBootClasspath != "" { return bindBootClasspath, nil } - apiPath, err := androidAPIPath() + apiPath, err := sdkpath.AndroidAPIPath(buildAndroidAPI) if err != nil { return "", err } diff --git a/cmd/gomobile/bind_androidapp.go b/cmd/gomobile/bind_androidapp.go index 77038686c..a56fd822f 100644 --- a/cmd/gomobile/bind_androidapp.go +++ b/cmd/gomobile/bind_androidapp.go @@ -12,15 +12,15 @@ import ( "os" "os/exec" "path/filepath" - "strconv" "strings" + "golang.org/x/mobile/internal/sdkpath" "golang.org/x/tools/go/packages" ) func goAndroidBind(gobind string, pkgs []*packages.Package, targets []targetInfo) error { - if sdkDir := os.Getenv("ANDROID_HOME"); sdkDir == "" { - return fmt.Errorf("this command requires ANDROID_HOME environment variable (path to the Android SDK)") + if _, err := sdkpath.AndroidHome(); err != nil { + return fmt.Errorf("this command requires the Android SDK to be installed: %w", err) } // Run gobind to generate the bindings @@ -270,7 +270,7 @@ func buildAAR(srcDir, androidDir string, pkgs []*packages.Package, targets []tar const ( javacTargetVer = "1.7" - minAndroidAPI = 15 + minAndroidAPI = 16 ) func buildJar(w io.Writer, srcDir string) error { @@ -370,46 +370,3 @@ func writeJar(w io.Writer, dir string) error { } return jarw.Close() } - -// androidAPIPath returns an android SDK platform directory under ANDROID_HOME. -// If there are multiple platforms that satisfy the minimum version requirement -// androidAPIPath returns the latest one among them. -func androidAPIPath() (string, error) { - sdk := os.Getenv("ANDROID_HOME") - if sdk == "" { - return "", fmt.Errorf("ANDROID_HOME environment var is not set") - } - sdkDir, err := os.Open(filepath.Join(sdk, "platforms")) - if err != nil { - return "", fmt.Errorf("failed to find android SDK platform: %v", err) - } - defer sdkDir.Close() - fis, err := sdkDir.Readdir(-1) - if err != nil { - return "", fmt.Errorf("failed to find android SDK platform (API level: %d): %v", buildAndroidAPI, err) - } - - var apiPath string - var apiVer int - for _, fi := range fis { - name := fi.Name() - if !strings.HasPrefix(name, "android-") { - continue - } - n, err := strconv.Atoi(name[len("android-"):]) - if err != nil || n < buildAndroidAPI { - continue - } - p := filepath.Join(sdkDir.Name(), name) - _, err = os.Stat(filepath.Join(p, "android.jar")) - if err == nil && apiVer < n { - apiPath = p - apiVer = n - } - } - if apiVer == 0 { - return "", fmt.Errorf("failed to find android SDK platform (API level: %d) in %s", - buildAndroidAPI, sdkDir.Name()) - } - return apiPath, nil -} diff --git a/cmd/gomobile/bind_test.go b/cmd/gomobile/bind_test.go index 0e9f401c5..cac3511cf 100644 --- a/cmd/gomobile/bind_test.go +++ b/cmd/gomobile/bind_test.go @@ -14,18 +14,22 @@ import ( "strings" "testing" "text/template" + + "golang.org/x/mobile/internal/sdkpath" ) func TestBindAndroid(t *testing.T) { - androidHome := os.Getenv("ANDROID_HOME") - if androidHome == "" { - t.Skip("ANDROID_HOME not found, skipping bind") - } - platform, err := androidAPIPath() + platform, err := sdkpath.AndroidAPIPath(minAndroidAPI) if err != nil { - t.Skip("No android API platform found in $ANDROID_HOME, skipping bind") + t.Skip("No compatible Android API platform found, skipping bind") } - platform = strings.Replace(platform, androidHome, "$ANDROID_HOME", -1) + // platform is a path like "/path/to/Android/sdk/platforms/android-32" + components := strings.Split(platform, string(filepath.Separator)) + if len(components) < 2 { + t.Fatalf("API path is too short: %s", platform) + } + components = components[len(components)-2:] + platformRel := filepath.Join("$ANDROID_HOME", components[0], components[1]) defer func() { xout = os.Stderr @@ -77,7 +81,7 @@ func TestBindAndroid(t *testing.T) { JavaPkg string }{ outputData: output, - AndroidPlatform: platform, + AndroidPlatform: platformRel, JavaPkg: tc.javaPkg, } @@ -273,12 +277,8 @@ func TestBindWithGoModules(t *testing.T) { t.Run(target, func(t *testing.T) { switch target { case "android": - androidHome := os.Getenv("ANDROID_HOME") - if androidHome == "" { - t.Skip("ANDROID_HOME not found, skipping bind") - } - if _, err := androidAPIPath(); err != nil { - t.Skip("No android API platform found in $ANDROID_HOME, skipping bind") + if _, err := sdkpath.AndroidAPIPath(minAndroidAPI); err != nil { + t.Skip("No compatible Android API platform found, skipping bind") } case "ios": if !xcodeAvailable() { diff --git a/cmd/gomobile/build.go b/cmd/gomobile/build.go index 4c83ca0ee..64a28fe68 100644 --- a/cmd/gomobile/build.go +++ b/cmd/gomobile/build.go @@ -17,6 +17,7 @@ import ( "strconv" "strings" + "golang.org/x/mobile/internal/sdkpath" "golang.org/x/tools/go/packages" ) @@ -60,7 +61,7 @@ Flag -iosversion sets the minimal version of the iOS SDK to compile against. The default version is 13.0. Flag -androidapi sets the Android API version to compile against. -The default and minimum is 15. +The default and minimum is 16. The -bundleid flag is required for -target ios and sets the bundle ID to use with the app. @@ -215,7 +216,7 @@ func printcmd(format string, args ...interface{}) { if tmpdir != "" { cmd = strings.Replace(cmd, tmpdir, "$WORK", -1) } - if androidHome := os.Getenv("ANDROID_HOME"); androidHome != "" { + if androidHome, err := sdkpath.AndroidHome(); err == nil { cmd = strings.Replace(cmd, androidHome, "$ANDROID_HOME", -1) } if gomobilepath != "" { diff --git a/cmd/gomobile/build_androidapp.go b/cmd/gomobile/build_androidapp.go index b06ea2929..bcd2664bd 100644 --- a/cmd/gomobile/build_androidapp.go +++ b/cmd/gomobile/build_androidapp.go @@ -25,7 +25,7 @@ import ( ) func goAndroidBuild(pkg *packages.Package, targets []targetInfo) (map[string]bool, error) { - ndkRoot, err := ndkRoot() + ndkRoot, err := ndkRoot(targets...) if err != nil { return nil, err } diff --git a/cmd/gomobile/build_test.go b/cmd/gomobile/build_test.go index ff21f8747..448c6dd2a 100644 --- a/cmd/gomobile/build_test.go +++ b/cmd/gomobile/build_test.go @@ -14,6 +14,8 @@ import ( "strings" "testing" "text/template" + + "golang.org/x/mobile/internal/sdkpath" ) func TestRFC1034Label(t *testing.T) { @@ -228,12 +230,8 @@ func TestBuildWithGoModules(t *testing.T) { t.Run(target, func(t *testing.T) { switch target { case "android": - androidHome := os.Getenv("ANDROID_HOME") - if androidHome == "" { - t.Skip("ANDROID_HOME not found, skipping bind") - } - if _, err := androidAPIPath(); err != nil { - t.Skip("No android API platform found in $ANDROID_HOME, skipping bind") + if _, err := sdkpath.AndroidAPIPath(minAndroidAPI); err != nil { + t.Skip("No compatible android API platform found, skipping bind") } case "ios": if !xcodeAvailable() { diff --git a/cmd/gomobile/env.go b/cmd/gomobile/env.go index ff3251755..43f24b99d 100644 --- a/cmd/gomobile/env.go +++ b/cmd/gomobile/env.go @@ -1,6 +1,8 @@ package main import ( + "bufio" + "encoding/json" "errors" "fmt" "io/fs" @@ -10,6 +12,8 @@ import ( "path/filepath" "runtime" "strings" + + "golang.org/x/mobile/internal/sdkpath" ) // General mobile build environment. Initialized by envInit. @@ -276,29 +280,155 @@ func envInit() (err error) { return nil } -func ndkRoot() (string, error) { +// abi maps GOARCH values to Android ABI strings. +// See https://developer.android.com/ndk/guides/abis +func abi(goarch string) string { + switch goarch { + case "arm": + return "armeabi-v7a" + case "arm64": + return "arm64-v8a" + case "386": + return "x86" + case "amd64": + return "x86_64" + default: + return "" + } +} + +// checkNDKRoot returns nil if the NDK in `ndkRoot` supports the current configured +// API version and all the specified Android targets. +func checkNDKRoot(ndkRoot string, targets []targetInfo) error { + platformsJson, err := os.Open(filepath.Join(ndkRoot, "meta", "platforms.json")) + if err != nil { + return err + } + defer platformsJson.Close() + decoder := json.NewDecoder(platformsJson) + supportedVersions := struct { + Min int + Max int + }{} + if err := decoder.Decode(&supportedVersions); err != nil { + return err + } + if supportedVersions.Min > buildAndroidAPI || + supportedVersions.Max < buildAndroidAPI { + return fmt.Errorf("unsupported API version %d (not in %d..%d)", buildAndroidAPI, supportedVersions.Min, supportedVersions.Max) + } + abisJson, err := os.Open(filepath.Join(ndkRoot, "meta", "abis.json")) + if err != nil { + return err + } + defer abisJson.Close() + decoder = json.NewDecoder(abisJson) + abis := make(map[string]struct{}) + if err := decoder.Decode(&abis); err != nil { + return err + } + for _, target := range targets { + if !isAndroidPlatform(target.platform) { + continue + } + if _, found := abis[abi(target.arch)]; !found { + return fmt.Errorf("ndk does not support %s", target.platform) + } + } + return nil +} + +// compatibleNDKRoots searches the side-by-side NDK dirs for compatible SDKs. +func compatibleNDKRoots(ndkForest string, targets []targetInfo) ([]string, error) { + ndkDirs, err := ioutil.ReadDir(ndkForest) + if err != nil { + return nil, err + } + compatibleNDKRoots := []string{} + var lastErr error + for _, dirent := range ndkDirs { + ndkRoot := filepath.Join(ndkForest, dirent.Name()) + lastErr = checkNDKRoot(ndkRoot, targets) + if lastErr == nil { + compatibleNDKRoots = append(compatibleNDKRoots, ndkRoot) + } + } + if len(compatibleNDKRoots) > 0 { + return compatibleNDKRoots, nil + } + return nil, lastErr +} + +// ndkVersion returns the full version number of an installed copy of the NDK, +// or "" if it cannot be determined. +func ndkVersion(ndkRoot string) string { + properties, err := os.Open(filepath.Join(ndkRoot, "source.properties")) + if err != nil { + return "" + } + defer properties.Close() + // Parse the version number out of the .properties file. + // See https://en.wikipedia.org/wiki/.properties + scanner := bufio.NewScanner(properties) + for scanner.Scan() { + line := scanner.Text() + tokens := strings.SplitN(line, "=", 2) + if len(tokens) != 2 { + continue + } + if strings.TrimSpace(tokens[0]) == "Pkg.Revision" { + return strings.TrimSpace(tokens[1]) + } + } + return "" +} + +// ndkRoot returns the root path of an installed NDK that supports all the +// specified Android targets. For details of NDK locations, see +// https://github.com/android/ndk-samples/wiki/Configure-NDK-Path +func ndkRoot(targets ...targetInfo) (string, error) { if buildN { return "$NDK_PATH", nil } - androidHome := os.Getenv("ANDROID_HOME") - if androidHome != "" { - ndkRoot := filepath.Join(androidHome, "ndk-bundle") - _, err := os.Stat(ndkRoot) - if err == nil { - return ndkRoot, nil + // Try the ANDROID_NDK_HOME variable. This approach is deprecated, but it + // has the highest priority because it represents an explicit user choice. + if ndkRoot := os.Getenv("ANDROID_NDK_HOME"); ndkRoot != "" { + if err := checkNDKRoot(ndkRoot, targets); err != nil { + return "", fmt.Errorf("ANDROID_NDK_HOME specifies %s, which is unusable: %w", ndkRoot, err) } + return ndkRoot, nil } - ndkRoot := os.Getenv("ANDROID_NDK_HOME") - if ndkRoot != "" { - _, err := os.Stat(ndkRoot) - if err == nil { - return ndkRoot, nil - } + androidHome, err := sdkpath.AndroidHome() + if err != nil { + return "", fmt.Errorf("could not locate Android SDK: %w", err) } - return "", fmt.Errorf("no Android NDK found in $ANDROID_HOME/ndk-bundle nor in $ANDROID_NDK_HOME") + // Use the newest compatible NDK under the side-by-side path arrangement. + ndkForest := filepath.Join(androidHome, "ndk") + ndkRoots, sideBySideErr := compatibleNDKRoots(ndkForest, targets) + if len(ndkRoots) != 0 { + // Choose the latest version that supports the build configuration. + // NDKs whose version cannot be determined will be least preferred. + // In the event of a tie, the later ndkRoot will win. + maxVersion := "" + var selected string + for _, ndkRoot := range ndkRoots { + version := ndkVersion(ndkRoot) + if version >= maxVersion { + maxVersion = version + selected = ndkRoot + } + } + return selected, nil + } + // Try the deprecated NDK location. + ndkRoot := filepath.Join(androidHome, "ndk-bundle") + if legacyErr := checkNDKRoot(ndkRoot, targets); legacyErr != nil { + return "", fmt.Errorf("no usable NDK in %s: %w, %v", androidHome, sideBySideErr, legacyErr) + } + return ndkRoot, nil } func envClang(sdkName string) (clang, cflags string, err error) { diff --git a/cmd/gomobile/env_test.go b/cmd/gomobile/env_test.go index 2eef8abbe..e5ad28259 100644 --- a/cmd/gomobile/env_test.go +++ b/cmd/gomobile/env_test.go @@ -5,6 +5,7 @@ package main import ( + "fmt" "io/ioutil" "os" "path/filepath" @@ -18,47 +19,143 @@ func TestNdkRoot(t *testing.T) { } homeorig := os.Getenv("ANDROID_HOME") + os.Unsetenv("ANDROID_HOME") ndkhomeorig := os.Getenv("ANDROID_NDK_HOME") + os.Unsetenv("ANDROID_NDK_HOME") + defer func() { os.Setenv("ANDROID_HOME", homeorig) os.Setenv("ANDROID_NDK_HOME", ndkhomeorig) os.RemoveAll(home) }() - os.Setenv("ANDROID_HOME", home) - sdkNDK := filepath.Join(home, "ndk-bundle") - envNDK := filepath.Join(home, "android-ndk") - os.Setenv("ANDROID_NDK_HOME", envNDK) - - if ndk, err := ndkRoot(); err == nil { - t.Errorf("expected error but got %q", ndk) - } - - for _, dir := range []string{sdkNDK, envNDK} { + makeMockNDK := func(path, version, platforms, abis string) string { + dir := filepath.Join(home, path) if err := os.Mkdir(dir, 0755); err != nil { t.Fatalf("couldn't mkdir %q", dir) } + propertiesPath := filepath.Join(dir, "source.properties") + propertiesData := []byte("Pkg.Revision = " + version) + if err := os.WriteFile(propertiesPath, propertiesData, 0644); err != nil { + t.Fatalf("couldn't write source.properties: %v", err) + } + metaDir := filepath.Join(dir, "meta") + if err := os.Mkdir(metaDir, 0755); err != nil { + t.Fatalf("couldn't mkdir %q", metaDir) + } + platformsPath := filepath.Join(metaDir, "platforms.json") + platformsData := []byte(platforms) + if err := os.WriteFile(platformsPath, platformsData, 0644); err != nil { + t.Fatalf("couldn't write platforms.json: %v", err) + } + abisPath := filepath.Join(metaDir, "abis.json") + abisData := []byte(abis) + if err := os.WriteFile(abisPath, abisData, 0644); err != nil { + t.Fatalf("couldn't populate abis.json: %v", err) + } + return dir } - if ndk, _ := ndkRoot(); ndk != sdkNDK { - t.Errorf("got %q want %q", ndk, sdkNDK) - } + t.Run("no NDK in the default location", func(t *testing.T) { + os.Setenv("ANDROID_HOME", home) + defer os.Unsetenv("ANDROID_HOME") + if ndk, err := ndkRoot(); err == nil { + t.Errorf("expected error but got %q", ndk) + } + }) - os.Unsetenv("ANDROID_HOME") + t.Run("NDK location is set but is wrong", func(t *testing.T) { + os.Setenv("ANDROID_NDK_HOME", filepath.Join(home, "no-such-path")) + defer os.Unsetenv("ANDROID_NDK_HOME") + if ndk, err := ndkRoot(); err == nil { + t.Errorf("expected error but got %q", ndk) + } + }) - if ndk, _ := ndkRoot(); ndk != envNDK { - t.Errorf("got %q want %q", ndk, envNDK) - } + t.Run("Two NDKs installed", func(t *testing.T) { + // Default path for pre-side-by-side NDKs. + sdkNDK := makeMockNDK("ndk-bundle", "fake-version", `{"min":16,"max":32}`, "{}") + defer os.RemoveAll(sdkNDK) + // Arbitrary location for testing ANDROID_NDK_HOME. + envNDK := makeMockNDK("custom-location", "fake-version", `{"min":16,"max":32}`, "{}") - os.RemoveAll(envNDK) + // ANDROID_NDK_HOME is sufficient. + os.Setenv("ANDROID_NDK_HOME", envNDK) + if ndk, err := ndkRoot(); ndk != envNDK { + t.Errorf("got (%q, %v) want (%q, nil)", ndk, err, envNDK) + } - if ndk, err := ndkRoot(); err == nil { - t.Errorf("expected error but got %q", ndk) - } + // ANDROID_NDK_HOME takes precedence over ANDROID_HOME. + os.Setenv("ANDROID_HOME", home) + if ndk, err := ndkRoot(); ndk != envNDK { + t.Errorf("got (%q, %v) want (%q, nil)", ndk, err, envNDK) + } - os.Setenv("ANDROID_HOME", home) + // ANDROID_NDK_HOME is respected even if there is no NDK there. + os.RemoveAll(envNDK) + if ndk, err := ndkRoot(); err == nil { + t.Errorf("expected error but got %q", ndk) + } - if ndk, _ := ndkRoot(); ndk != sdkNDK { - t.Errorf("got %q want %q", ndk, sdkNDK) - } + // ANDROID_HOME is used if ANDROID_NDK_HOME is not set. + os.Unsetenv("ANDROID_NDK_HOME") + if ndk, err := ndkRoot(); ndk != sdkNDK { + t.Errorf("got (%q, %v) want (%q, nil)", ndk, err, envNDK) + } + }) + + t.Run("Modern 'side-by-side' NDK selection", func(t *testing.T) { + defer func() { + buildAndroidAPI = minAndroidAPI + }() + + ndkForest := filepath.Join(home, "ndk") + if err := os.Mkdir(ndkForest, 0755); err != nil { + t.Fatalf("couldn't mkdir %q", ndkForest) + } + + path := filepath.Join("ndk", "newer") + platforms := `{"min":19,"max":32}` + abis := `{"arm64-v8a": {}, "armeabi-v7a": {}, "x86_64": {}}` + version := "17.2.0" + newerNDK := makeMockNDK(path, version, platforms, abis) + + path = filepath.Join("ndk", "older") + platforms = `{"min":16,"max":31}` + abis = `{"arm64-v8a": {}, "armeabi-v7a": {}, "x86": {}}` + version = "17.1.0" + olderNDK := makeMockNDK(path, version, platforms, abis) + + testCases := []struct { + api int + targets []targetInfo + wantNDKRoot string + }{ + {15, nil, ""}, + {16, nil, olderNDK}, + {16, []targetInfo{{"android", "arm"}}, olderNDK}, + {16, []targetInfo{{"android", "arm"}, {"android", "arm64"}}, olderNDK}, + {16, []targetInfo{{"android", "x86_64"}}, ""}, + {19, nil, newerNDK}, + {19, []targetInfo{{"android", "arm"}}, newerNDK}, + {19, []targetInfo{{"android", "arm"}, {"android", "arm64"}, {"android", "386"}}, olderNDK}, + {32, nil, newerNDK}, + {32, []targetInfo{{"android", "arm"}}, newerNDK}, + {32, []targetInfo{{"android", "386"}}, ""}, + } + + for i, tc := range testCases { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + buildAndroidAPI = tc.api + ndk, err := ndkRoot(tc.targets...) + if len(tc.wantNDKRoot) != 0 { + if ndk != tc.wantNDKRoot || err != nil { + t.Errorf("got (%q, %v), want (%q, nil)", ndk, err, tc.wantNDKRoot) + } + } else if err == nil { + t.Error("expected error") + } + }) + } + }) } diff --git a/cmd/gomobile/gendex.go b/cmd/gomobile/gendex.go index be7470c48..88cf5549f 100644 --- a/cmd/gomobile/gendex.go +++ b/cmd/gomobile/gendex.go @@ -13,7 +13,7 @@ // however that would limit gomobile to working with newer versions of // the Android OS, so we do this while we wait. // -// Requires ANDROID_HOME be set to the path of the Android SDK, and +// Respects ANDROID_HOME to set the path of the Android SDK. // javac must be on the PATH. package main @@ -29,6 +29,8 @@ import ( "os" "os/exec" "path/filepath" + + "golang.org/x/mobile/internal/sdkpath" ) var outfile = flag.String("o", "", "result will be written file") @@ -52,9 +54,9 @@ func main() { } func gendex() error { - androidHome := os.Getenv("ANDROID_HOME") - if androidHome == "" { - return errors.New("ANDROID_HOME not set") + androidHome, err := sdkpath.AndroidHome() + if err != nil { + return fmt.Errorf("couldn't find Android SDK: %w", err) } if err := os.MkdirAll(tmpdir+"/work/org/golang/app", 0775); err != nil { return err diff --git a/cmd/gomobile/init.go b/cmd/gomobile/init.go index 26da302b0..e7392df71 100644 --- a/cmd/gomobile/init.go +++ b/cmd/gomobile/init.go @@ -16,6 +16,8 @@ import ( "runtime" "strings" "time" + + "golang.org/x/mobile/internal/sdkpath" ) var ( @@ -122,11 +124,10 @@ func installOpenAL(gomobilepath string) error { if buildN { cmake = "cmake" } else { - sdkRoot := os.Getenv("ANDROID_HOME") - if sdkRoot == "" { + sdkRoot, err := sdkpath.AndroidHome() + if err != nil { return nil } - var err error cmake, err = exec.LookPath("cmake") if err != nil { cmakePath := filepath.Join(sdkRoot, "cmake") diff --git a/cmd/gomobile/version.go b/cmd/gomobile/version.go index b7915563a..27fd6bde0 100644 --- a/cmd/gomobile/version.go +++ b/cmd/gomobile/version.go @@ -11,6 +11,8 @@ import ( "os/exec" "path/filepath" "strings" + + "golang.org/x/mobile/internal/sdkpath" ) var cmdVersion = &command{ @@ -56,8 +58,7 @@ func runVersion(cmd *command) (err error) { platforms += "," + strings.Join(applePlatforms, ",") } - // ANDROID_HOME, sdk build tool version - androidapi, _ := androidAPIPath() + androidapi, _ := sdkpath.AndroidAPIPath(buildAndroidAPI) fmt.Printf("gomobile version %s (%s); androidSDK=%s\n", version, platforms, androidapi) return nil diff --git a/example/ivy/android/README.md b/example/ivy/android/README.md index d5923eaf9..dc567127f 100644 --- a/example/ivy/android/README.md +++ b/example/ivy/android/README.md @@ -11,16 +11,12 @@ Requirements - Android NDK - `golang.org/x/mobile/cmd/gomobile` -The `gomobile` command uses `ANDROID_HOME` and `ANDROID_NDK_HOME` environment variables. +The `gomobile` command respects the `ANDROID_HOME` and `ANDROID_NDK_HOME` environment variables. If `gomobile` can't find your SDK and NDK, you can set these environment variables to specify their locations: ``` export ANDROID_HOME=/path/to/sdk-directory export ANDROID_NDK_HOME=/path/to/ndk-directory ``` -Note: Both ANDROID_SDK_ROOT and ANDROID_NDK_HOME are deprecated in Android tooling, but `gomobile` still uses it. In many cases, `ANDROID_HOME` corresponds to the new [`ANDROID_SDK_ROOT`](https://developer.android.com/studio/command-line/variables). If you installed NDK using [Android Studio's SDK manager](https://developer.android.com/studio/projects/install-ndk#default-version), use the `$ANDROID_SDK_ROOT/ndk//` directory as `ANDROID_NDK_HOME` (where `` is the NDK version you want to use when compiling `robpike.io/ivy` for Android. - -(TODO: update `gomobile` to work with modern Android layout) - From this directory, run: ```sh diff --git a/internal/binres/binres.go b/internal/binres/binres.go index 78b874f8b..d77bde265 100644 --- a/internal/binres/binres.go +++ b/internal/binres/binres.go @@ -82,10 +82,13 @@ const ( ResXMLResourceMap ResType = 0x0180 - ResTablePackage ResType = 0x0200 - ResTableType ResType = 0x0201 - ResTableTypeSpec ResType = 0x0202 - ResTableLibrary ResType = 0x0203 + ResTablePackage ResType = 0x0200 + ResTableType ResType = 0x0201 + ResTableTypeSpec ResType = 0x0202 + ResTableLibrary ResType = 0x0203 + ResTableOverlayable ResType = 0x0204 + ResTableOverlayablePolicy ResType = 0x0205 + ResTableStagedAlias ResType = 0x0206 ) var ( @@ -247,14 +250,14 @@ func UnmarshalXML(r io.Reader, withIcon bool) (*XML, error) { Space: "", Local: "platformBuildVersionCode", }, - Value: "15", + Value: "16", }, xml.Attr{ Name: xml.Name{ Space: "", Local: "platformBuildVersionName", }, - Value: "4.0.4-1406430", + Value: "4.1.2-1425332", }) q = append(q, ltoken{tkn, line}) diff --git a/internal/binres/binres_test.go b/internal/binres/binres_test.go index 93e7a1827..dbac875a1 100644 --- a/internal/binres/binres_test.go +++ b/internal/binres/binres_test.go @@ -16,6 +16,8 @@ import ( "sort" "strings" "testing" + + "golang.org/x/mobile/internal/sdkpath" ) func init() { @@ -408,10 +410,9 @@ func compareStrings(t *testing.T, a, b []string) error { } } if err == nil && v == "__" { - if !strings.HasPrefix(x, "4.0.") { + if !strings.HasPrefix(x, "4.1.") { // as of the time of this writing, the current version of build tools being targeted - // reports 4.0.4-1406430. Previously, this was 4.0.3. This number is likely still due - // to change so only report error if 4.x incremented. + // reports 4.1.2-1425332. // // TODO this check has the potential to hide real errors but can be fixed once more // of the xml document is unmarshalled and XML can be queried to assure this is related @@ -455,9 +456,8 @@ func compareStrings(t *testing.T, a, b []string) error { } func TestOpenTable(t *testing.T) { - sdkdir := os.Getenv("ANDROID_HOME") - if sdkdir == "" { - t.Skip("ANDROID_HOME env var not set") + if _, err := sdkpath.AndroidHome(); err != nil { + t.Skipf("Could not locate Android SDK: %v", err) } tbl, err := OpenTable() if err != nil { @@ -577,8 +577,10 @@ func TestTableMarshal(t *testing.T) { if typ.entryCount != xtyp.entryCount { t.Fatal("typ.entryCount doesn't match") } - if typ.entriesStart != xtyp.entriesStart { - t.Fatal("typ.entriesStart doesn't match") + // Config size can differ after serialization due to the loss of extended fields + // during reserialization, but the fixed portions of the Type header must not change. + if uint32(typ.headerByteSize)-typ.config.size != uint32(xtyp.headerByteSize)-uint32(xtyp.config.size) { + t.Fatal("fixed size header portions don't match") } if len(typ.indices) != len(xtyp.indices) { t.Fatal("typ.indices length don't match") @@ -629,9 +631,8 @@ func TestTableMarshal(t *testing.T) { func checkResources(t *testing.T) { t.Helper() - sdkdir := os.Getenv("ANDROID_HOME") - if sdkdir == "" { - t.Skip("ANDROID_HOME env var not set") + if _, err := sdkpath.AndroidHome(); err != nil { + t.Skip("Could not locate Android SDK") } rscPath, err := apiResourcesPath() if err != nil { @@ -643,9 +644,8 @@ func checkResources(t *testing.T) { } func BenchmarkTableRefByName(b *testing.B) { - sdkdir := os.Getenv("ANDROID_HOME") - if sdkdir == "" { - b.Fatal("ANDROID_HOME env var not set") + if _, err := sdkpath.AndroidHome(); err != nil { + b.Fatal("Could not locate Android SDK") } b.ReportAllocs() diff --git a/internal/binres/genarsc.go b/internal/binres/genarsc.go index e93ae885e..4ec35fbc5 100644 --- a/internal/binres/genarsc.go +++ b/internal/binres/genarsc.go @@ -8,8 +8,7 @@ // Genarsc generates stripped down version of android.jar resources used // for validation of manifest entries. // -// Requires ANDROID_HOME be set to the path of the Android SDK and the -// current sdk platform installed that matches MinSDK. +// Requires the selected Android SDK to support the MinSDK platform version. package main import ( diff --git a/internal/binres/sdk.go b/internal/binres/sdk.go index 6c1c343ed..607e0b7dc 100644 --- a/internal/binres/sdk.go +++ b/internal/binres/sdk.go @@ -7,13 +7,14 @@ import ( "fmt" "io" "os" - "path" + "path/filepath" + + "golang.org/x/mobile/internal/sdkpath" ) // MinSDK is the targeted sdk version for support by package binres. -const MinSDK = 15 +const MinSDK = 16 -// Requires environment variable ANDROID_HOME to be set. func apiResources() ([]byte, error) { apiResPath, err := apiResourcesPath() if err != nil { @@ -50,14 +51,11 @@ func apiResources() ([]byte, error) { } func apiResourcesPath() (string, error) { - // TODO(elias.naur): use the logic from gomobile's androidAPIPath and use the any installed version of the - // Android SDK instead. Currently, the binres_test.go tests fail on anything newer than android-15. - sdkdir := os.Getenv("ANDROID_HOME") - if sdkdir == "" { - return "", fmt.Errorf("ANDROID_HOME env var not set") + platformDir, err := sdkpath.AndroidAPIPath(MinSDK) + if err != nil { + return "", err } - platform := fmt.Sprintf("android-%v", MinSDK) - return path.Join(sdkdir, "platforms", platform, "android.jar"), nil + return filepath.Join(platformDir, "android.jar"), nil } // PackResources produces a stripped down gzip version of the resources.arsc from api jar. diff --git a/internal/binres/table.go b/internal/binres/table.go index 304736dbb..b552cbaff 100644 --- a/internal/binres/table.go +++ b/internal/binres/table.go @@ -248,7 +248,8 @@ type Package struct { typePool *Pool // type names; e.g. theme keyPool *Pool // resource names; e.g. Theme.NoTitleBar - specs []*TypeSpec + aliases []*StagedAlias + specs []*TypeSpec } func (pkg *Package) UnmarshalBinary(bin []byte) error { @@ -298,7 +299,7 @@ func (pkg *Package) UnmarshalBinary(bin []byte) error { return nil } - buf := bin[idOffset:] + buf := bin[idOffset:pkg.byteSize] for len(buf) > 0 { t := ResType(btou16(buf)) switch t { @@ -317,8 +318,15 @@ func (pkg *Package) UnmarshalBinary(bin []byte) error { last := pkg.specs[len(pkg.specs)-1] last.types = append(last.types, typ) buf = buf[typ.byteSize:] + case ResTableStagedAlias: + alias := new(StagedAlias) + if err := alias.UnmarshalBinary(buf); err != nil { + return err + } + pkg.aliases = append(pkg.aliases, alias) + buf = buf[alias.byteSize:] default: - return errWrongType(t, ResTableTypeSpec, ResTableType) + return errWrongType(t, ResTableTypeSpec, ResTableType, ResTableStagedAlias) } } @@ -371,6 +379,14 @@ func (pkg *Package) MarshalBinary() ([]byte, error) { bin = append(bin, b...) } + for _, alias := range pkg.aliases { + b, err := alias.MarshalBinary() + if err != nil { + return nil, err + } + bin = append(bin, b...) + } + for _, spec := range pkg.specs { b, err := spec.MarshalBinary() if err != nil { @@ -537,14 +553,15 @@ func (typ *Type) UnmarshalBinary(bin []byte) error { // fmt.Println("language/country:", u16tos(typ.config.locale.language), u16tos(typ.config.locale.country)) buf := bin[typ.headerByteSize:typ.entriesStart] - for len(buf) > 0 { - typ.indices = append(typ.indices, btou32(buf)) - buf = buf[4:] + if len(buf) != 4*int(typ.entryCount) { + return fmt.Errorf("index buffer len[%v] doesn't match entryCount[%v]", len(buf), typ.entryCount) } - if len(typ.indices) != int(typ.entryCount) { - return fmt.Errorf("indices len[%v] doesn't match entryCount[%v]", len(typ.indices), typ.entryCount) + typ.indices = make([]uint32, typ.entryCount) + for i := range typ.indices { + typ.indices[i] = btou32(buf[i*4:]) } + typ.entries = make([]*Entry, typ.entryCount) for i, x := range typ.indices { @@ -572,9 +589,9 @@ func (typ *Type) MarshalBinary() ([]byte, error) { putu32(bin[12:], uint32(len(typ.entries))) putu32(bin[16:], uint32(56+len(typ.entries)*4)) - // assure typ.config.size is always written as 52; extended configuration beyond supported + // assure typ.config.size is always written as 36; extended configuration beyond supported // API level is not supported by this marshal implementation but will be forward-compatible. - putu32(bin[20:], 52) + putu32(bin[20:], 36) putu16(bin[24:], typ.config.imsi.mcc) putu16(bin[26:], typ.config.imsi.mnc) @@ -616,6 +633,65 @@ func (typ *Type) MarshalBinary() ([]byte, error) { return bin, nil } +type StagedAliasEntry struct { + stagedID uint32 + finalizedID uint32 +} + +func (ae *StagedAliasEntry) MarshalBinary() ([]byte, error) { + bin := make([]byte, 8) + putu32(bin, ae.stagedID) + putu32(bin[4:], ae.finalizedID) + return bin, nil +} + +func (ae *StagedAliasEntry) UnmarshalBinary(bin []byte) error { + ae.stagedID = btou32(bin) + ae.finalizedID = btou32(bin[4:]) + return nil +} + +type StagedAlias struct { + chunkHeader + count uint32 + entries []StagedAliasEntry +} + +func (a *StagedAlias) UnmarshalBinary(bin []byte) error { + if err := (&a.chunkHeader).UnmarshalBinary(bin); err != nil { + return err + } + if a.typ != ResTableStagedAlias { + return errWrongType(a.typ, ResTableStagedAlias) + } + a.count = btou32(bin[8:]) + a.entries = make([]StagedAliasEntry, a.count) + for i := range a.entries { + if err := a.entries[i].UnmarshalBinary(bin[12+i*8:]); err != nil { + return err + } + } + return nil +} + +func (a *StagedAlias) MarshalBinary() ([]byte, error) { + chunkHeaderBin, err := a.chunkHeader.MarshalBinary() + if err != nil { + return nil, err + } + countBin := make([]byte, 4) + putu32(countBin, a.count) + bin := append(chunkHeaderBin, countBin...) + for _, entry := range a.entries { + entryBin, err := entry.MarshalBinary() + if err != nil { + return nil, err + } + bin = append(bin, entryBin...) + } + return bin, nil +} + // Entry is a resource key typically followed by a value or resource map. type Entry struct { size uint16 diff --git a/internal/binres/testdata/bootstrap.arsc b/internal/binres/testdata/bootstrap.arsc index 60c1dda863d5eae6f5769054d878f71167f40749..4705191a74334809d00c9ee441f2aa4de443e3f0 100644 GIT binary patch delta 50 zcmeyt(!$Eh#K6PQGLbc#QDS4^T1Mdzh71M<1|}e81mXxFc9?9)WIk~N&*Tgy0RRFu B3CI8d delta 47 ycmZo+{lUV@#K6N)F_AT!k!NG!T1H_Hh8PA01|}e81Y#c`HkoY5WInlsNdN%b`v^Y( diff --git a/internal/binres/testdata/bootstrap.bin b/internal/binres/testdata/bootstrap.bin index 35d3df65f8b86007cc7b1b8f05ff552eaece4e22..ff5617c0c559d184da7414fd7012cab25698add9 100644 GIT binary patch delta 51 zcmew$^g(FDJ0^KE1_lOR1``H7216h=V$cQBCP3Ph!59dQHuEyGGcyWo7G;ZO1^^AD B2$cW; delta 51 zcmew$^g(FDJ0^Kk1_lOR1``H71_K~AVbEnT1d;{}W Date: Fri, 22 Jul 2022 11:10:36 -0400 Subject: [PATCH 07/68] A+C: delete AUTHORS and CONTRIBUTORS In 2009, Google's open-source lawyers asked us to create the AUTHORS file to define "The Go Authors", and the CONTRIBUTORS file was in keeping with open source best practices of the time. Re-reviewing our repos now in 2022, the open-source lawyers are comfortable with source control history taking the place of the AUTHORS file, and most open source projects no longer maintain CONTRIBUTORS files. To ease maintenance, remove AUTHORS and CONTRIBUTORS from all repos. For golang/go#53961. Change-Id: Ic215dbb1f226266e3079c1a7b5d128e5e5e86bba Reviewed-on: https://go-review.googlesource.com/c/mobile/+/418918 Run-TryBot: Russ Cox TryBot-Result: Gopher Robot Reviewed-by: David Chase --- AUTHORS | 3 --- CONTRIBUTORS | 3 --- 2 files changed, 6 deletions(-) delete mode 100644 AUTHORS delete mode 100644 CONTRIBUTORS diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 15167cd74..000000000 --- a/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/CONTRIBUTORS b/CONTRIBUTORS deleted file mode 100644 index 1c4577e96..000000000 --- a/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. From fa6bcb0768357a704787d34228c0cd44d0ed58c7 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 28 Aug 2022 15:54:29 +0900 Subject: [PATCH 08/68] cmd/gomobile: concurrent gomobile-bind building for Android 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 Reviewed-by: Bryan Mills Reviewed-by: Dmitri Shuralyov Reviewed-by: Changkun Ou Reviewed-by: Dmitri Shuralyov Run-TryBot: Hajime Hoshi --- cmd/gomobile/bind.go | 32 +++++++---- cmd/gomobile/bind_androidapp.go | 95 +++++++++++++++++++++------------ cmd/gomobile/bind_iosapp.go | 2 +- cmd/gomobile/bind_test.go | 6 +-- go.mod | 1 + go.sum | 2 + 6 files changed, 90 insertions(+), 48 deletions(-) diff --git a/cmd/gomobile/bind.go b/cmd/gomobile/bind.go index c4552e3e3..54eaa4bcf 100644 --- a/cmd/gomobile/bind.go +++ b/cmd/gomobile/bind.go @@ -15,6 +15,7 @@ import ( "os/exec" "path/filepath" "strings" + "sync" "golang.org/x/mobile/internal/sdkpath" "golang.org/x/mod/modfile" @@ -282,7 +283,7 @@ func getModuleVersions(targetPlatform string, targetArch string, src string) (*m return f, nil } -// writeGoMod writes go.mod file at $WORK/src when Go modules are used. +// writeGoMod writes go.mod file at dir when Go modules are used. func writeGoMod(dir, targetPlatform, targetArch string) error { m, err := areGoModulesUsed() if err != nil { @@ -293,7 +294,7 @@ func writeGoMod(dir, targetPlatform, targetArch string) error { return nil } - return writeFile(filepath.Join(dir, "src", "go.mod"), func(w io.Writer) error { + return writeFile(filepath.Join(dir, "go.mod"), func(w io.Writer) error { f, err := getModuleVersions(targetPlatform, targetArch, ".") if err != nil { return err @@ -312,14 +313,23 @@ func writeGoMod(dir, targetPlatform, targetArch string) error { }) } -func areGoModulesUsed() (bool, error) { - out, err := exec.Command("go", "env", "GOMOD").Output() - if err != nil { - return false, err - } - outstr := strings.TrimSpace(string(out)) - if outstr == "" { - return false, nil +var ( + areGoModulesUsedResult struct { + used bool + err error } - return true, nil + areGoModulesUsedOnce sync.Once +) + +func areGoModulesUsed() (bool, error) { + areGoModulesUsedOnce.Do(func() { + out, err := exec.Command("go", "env", "GOMOD").Output() + if err != nil { + areGoModulesUsedResult.err = err + return + } + outstr := strings.TrimSpace(string(out)) + areGoModulesUsedResult.used = outstr != "" + }) + return areGoModulesUsedResult.used, areGoModulesUsedResult.err } diff --git a/cmd/gomobile/bind_androidapp.go b/cmd/gomobile/bind_androidapp.go index a56fd822f..3fa9cfa7a 100644 --- a/cmd/gomobile/bind_androidapp.go +++ b/cmd/gomobile/bind_androidapp.go @@ -15,6 +15,7 @@ import ( "strings" "golang.org/x/mobile/internal/sdkpath" + "golang.org/x/sync/errgroup" "golang.org/x/tools/go/packages" ) @@ -52,41 +53,16 @@ func goAndroidBind(gobind string, pkgs []*packages.Package, targets []targetInfo androidDir := filepath.Join(tmpdir, "android") - modulesUsed, err := areGoModulesUsed() - if err != nil { - return err - } - // Generate binding code and java source code only when processing the first package. + var wg errgroup.Group for _, t := range targets { - if err := writeGoMod(tmpdir, "android", t.arch); err != nil { - return err - } - - env := androidEnv[t.arch] - // Add the generated packages to GOPATH for reverse bindings. - gopath := fmt.Sprintf("GOPATH=%s%c%s", tmpdir, filepath.ListSeparator, goEnv("GOPATH")) - env = append(env, gopath) - - // Run `go mod tidy` to force to create go.sum. - // Without go.sum, `go build` fails as of Go 1.16. - if modulesUsed { - if err := goModTidyAt(filepath.Join(tmpdir, "src"), env); err != nil { - return err - } - } - - toolchain := ndk.Toolchain(t.arch) - err := goBuildAt( - filepath.Join(tmpdir, "src"), - "./gobind", - env, - "-buildmode=c-shared", - "-o="+filepath.Join(androidDir, "src/main/jniLibs/"+toolchain.abi+"/libgojni.so"), - ) - if err != nil { - return err - } + t := t + wg.Go(func() error { + return buildAndroidSO(androidDir, t.arch) + }) + } + if err := wg.Wait(); err != nil { + return err } jsrc := filepath.Join(tmpdir, "java") @@ -370,3 +346,56 @@ func writeJar(w io.Writer, dir string) error { } return jarw.Close() } + +// buildAndroidSO generates an Android libgojni.so file to outputDir. +// buildAndroidSO is concurrent-safe. +func buildAndroidSO(outputDir string, arch string) error { + // Copy the environment variables to make this function concurrent-safe. + env := make([]string, len(androidEnv[arch])) + copy(env, androidEnv[arch]) + + // Add the generated packages to GOPATH for reverse bindings. + gopath := fmt.Sprintf("GOPATH=%s%c%s", tmpdir, filepath.ListSeparator, goEnv("GOPATH")) + env = append(env, gopath) + + modulesUsed, err := areGoModulesUsed() + if err != nil { + return err + } + + srcDir := filepath.Join(tmpdir, "src") + + if modulesUsed { + // Copy the source directory for each architecture for concurrent building. + newSrcDir := filepath.Join(tmpdir, "src-android-"+arch) + if !buildN { + if err := doCopyAll(newSrcDir, srcDir); err != nil { + return err + } + } + srcDir = newSrcDir + + if err := writeGoMod(srcDir, "android", arch); err != nil { + return err + } + + // Run `go mod tidy` to force to create go.sum. + // Without go.sum, `go build` fails as of Go 1.16. + if err := goModTidyAt(srcDir, env); err != nil { + return err + } + } + + toolchain := ndk.Toolchain(arch) + if err := goBuildAt( + srcDir, + "./gobind", + env, + "-buildmode=c-shared", + "-o="+filepath.Join(outputDir, "src", "main", "jniLibs", toolchain.abi, "libgojni.so"), + ); err != nil { + return err + } + + return nil +} diff --git a/cmd/gomobile/bind_iosapp.go b/cmd/gomobile/bind_iosapp.go index bf0f37db6..b9beaea4b 100644 --- a/cmd/gomobile/bind_iosapp.go +++ b/cmd/gomobile/bind_iosapp.go @@ -93,7 +93,7 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) gopath := fmt.Sprintf("GOPATH=%s%c%s", outDir, filepath.ListSeparator, goEnv("GOPATH")) env = append(env, gopath) - if err := writeGoMod(outDir, t.platform, t.arch); err != nil { + if err := writeGoMod(filepath.Join(outDir, "src"), t.platform, t.arch); err != nil { return err } diff --git a/cmd/gomobile/bind_test.go b/cmd/gomobile/bind_test.go index cac3511cf..318ff62d1 100644 --- a/cmd/gomobile/bind_test.go +++ b/cmd/gomobile/bind_test.go @@ -187,9 +187,9 @@ func TestBindApple(t *testing.T) { var bindAndroidTmpl = template.Must(template.New("output").Parse(`GOMOBILE={{.GOPATH}}/pkg/gomobile WORK=$WORK GOOS=android CGO_ENABLED=1 gobind -lang=go,java -outdir=$WORK{{if .JavaPkg}} -javapkg={{.JavaPkg}}{{end}} golang.org/x/mobile/asset -mkdir -p $WORK/src -PWD=$WORK/src GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go mod tidy -PWD=$WORK/src GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go build -x -buildmode=c-shared -o=$WORK/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind +mkdir -p $WORK/src-android-arm +PWD=$WORK/src-android-arm GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go mod tidy +PWD=$WORK/src-android-arm GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go build -x -buildmode=c-shared -o=$WORK/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind PWD=$WORK/java javac -d $WORK/javac-output -source 1.7 -target 1.7 -bootclasspath {{.AndroidPlatform}}/android.jar *.java jar c -C $WORK/javac-output . `)) diff --git a/go.mod b/go.mod index 765a3653b..fd0ee23d7 100644 --- a/go.mod +++ b/go.mod @@ -6,5 +6,6 @@ require ( golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 golang.org/x/image v0.0.0-20190802002840-cff245a6509b golang.org/x/mod v0.4.2 + golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098 ) diff --git a/go.sum b/go.sum index d4d3ebf1e..b20722d51 100644 --- a/go.sum +++ b/go.sum @@ -18,6 +18,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc= +golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 58284a7bfc4e09b069a1f85b989c35feafc57239 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 30 Sep 2022 16:26:27 +0900 Subject: [PATCH 09/68] cmd/gomobile: clean-up the code using gobind for iOS 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 Reviewed-by: Dmitri Shuralyov Reviewed-by: Changkun Ou Auto-Submit: Hyang-Ah Hana Kim Reviewed-by: Hyang-Ah Hana Kim TryBot-Result: Gopher Robot Run-TryBot: Hajime Hoshi --- cmd/gomobile/bind_iosapp.go | 72 +++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/cmd/gomobile/bind_iosapp.go b/cmd/gomobile/bind_iosapp.go index b9beaea4b..47f5e9895 100644 --- a/cmd/gomobile/bind_iosapp.go +++ b/cmd/gomobile/bind_iosapp.go @@ -14,6 +14,7 @@ import ( "strings" "text/template" + "golang.org/x/sync/errgroup" "golang.org/x/tools/go/packages" ) @@ -38,6 +39,49 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) return err } + outDirsForPlatform := map[string]string{} + for _, t := range targets { + outDirsForPlatform[t.platform] = filepath.Join(tmpdir, t.platform) + } + + // Run the gobind command for each platform + var wg errgroup.Group + for platform, outDir := range outDirsForPlatform { + platform := platform + outDir := outDir + wg.Go(func() error { + // Catalyst support requires iOS 13+ + v, _ := strconv.ParseFloat(buildIOSVersion, 64) + if platform == "maccatalyst" && v < 13.0 { + return errors.New("catalyst requires -iosversion=13 or higher") + } + + // Run gobind once per platform to generate the bindings + cmd := exec.Command( + gobind, + "-lang=go,objc", + "-outdir="+outDir, + ) + cmd.Env = append(cmd.Env, "GOOS="+platformOS(platform)) + cmd.Env = append(cmd.Env, "CGO_ENABLED=1") + tags := append(buildTags[:], platformTags(platform)...) + cmd.Args = append(cmd.Args, "-tags="+strings.Join(tags, ",")) + if bindPrefix != "" { + cmd.Args = append(cmd.Args, "-prefix="+bindPrefix) + } + for _, p := range pkgs { + cmd.Args = append(cmd.Args, p.PkgPath) + } + if err := runCmd(cmd); err != nil { + return err + } + return nil + }) + } + if err := wg.Wait(); err != nil { + return err + } + modulesUsed, err := areGoModulesUsed() if err != nil { return err @@ -46,36 +90,10 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) var frameworkDirs []string frameworkArchCount := map[string]int{} for _, t := range targets { - // Catalyst support requires iOS 13+ - v, _ := strconv.ParseFloat(buildIOSVersion, 64) - if t.platform == "maccatalyst" && v < 13.0 { - return errors.New("catalyst requires -iosversion=13 or higher") - } - - outDir := filepath.Join(tmpdir, t.platform) + outDir := outDirsForPlatform[t.platform] outSrcDir := filepath.Join(outDir, "src") gobindDir := filepath.Join(outSrcDir, "gobind") - // Run gobind once per platform to generate the bindings - cmd := exec.Command( - gobind, - "-lang=go,objc", - "-outdir="+outDir, - ) - cmd.Env = append(cmd.Env, "GOOS="+platformOS(t.platform)) - cmd.Env = append(cmd.Env, "CGO_ENABLED=1") - tags := append(buildTags[:], platformTags(t.platform)...) - cmd.Args = append(cmd.Args, "-tags="+strings.Join(tags, ",")) - if bindPrefix != "" { - cmd.Args = append(cmd.Args, "-prefix="+bindPrefix) - } - for _, p := range pkgs { - cmd.Args = append(cmd.Args, p.PkgPath) - } - if err := runCmd(cmd); err != nil { - return err - } - env := appleEnv[t.String()][:] sdk := getenv(env, "DARWIN_SDK") From c746ac2283036723f4328ece8b39b84e428e4cc0 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Tue, 11 Oct 2022 15:39:55 +0800 Subject: [PATCH 10/68] all: fix a few function names on comments Change-Id: Ib3eb9ff469c3ecb8141f992049f4342cf3696b30 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/442095 Auto-Submit: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Reviewed-by: Joedian Reid --- exp/audio/al/al.go | 4 ++-- internal/importers/objc/objc.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exp/audio/al/al.go b/exp/audio/al/al.go index b2396a51f..b02cbb761 100644 --- a/exp/audio/al/al.go +++ b/exp/audio/al/al.go @@ -396,12 +396,12 @@ func GetListenerfv(param int, v []float32) { alGetListenerfv(param, v) } -// GetListenerf sets the float32 value for the listener parameter. +// SetListenerf sets the float32 value for the listener parameter. func SetListenerf(param int, v float32) { alListenerf(param, v) } -// GetListenerf sets the float32 vector value of the listener parameter. +// SetListenerfv sets the float32 vector value of the listener parameter. func SetListenerfv(param int, v []float32) { alListenerfv(param, v) } diff --git a/internal/importers/objc/objc.go b/internal/importers/objc/objc.go index 14c8386a6..df2b25788 100644 --- a/internal/importers/objc/objc.go +++ b/internal/importers/objc/objc.go @@ -291,7 +291,7 @@ func filterReferences(types []*Named, refs *importers.References, typeMap map[st } } -// mangleMethodsNames assigns unique Go names to ObjC methods. If a method name is unique +// mangleMethodNames assigns unique Go names to ObjC methods. If a method name is unique // within the same method list, its name is used with its first letter in upper case. // Multiple methods with the same name have their full signature appended, with : removed. func mangleMethodNames(allFuncs []*Func) { From 3eb82726e46c8e38be16d6609855874345348945 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 18 Oct 2022 09:21:39 -0400 Subject: [PATCH 11/68] cmd/gobind: exec the test binary as gobind and log only stderr by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Hajime Hoshi TryBot-Result: Gopher Robot Auto-Submit: Bryan Mills Reviewed-by: David Chase --- cmd/gobind/gobind_test.go | 81 ++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/cmd/gobind/gobind_test.go b/cmd/gobind/gobind_test.go index 4a433dd3e..302103c9e 100644 --- a/cmd/gobind/gobind_test.go +++ b/cmd/gobind/gobind_test.go @@ -7,8 +7,6 @@ package main import ( "bytes" "fmt" - "io/ioutil" - "log" "os" "os/exec" "runtime" @@ -18,6 +16,19 @@ import ( "golang.org/x/tools/go/packages/packagestest" ) +func TestMain(m *testing.M) { + // To avoid recompiling the gobind command (and to support compiler options + // like -race and -coverage), allow the test binary itself to re-exec itself + // as the gobind command by setting an environment variable. + if os.Getenv("GOBIND_TEST_IS_GOBIND") != "" { + main() + os.Exit(0) + } + os.Setenv("GOBIND_TEST_IS_GOBIND", "1") + + os.Exit(m.Run()) +} + var tests = []struct { name string lang string @@ -64,55 +75,55 @@ var tests = []struct { }, } -var gobindBin string - -func TestMain(m *testing.M) { - os.Exit(testMain(m)) +func mustHaveBindTestdata(t testing.TB) { + switch runtime.GOOS { + case "android", "ios": + t.Skipf("skipping: test cannot access ../../bind/testdata on %s/%s", runtime.GOOS, runtime.GOARCH) + } } -func testMain(m *testing.M) int { - bin, err := ioutil.TempFile("", "*.exe") - if err != nil { - log.Fatal(err) +func gobindBin(t testing.TB) string { + switch runtime.GOOS { + case "js", "ios": + t.Skipf("skipping: cannot exec subprocess on %s/%s", runtime.GOOS, runtime.GOARCH) } - bin.Close() - defer os.Remove(bin.Name()) - if runtime.GOOS != "android" { - if out, err := exec.Command("go", "build", "-o", bin.Name(), "golang.org/x/mobile/cmd/gobind").CombinedOutput(); err != nil { - log.Fatalf("gobind build failed: %v: %s", err, out) - } - gobindBin = bin.Name() + + p, err := os.Executable() + if err != nil { + t.Fatal(err) } - return m.Run() + return p } func runGobind(t testing.TB, lang, pkg, goos string, exported *packagestest.Exported) error { - if gobindBin == "" { - t.Skipf("gobind is not available on %s", runtime.GOOS) - } - cmd := exec.Command(gobindBin, "-lang", lang, pkg) + cmd := exec.Command(gobindBin(t), "-lang", lang, pkg) cmd.Dir = exported.Config.Dir cmd.Env = exported.Config.Env if goos != "" { // Add CGO_ENABLED=1 explicitly since Cgo is disabled when GOOS is different from host OS. cmd.Env = append(cmd.Env, "GOOS="+goos, "CGO_ENABLED=1") } - if out, err := cmd.CombinedOutput(); err != nil { - var cmd string - for _, env := range exported.Config.Env { - if strings.HasPrefix(env, "GO111MODULE=") { - cmd = env + " " - break - } - } - cmd += fmt.Sprintf("gobind -lang %s %s", lang, pkg) - return fmt.Errorf("%s failed: %v: %s", cmd, err, out) + stderr := new(strings.Builder) + cmd.Stderr = stderr + stdout := new(strings.Builder) + cmd.Stdout = stdout + err := cmd.Run() + if testing.Verbose() && stdout.Len() > 0 { + t.Logf("stdout (%v):\n%s", cmd, stderr) + } + if stderr.Len() > 0 { + t.Logf("stderr (%v):\n%s", cmd, stderr) + } + if err != nil { + return fmt.Errorf("%v: %w", cmd, err) } return nil } func TestGobind(t *testing.T) { packagestest.TestAll(t, testGobind) } func testGobind(t *testing.T, exporter packagestest.Exporter) { + mustHaveBindTestdata(t) + _, javapErr := exec.LookPath("javap") exported := packagestest.Export(t, exporter, []packagestest.Module{{ Name: "golang.org/x/mobile", @@ -137,9 +148,7 @@ func testGobind(t *testing.T, exporter packagestest.Exporter) { func TestDocs(t *testing.T) { packagestest.TestAll(t, testDocs) } func testDocs(t *testing.T, exporter packagestest.Exporter) { - if gobindBin == "" { - t.Skipf("gobind is not available on %s", runtime.GOOS) - } + mustHaveBindTestdata(t) const docsrc = ` package doctest @@ -165,7 +174,7 @@ type Struct struct{ const comment = "This is a comment." for _, lang := range []string{"java", "objc"} { - cmd := exec.Command(gobindBin, "-lang", lang, "example.com/doctest") + cmd := exec.Command(gobindBin(t), "-lang", lang, "example.com/doctest") cmd.Dir = exported.Config.Dir cmd.Env = exported.Config.Env out, err := cmd.CombinedOutput() From 51f526d719ab0aa30e2c27a3c1701819189ae1de Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 18 Oct 2022 10:22:24 -0400 Subject: [PATCH 12/68] go.mod: update dependency on x/tools/go/packages Also update to "go 1.17" to enable module graph pruning. For golang/go#56292. Change-Id: I1d1f4a2625d36d4c8587080e391d3e2c2e7f7808 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/443656 Run-TryBot: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Hajime Hoshi Auto-Submit: Bryan Mills Reviewed-by: David Chase --- go.mod | 8 +++++--- go.sum | 31 ++++++++++++++++--------------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index fd0ee23d7..4cbf6276e 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,13 @@ module golang.org/x/mobile -go 1.16 +go 1.17 require ( golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 golang.org/x/image v0.0.0-20190802002840-cff245a6509b - golang.org/x/mod v0.4.2 + golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde - golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098 + golang.org/x/tools v0.1.12 ) + +require golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect diff --git a/go.sum b/go.sum index b20722d51..7a596ad12 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 h1:estk1glOnSVeJ9tdEZZc5mAMDZk5lNJNyJ6DvrBkTEU= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -10,31 +10,32 @@ golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDA golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098 h1:YuekqPskqwCCPM79F1X5Dhv4ezTCj+Ki1oNwiafxkA0= -golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 406ed3a7b8e44dc32844953647b49696d8847d51 Mon Sep 17 00:00:00 2001 From: "Hana (Hyang-Ah) Kim" Date: Wed, 19 Oct 2022 01:20:18 -0400 Subject: [PATCH 13/68] cmd/gobind: do not compile package just to find package dir 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 Reviewed-by: Bryan Mills Reviewed-by: Hajime Hoshi TryBot-Result: Gopher Robot Run-TryBot: Hyang-Ah Hana Kim --- cmd/gobind/gen.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/gobind/gen.go b/cmd/gobind/gen.go index ce2bc5d22..fedbc2705 100644 --- a/cmd/gobind/gen.go +++ b/cmd/gobind/gen.go @@ -376,10 +376,14 @@ func defaultFileName(lang string, pkg *types.Package) string { } func packageDir(path string) (string, error) { - pkgs, err := packages.Load(nil, path) + mode := packages.NeedFiles + pkgs, err := packages.Load(&packages.Config{Mode: mode}, path) if err != nil { return "", err } + if len(pkgs) == 0 || len(pkgs[0].GoFiles) == 0 { + return "", fmt.Errorf("no Go package in %v", path) + } pkg := pkgs[0] if len(pkg.Errors) > 0 { return "", fmt.Errorf("%v", pkg.Errors) From b36e6246172ede3fc3cf20fcc880cecc7a0e4f5b Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 11 Oct 2022 23:42:42 +0900 Subject: [PATCH 14/68] cmd/gomobile: concurrent build for iOS archive files 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 Run-TryBot: Hajime Hoshi Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot Reviewed-by: Hyang-Ah Hana Kim Reviewed-by: Dmitri Shuralyov --- cmd/gomobile/bind_iosapp.go | 109 ++++++++++++++++++------------ cmd/gomobile/bind_test.go | 10 +-- cmd/gomobile/build.go | 28 +++++++- cmd/gomobile/build_darwin_test.go | 10 +-- cmd/gomobile/build_test.go | 2 +- cmd/gomobile/init_test.go | 2 +- 6 files changed, 105 insertions(+), 56 deletions(-) diff --git a/cmd/gomobile/bind_iosapp.go b/cmd/gomobile/bind_iosapp.go index 47f5e9895..a9f7a7f53 100644 --- a/cmd/gomobile/bind_iosapp.go +++ b/cmd/gomobile/bind_iosapp.go @@ -45,11 +45,11 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) } // Run the gobind command for each platform - var wg errgroup.Group + var gobindWG errgroup.Group for platform, outDir := range outDirsForPlatform { platform := platform outDir := outDir - wg.Go(func() error { + gobindWG.Go(func() error { // Catalyst support requires iOS 13+ v, _ := strconv.ParseFloat(buildIOSVersion, 64) if platform == "maccatalyst" && v < 13.0 { @@ -78,7 +78,7 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) return nil }) } - if err := wg.Wait(); err != nil { + if err := gobindWG.Wait(); err != nil { return err } @@ -87,12 +87,60 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) return err } + // Build archive files. + var buildWG errgroup.Group + for _, t := range targets { + t := t + buildWG.Go(func() error { + outDir := outDirsForPlatform[t.platform] + outSrcDir := filepath.Join(outDir, "src") + + if modulesUsed { + // Copy the source directory for each architecture for concurrent building. + newOutSrcDir := filepath.Join(outDir, "src-"+t.arch) + if !buildN { + if err := doCopyAll(newOutSrcDir, outSrcDir); err != nil { + return err + } + } + outSrcDir = newOutSrcDir + } + + // Copy the environment variables to make this function concurrent-safe. + env := make([]string, len(appleEnv[t.String()])) + copy(env, appleEnv[t.String()]) + + // Add the generated packages to GOPATH for reverse bindings. + gopath := fmt.Sprintf("GOPATH=%s%c%s", outDir, filepath.ListSeparator, goEnv("GOPATH")) + env = append(env, gopath) + + // Run `go mod tidy` to force to create go.sum. + // Without go.sum, `go build` fails as of Go 1.16. + if modulesUsed { + if err := writeGoMod(outSrcDir, t.platform, t.arch); err != nil { + return err + } + if err := goModTidyAt(outSrcDir, env); err != nil { + return err + } + } + + if err := goAppleBindArchive(appleArchiveFilepath(name, t), env, outSrcDir); err != nil { + return fmt.Errorf("%s/%s: %v", t.platform, t.arch, err) + } + + return nil + }) + } + if err := buildWG.Wait(); err != nil { + return err + } + var frameworkDirs []string frameworkArchCount := map[string]int{} for _, t := range targets { outDir := outDirsForPlatform[t.platform] - outSrcDir := filepath.Join(outDir, "src") - gobindDir := filepath.Join(outSrcDir, "gobind") + gobindDir := filepath.Join(outDir, "src", "gobind") env := appleEnv[t.String()][:] sdk := getenv(env, "DARWIN_SDK") @@ -101,33 +149,6 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) frameworkDirs = append(frameworkDirs, frameworkDir) frameworkArchCount[frameworkDir] = frameworkArchCount[frameworkDir] + 1 - fileBases := make([]string, len(pkgs)+1) - for i, pkg := range pkgs { - fileBases[i] = bindPrefix + strings.Title(pkg.Name) - } - fileBases[len(fileBases)-1] = "Universe" - - // Add the generated packages to GOPATH for reverse bindings. - gopath := fmt.Sprintf("GOPATH=%s%c%s", outDir, filepath.ListSeparator, goEnv("GOPATH")) - env = append(env, gopath) - - if err := writeGoMod(filepath.Join(outDir, "src"), t.platform, t.arch); err != nil { - return err - } - - // Run `go mod tidy` to force to create go.sum. - // Without go.sum, `go build` fails as of Go 1.16. - if modulesUsed { - if err := goModTidyAt(outSrcDir, env); err != nil { - return err - } - } - - path, err := goAppleBindArchive(name+"-"+t.platform+"-"+t.arch, env, outSrcDir) - if err != nil { - return fmt.Errorf("%s/%s: %v", t.platform, t.arch, err) - } - versionsDir := filepath.Join(frameworkDir, "Versions") versionsADir := filepath.Join(versionsDir, "A") titlePath := filepath.Join(versionsADir, title) @@ -135,7 +156,7 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) // Not the first static lib, attach to a fat library and skip create headers fatCmd := exec.Command( "xcrun", - "lipo", path, titlePath, "-create", "-output", titlePath, + "lipo", appleArchiveFilepath(name, t), titlePath, "-create", "-output", titlePath, ) if err := runCmd(fatCmd); err != nil { return err @@ -159,12 +180,18 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) lipoCmd := exec.Command( "xcrun", - "lipo", path, "-create", "-o", titlePath, + "lipo", appleArchiveFilepath(name, t), "-create", "-o", titlePath, ) if err := runCmd(lipoCmd); err != nil { return err } + fileBases := make([]string, len(pkgs)+1) + for i, pkg := range pkgs { + fileBases[i] = bindPrefix + strings.Title(pkg.Name) + } + fileBases[len(fileBases)-1] = "Universe" + // Copy header file next to output archive. var headerFiles []string if len(fileBases) == 1 { @@ -236,7 +263,6 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) if err != nil { return err } - } // Finally combine all frameworks to an XCFramework @@ -267,13 +293,12 @@ var appleModuleMapTmpl = template.Must(template.New("iosmmap").Parse(`framework export * }`)) -func goAppleBindArchive(name string, env []string, gosrc string) (string, error) { - archive := filepath.Join(tmpdir, name+".a") - err := goBuildAt(gosrc, "./gobind", env, "-buildmode=c-archive", "-o", archive) - if err != nil { - return "", err - } - return archive, nil +func appleArchiveFilepath(name string, t targetInfo) string { + return filepath.Join(tmpdir, name+"-"+t.platform+"-"+t.arch+".a") +} + +func goAppleBindArchive(out string, env []string, gosrc string) error { + return goBuildAt(gosrc, "./gobind", env, "-buildmode=c-archive", "-o", out) } var appleBindHeaderTmpl = template.Must(template.New("apple.h").Parse(` diff --git a/cmd/gomobile/bind_test.go b/cmd/gomobile/bind_test.go index 318ff62d1..fa6b0efb8 100644 --- a/cmd/gomobile/bind_test.go +++ b/cmd/gomobile/bind_test.go @@ -188,8 +188,8 @@ var bindAndroidTmpl = template.Must(template.New("output").Parse(`GOMOBILE={{.GO WORK=$WORK GOOS=android CGO_ENABLED=1 gobind -lang=go,java -outdir=$WORK{{if .JavaPkg}} -javapkg={{.JavaPkg}}{{end}} golang.org/x/mobile/asset mkdir -p $WORK/src-android-arm -PWD=$WORK/src-android-arm GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go mod tidy -PWD=$WORK/src-android-arm GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go build -x -buildmode=c-shared -o=$WORK/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind +PWD=$WORK/src-android-arm GOMODCACHE=$GOPATH/pkg/mod GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go mod tidy +PWD=$WORK/src-android-arm GOMODCACHE=$GOPATH/pkg/mod GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go build -x -buildmode=c-shared -o=$WORK/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind PWD=$WORK/java javac -d $WORK/javac-output -source 1.7 -target 1.7 -bootclasspath {{.AndroidPlatform}}/android.jar *.java jar c -C $WORK/javac-output . `)) @@ -198,9 +198,9 @@ var bindAppleTmpl = template.Must(template.New("output").Parse(`GOMOBILE={{.GOPA WORK=$WORK rm -r -f "{{.Output}}.xcframework" GOOS=ios CGO_ENABLED=1 gobind -lang=go,objc -outdir=$WORK/ios -tags=ios{{if .Prefix}} -prefix={{.Prefix}}{{end}} golang.org/x/mobile/asset -mkdir -p $WORK/ios/src -PWD=$WORK/ios/src GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=iphoneos-clang CXX=iphoneos-clang++ CGO_CFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphoneos GOPATH=$WORK/ios:$GOPATH go mod tidy -PWD=$WORK/ios/src GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=iphoneos-clang CXX=iphoneos-clang++ CGO_CFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphoneos GOPATH=$WORK/ios:$GOPATH go build -x -buildmode=c-archive -o $WORK/{{.Output}}-ios-arm64.a ./gobind +mkdir -p $WORK/ios/src-arm64 +PWD=$WORK/ios/src-arm64 GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=iphoneos-clang CXX=iphoneos-clang++ CGO_CFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphoneos GOPATH=$WORK/ios:$GOPATH go mod tidy +PWD=$WORK/ios/src-arm64 GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=iphoneos-clang CXX=iphoneos-clang++ CGO_CFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphoneos GOPATH=$WORK/ios:$GOPATH go build -x -buildmode=c-archive -o $WORK/{{.Output}}-ios-arm64.a ./gobind mkdir -p $WORK/ios/iphoneos/{{.Output}}.framework/Versions/A/Headers ln -s A $WORK/ios/iphoneos/{{.Output}}.framework/Versions/Current ln -s Versions/Current/Headers $WORK/ios/iphoneos/{{.Output}}.framework/Headers diff --git a/cmd/gomobile/build.go b/cmd/gomobile/build.go index 64a28fe68..c9483434d 100644 --- a/cmd/gomobile/build.go +++ b/cmd/gomobile/build.go @@ -332,7 +332,15 @@ func goCmdAt(at string, subcmd string, srcs []string, env []string, args ...stri } cmd.Args = append(cmd.Args, args...) cmd.Args = append(cmd.Args, srcs...) - cmd.Env = append([]string{}, env...) + + // Specify GOMODCACHE explicitly. The default cache path is GOPATH[0]/pkg/mod, + // but the path varies when GOPATH is specified at env, which results in cold cache. + if gmc, err := goModCachePath(); err == nil { + env = append([]string{"GOMODCACHE=" + gmc}, env...) + } else { + env = append([]string{}, env...) + } + cmd.Env = env cmd.Dir = at return runCmd(cmd) } @@ -342,7 +350,15 @@ func goModTidyAt(at string, env []string) error { if buildV { cmd.Args = append(cmd.Args, "-v") } - cmd.Env = append([]string{}, env...) + + // Specify GOMODCACHE explicitly. The default cache path is GOPATH[0]/pkg/mod, + // but the path varies when GOPATH is specified at env, which results in cold cache. + if gmc, err := goModCachePath(); err == nil { + env = append([]string{"GOMODCACHE=" + gmc}, env...) + } else { + env = append([]string{}, env...) + } + cmd.Env = env cmd.Dir = at return runCmd(cmd) } @@ -422,3 +438,11 @@ type targetInfo struct { func (t targetInfo) String() string { return t.platform + "/" + t.arch } + +func goModCachePath() (string, error) { + out, err := exec.Command("go", "env", "GOMODCACHE").Output() + if err != nil { + return "", err + } + return strings.TrimSpace(string(out)), nil +} diff --git a/cmd/gomobile/build_darwin_test.go b/cmd/gomobile/build_darwin_test.go index bb87701ad..43ca683ee 100644 --- a/cmd/gomobile/build_darwin_test.go +++ b/cmd/gomobile/build_darwin_test.go @@ -107,8 +107,8 @@ mkdir -p $WORK/main echo "{{template "infoplist" .Xinfo}}" > $WORK/main/Info.plist mkdir -p $WORK/main/Images.xcassets/AppIcon.appiconset echo "{{.Xcontents}}" > $WORK/main/Images.xcassets/AppIcon.appiconset/Contents.json -GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=iphoneos-clang CXX=iphoneos-clang++ CGO_CFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphoneos go build -tags tag1 -x -ldflags=-w -o=$WORK/ios/arm64 {{.Pkg}} -GOOS=ios GOARCH=amd64 GOFLAGS=-tags=ios CC=iphonesimulator-clang CXX=iphonesimulator-clang++ CGO_CFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_CXXFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_LDFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_ENABLED=1 DARWIN_SDK=iphonesimulator go build -tags tag1 -x -ldflags=-w -o=$WORK/iossimulator/amd64 {{.Pkg}} +GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=iphoneos-clang CXX=iphoneos-clang++ CGO_CFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphoneos go build -tags tag1 -x -ldflags=-w -o=$WORK/ios/arm64 {{.Pkg}} +GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=amd64 GOFLAGS=-tags=ios CC=iphonesimulator-clang CXX=iphonesimulator-clang++ CGO_CFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_CXXFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_LDFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_ENABLED=1 DARWIN_SDK=iphonesimulator go build -tags tag1 -x -ldflags=-w -o=$WORK/iossimulator/amd64 {{.Pkg}} xcrun lipo -o $WORK/main/main -create $WORK/ios/arm64 $WORK/iossimulator/amd64 mkdir -p $WORK/main/assets xcrun xcodebuild -configuration Release -project $WORK/main.xcodeproj -allowProvisioningUpdates DEVELOPMENT_TEAM={{.TeamID}} @@ -117,7 +117,7 @@ mv $WORK/build/Release-iphoneos/main.app {{.BuildO}} var appleOtherBuildTmpl = template.Must(infoplistTmpl.New("output").Parse(`GOMOBILE={{.GOPATH}}/pkg/gomobile WORK=$WORK -GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=iphoneos-clang CXX=iphoneos-clang++ CGO_CFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphoneos go build -tags tag1 -x {{.Pkg}} -GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=iphonesimulator-clang CXX=iphonesimulator-clang++ CGO_CFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphonesimulator go build -tags tag1 -x {{.Pkg}} -GOOS=ios GOARCH=amd64 GOFLAGS=-tags=ios CC=iphonesimulator-clang CXX=iphonesimulator-clang++ CGO_CFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_CXXFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_LDFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_ENABLED=1 DARWIN_SDK=iphonesimulator go build -tags tag1 -x {{.Pkg}} +GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=iphoneos-clang CXX=iphoneos-clang++ CGO_CFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot iphoneos -miphoneos-version-min=13.0 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphoneos go build -tags tag1 -x {{.Pkg}} +GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=iphonesimulator-clang CXX=iphonesimulator-clang++ CGO_CFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphonesimulator go build -tags tag1 -x {{.Pkg}} +GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=amd64 GOFLAGS=-tags=ios CC=iphonesimulator-clang CXX=iphonesimulator-clang++ CGO_CFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_CXXFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_LDFLAGS=-isysroot iphonesimulator -mios-simulator-version-min=13.0 -fembed-bitcode -arch x86_64 CGO_ENABLED=1 DARWIN_SDK=iphonesimulator go build -tags tag1 -x {{.Pkg}} `)) diff --git a/cmd/gomobile/build_test.go b/cmd/gomobile/build_test.go index 448c6dd2a..b50aba752 100644 --- a/cmd/gomobile/build_test.go +++ b/cmd/gomobile/build_test.go @@ -113,7 +113,7 @@ func TestAndroidBuild(t *testing.T) { var androidBuildTmpl = template.Must(template.New("output").Parse(`GOMOBILE={{.GOPATH}}/pkg/gomobile WORK=$WORK mkdir -p $WORK/lib/armeabi-v7a -GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 go build -tags tag1 -x -buildmode=c-shared -o $WORK/lib/armeabi-v7a/libbasic.so golang.org/x/mobile/example/basic +GOMODCACHE=$GOPATH/pkg/mod GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 go build -tags tag1 -x -buildmode=c-shared -o $WORK/lib/armeabi-v7a/libbasic.so golang.org/x/mobile/example/basic `)) func TestParseBuildTarget(t *testing.T) { diff --git a/cmd/gomobile/init_test.go b/cmd/gomobile/init_test.go index 5a1482b7e..2eabda1a8 100644 --- a/cmd/gomobile/init_test.go +++ b/cmd/gomobile/init_test.go @@ -175,7 +175,7 @@ var initTmpl = template.Must(template.New("output").Parse(`GOMOBILE={{.GOPATH}}/ rm -r -f "$GOMOBILE" mkdir -p $GOMOBILE WORK={{.GOPATH}}/pkg/gomobile/work -go install -x golang.org/x/mobile/cmd/gobind@latest +GOMODCACHE={{.GOPATH}}/pkg/mod go install -x golang.org/x/mobile/cmd/gobind@latest cp $OPENAL_PATH/include/AL/al.h $GOMOBILE/include/AL/al.h mkdir -p $GOMOBILE/include/AL cp $OPENAL_PATH/include/AL/alc.h $GOMOBILE/include/AL/alc.h From 43a0384520996c8376bfb8637390f12b44773e65 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Wed, 7 Sep 2022 13:17:43 +0000 Subject: [PATCH 15/68] all: remove redundant type conversion Change-Id: If63bcb8fd7610d0a052be5771062cbf4efc41355 GitHub-Last-Rev: 1739535c96132893f72cb5c40d76a11a8bbc6a94 GitHub-Pull-Request: golang/mobile#83 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/429057 Auto-Submit: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Heschi Kreinick Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- bind/seq/ref.go | 2 +- exp/sprite/portable/portable.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bind/seq/ref.go b/bind/seq/ref.go index 34e36530f..803d6923a 100644 --- a/bind/seq/ref.go +++ b/bind/seq/ref.go @@ -78,7 +78,7 @@ func ToRefNum(obj interface{}) int32 { } refs.Unlock() - return int32(num) + return num } // FromRefNum returns the Ref for a refnum. If the refnum specifies a diff --git a/exp/sprite/portable/portable.go b/exp/sprite/portable/portable.go index 28925d121..4b6c9155f 100644 --- a/exp/sprite/portable/portable.go +++ b/exp/sprite/portable/portable.go @@ -187,7 +187,7 @@ func affine(dst *image.RGBA, src image.Image, srcb image.Rectangle, mask image.I // TODO(nigeltao): is the caller or callee responsible for detecting // transforms that are simple copies or scales, for which there are faster // implementations in the xdraw package. - xdraw.ApproxBiLinear.Transform(dst, m, src, srcb, xdraw.Op(op), &xdraw.Options{ + xdraw.ApproxBiLinear.Transform(dst, m, src, srcb, op, &xdraw.Options{ SrcMask: mask, }) } From e0f57694e12c72b67ceffd119827cbea8f0840cc Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 1 Mar 2023 17:23:24 +0900 Subject: [PATCH 16/68] cmd/gomobile: update the doc about the minimum Android SDK version Change-Id: Ia17aadf683b8e3e918e0490b9b3bf4f6ae48d813 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/472236 Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot Reviewed-by: Dmitri Shuralyov Reviewed-by: Hyang-Ah Hana Kim Run-TryBot: Hajime Hoshi --- cmd/gomobile/doc.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/gomobile/doc.go b/cmd/gomobile/doc.go index 10e31278b..74090da67 100644 --- a/cmd/gomobile/doc.go +++ b/cmd/gomobile/doc.go @@ -52,7 +52,7 @@ example, in Android Studio (1.2+), an AAR file can be imported using the module import wizard (File > New > New Module > Import .JAR or .AAR package), and setting it as a new dependency (File > Project Structure > Dependencies). This requires 'javac' -(version 1.7+) and Android SDK (API level 15 or newer) to build the +(version 1.7+) and Android SDK (API level 16 or newer) to build the library for Android. The environment variable ANDROID_HOME must be set to the path to Android SDK. Use the -javapkg flag to specify the Java package prefix for the generated classes. @@ -113,7 +113,7 @@ Flag -iosversion sets the minimal version of the iOS SDK to compile against. The default version is 13.0. Flag -androidapi sets the Android API version to compile against. -The default and minimum is 15. +The default and minimum is 16. The -bundleid flag is required for -target ios and sets the bundle ID to use with the app. @@ -132,9 +132,9 @@ Usage: gomobile clean -# Clean removes object files and cached NDK files downloaded by gomobile init +Clean removes object files and cached NDK files downloaded by gomobile init. -Build OpenAL for Android +# Build OpenAL for Android Usage: From e8d11dd0ba418c197516129aa6810a4ce81dc365 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Thu, 27 Apr 2023 21:09:22 +0800 Subject: [PATCH 17/68] cmd/gobind: remove repeated definite articles Change-Id: Ib2d256f59ec759100f8c25e52acf24547a6528fb Reviewed-on: https://go-review.googlesource.com/c/mobile/+/489735 Auto-Submit: Ian Lance Taylor Auto-Submit: Dmitri Shuralyov TryBot-Result: Gopher Robot Reviewed-by: Dmitri Shuralyov Run-TryBot: shuang cui Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov --- cmd/gobind/doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gobind/doc.go b/cmd/gobind/doc.go index 31155c639..0823d5d81 100644 --- a/cmd/gobind/doc.go +++ b/cmd/gobind/doc.go @@ -218,7 +218,7 @@ to create an Android Activity subclass MainActivity: Gobind also recognizes Java interfaces as well as Objective C classes and protocols the same way. -For more details on binding the the native API, see the design proposals, +For more details on binding the native API, see the design proposals, https://golang.org/issues/16876 (Java) and https://golang.org/issues/17102 (Objective C). From 3c911d8e3edae4ddeea7f8a6e3ea9eae74f1a81a Mon Sep 17 00:00:00 2001 From: Suzukihonoka Date: Wed, 31 May 2023 10:46:28 +0000 Subject: [PATCH 18/68] cmd/gomobile: upgrade minimal javac version to 1.8 Fixes golang/go#59803 Change-Id: I248ab312eedf091bbfd6ebf35c8990fbdf611fbc GitHub-Last-Rev: c61def7df008265555efa24ef27d262d7fd9b644 GitHub-Pull-Request: golang/mobile#91 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/488555 TryBot-Result: Gopher Robot Reviewed-by: Hyang-Ah Hana Kim Reviewed-by: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov Reviewed-by: Hajime Hoshi Auto-Submit: Dmitri Shuralyov Run-TryBot: Dmitri Shuralyov --- cmd/gomobile/bind.go | 2 +- cmd/gomobile/bind_androidapp.go | 2 +- cmd/gomobile/bind_test.go | 2 +- cmd/gomobile/gendex.go | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/gomobile/bind.go b/cmd/gomobile/bind.go index 54eaa4bcf..11b406256 100644 --- a/cmd/gomobile/bind.go +++ b/cmd/gomobile/bind.go @@ -44,7 +44,7 @@ example, in Android Studio (1.2+), an AAR file can be imported using the module import wizard (File > New > New Module > Import .JAR or .AAR package), and setting it as a new dependency (File > Project Structure > Dependencies). This requires 'javac' -(version 1.7+) and Android SDK (API level 16 or newer) to build the +(version 1.8+) and Android SDK (API level 16 or newer) to build the library for Android. The ANDROID_HOME and ANDROID_NDK_HOME environment variables can be used to specify the Android SDK and NDK if they are not in the default locations. Use the -javapkg flag to specify the Java diff --git a/cmd/gomobile/bind_androidapp.go b/cmd/gomobile/bind_androidapp.go index 3fa9cfa7a..f8fcabe1b 100644 --- a/cmd/gomobile/bind_androidapp.go +++ b/cmd/gomobile/bind_androidapp.go @@ -245,7 +245,7 @@ func buildAAR(srcDir, androidDir string, pkgs []*packages.Package, targets []tar } const ( - javacTargetVer = "1.7" + javacTargetVer = "1.8" minAndroidAPI = 16 ) diff --git a/cmd/gomobile/bind_test.go b/cmd/gomobile/bind_test.go index fa6b0efb8..22a88d533 100644 --- a/cmd/gomobile/bind_test.go +++ b/cmd/gomobile/bind_test.go @@ -190,7 +190,7 @@ GOOS=android CGO_ENABLED=1 gobind -lang=go,java -outdir=$WORK{{if .JavaPkg}} -ja mkdir -p $WORK/src-android-arm PWD=$WORK/src-android-arm GOMODCACHE=$GOPATH/pkg/mod GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go mod tidy PWD=$WORK/src-android-arm GOMODCACHE=$GOPATH/pkg/mod GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go build -x -buildmode=c-shared -o=$WORK/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind -PWD=$WORK/java javac -d $WORK/javac-output -source 1.7 -target 1.7 -bootclasspath {{.AndroidPlatform}}/android.jar *.java +PWD=$WORK/java javac -d $WORK/javac-output -source 1.8 -target 1.8 -bootclasspath {{.AndroidPlatform}}/android.jar *.java jar c -C $WORK/javac-output . `)) diff --git a/cmd/gomobile/gendex.go b/cmd/gomobile/gendex.go index 88cf5549f..bfc2ad7ac 100644 --- a/cmd/gomobile/gendex.go +++ b/cmd/gomobile/gendex.go @@ -74,8 +74,8 @@ func gendex() error { } cmd := exec.Command( "javac", - "-source", "1.7", - "-target", "1.7", + "-source", "1.8", + "-target", "1.8", "-bootclasspath", platform+"/android.jar", "-d", tmpdir+"/work", ) From 7088062f872dd0678a87e8986c67992e9c8855a5 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 18 Aug 2023 10:12:29 -0400 Subject: [PATCH 19/68] all: upgrade x/tools and its dependencies This picks up CL 516917 to fix test failures in cmd/gobind. For golang/go#61035. Change-Id: Ibecb7ace6ce9133a25559191ee6075bbb714a7d7 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/520835 Reviewed-by: Robert Findley Reviewed-by: Cuong Manh Le Run-TryBot: Bryan Mills TryBot-Result: Gopher Robot Auto-Submit: Bryan Mills --- go.mod | 8 ++++---- go.sum | 28 +++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 4cbf6276e..f9b2ba20b 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.17 require ( golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 golang.org/x/image v0.0.0-20190802002840-cff245a6509b - golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 - golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde - golang.org/x/tools v0.1.12 + golang.org/x/mod v0.12.0 + golang.org/x/sync v0.3.0 + golang.org/x/tools v0.12.1-0.20230818130535-1517d1a3ba60 ) -require golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect +require golang.org/x/sys v0.11.0 // indirect diff --git a/go.sum b/go.sum index 7a596ad12..71c9bae3e 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,7 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 h1:estk1glOnSVeJ9tdEZZc5mAMDZk5lNJNyJ6DvrBkTEU= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -10,32 +11,49 @@ golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDA golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc= -golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.12.1-0.20230818130535-1517d1a3ba60 h1:o4bs4seAAlSiZQAZbO6/RP5XBCZCooQS3Pgc0AUjWts= +golang.org/x/tools v0.12.1-0.20230818130535-1517d1a3ba60/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 52620a4a7557849149770d52fd7b580cb3cbd1ae Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 2 Sep 2023 00:10:27 +0900 Subject: [PATCH 20/68] all: upgrade dependencies Change-Id: I3a3142fdd85870473d28376451d31f4f49718023 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/525075 Run-TryBot: Hajime Hoshi TryBot-Result: Gopher Robot Auto-Submit: Hajime Hoshi Reviewed-by: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov Reviewed-by: Hyang-Ah Hana Kim --- go.mod | 4 ++-- go.sum | 24 ++++-------------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index f9b2ba20b..56984a74e 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module golang.org/x/mobile go 1.17 require ( - golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 - golang.org/x/image v0.0.0-20190802002840-cff245a6509b + golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 + golang.org/x/image v0.11.0 golang.org/x/mod v0.12.0 golang.org/x/sync v0.3.0 golang.org/x/tools v0.12.1-0.20230818130535-1517d1a3ba60 diff --git a/go.sum b/go.sum index 71c9bae3e..a85cc444e 100644 --- a/go.sum +++ b/go.sum @@ -1,56 +1,40 @@ -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 h1:estk1glOnSVeJ9tdEZZc5mAMDZk5lNJNyJ6DvrBkTEU= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= +golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= +golang.org/x/image v0.11.0 h1:ds2RoQvBvYTiJkwpSFDwCcDFNX7DqjL2WsUgTNk0Ooo= +golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= From fbe1c053b6a9fb82bd32271219fa206af328fa80 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 2 Sep 2023 01:51:32 +0900 Subject: [PATCH 21/68] all: update Go version to 1.18 Fixes golang/go#62415 Change-Id: Ica46a62f60b8ebcf6244da98fe4e0643206cb24f Reviewed-on: https://go-review.googlesource.com/c/mobile/+/525095 Reviewed-by: Dmitri Shuralyov Run-TryBot: Hajime Hoshi TryBot-Result: Gopher Robot Auto-Submit: Hajime Hoshi Reviewed-by: Bryan Mills --- app/android.go | 1 - app/app.go | 1 - app/darwin_desktop.go | 1 - app/darwin_ios.go | 1 - app/internal/callfn/callfn.go | 2 -- app/internal/testapp/testapp.go | 1 - app/shiny.go | 1 - app/x11.go | 1 - asset/asset.go | 1 - asset/asset_darwin_armx.go | 2 -- asset/asset_desktop.go | 1 - bind/implicit.go | 1 - bind/testdata/testpkg/tagged.go | 1 - cmd/gobind/implicit.go | 1 - cmd/gomobile/gendex.go | 1 - cmd/gomobile/tools.go | 1 - example/basic/main.go | 1 - example/basic/main_x.go | 1 - example/flappy/game.go | 1 - example/flappy/main.go | 1 - example/flappy/main_x.go | 1 - example/ivy/tools.go | 1 - example/network/main.go | 1 - example/network/main_x.go | 1 - exp/app/debug/fps.go | 1 - exp/audio/al/al.go | 1 - exp/audio/al/al_notandroid.go | 1 - exp/audio/al/alc.go | 1 - exp/audio/al/alc_notandroid.go | 1 - exp/audio/al/const.go | 1 - exp/f32/gen.go | 1 - exp/font/font.go | 1 - exp/font/font_linux.go | 1 - exp/font/font_test.go | 1 - exp/gl/glutil/context_darwin_desktop.go | 1 - exp/gl/glutil/context_x11.go | 1 - exp/gl/glutil/glimage.go | 1 - exp/gl/glutil/glimage_test.go | 1 - exp/gl/glutil/glutil.go | 1 - exp/sensor/android.go | 1 - exp/sensor/darwin_armx.go | 2 -- exp/sensor/notmobile.go | 1 - exp/sprite/glsprite/glsprite.go | 1 - gl/gendebug.go | 4 +--- gl/gl.go | 2 -- gl/gldebug.go | 2 -- gl/types_debug.go | 2 -- gl/types_prod.go | 2 -- gl/work.go | 1 - gl/work_other.go | 2 -- go.mod | 2 +- internal/binres/genarsc.go | 1 - 52 files changed, 2 insertions(+), 62 deletions(-) diff --git a/app/android.go b/app/android.go index 08a6e0538..ebbd4b509 100644 --- a/app/android.go +++ b/app/android.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build android -// +build android /* Android Apps are built with -buildmode=c-shared. They are loaded by a diff --git a/app/app.go b/app/app.go index 19efb07f1..9817e13d7 100644 --- a/app/app.go +++ b/app/app.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux || darwin || windows -// +build linux darwin windows package app diff --git a/app/darwin_desktop.go b/app/darwin_desktop.go index 337717531..180c60278 100644 --- a/app/darwin_desktop.go +++ b/app/darwin_desktop.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin && !ios -// +build darwin,!ios package app diff --git a/app/darwin_ios.go b/app/darwin_ios.go index 8fb30fe82..bef9f4215 100644 --- a/app/darwin_ios.go +++ b/app/darwin_ios.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin && ios -// +build darwin,ios package app diff --git a/app/internal/callfn/callfn.go b/app/internal/callfn/callfn.go index 7a3d0506e..ecc3d456f 100644 --- a/app/internal/callfn/callfn.go +++ b/app/internal/callfn/callfn.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build android && (arm || 386 || amd64 || arm64) -// +build android -// +build arm 386 amd64 arm64 // Package callfn provides an android entry point. // diff --git a/app/internal/testapp/testapp.go b/app/internal/testapp/testapp.go index eb850955b..18a97bf6a 100644 --- a/app/internal/testapp/testapp.go +++ b/app/internal/testapp/testapp.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux -// +build darwin linux // Small test app used by app/app_test.go. package main diff --git a/app/shiny.go b/app/shiny.go index dd1722a27..0b4e3e550 100644 --- a/app/shiny.go +++ b/app/shiny.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build windows -// +build windows package app diff --git a/app/x11.go b/app/x11.go index ec8c90a54..7e85e137c 100644 --- a/app/x11.go +++ b/app/x11.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && !android -// +build linux,!android package app diff --git a/asset/asset.go b/asset/asset.go index 5ed3a5c5a..d23656911 100644 --- a/asset/asset.go +++ b/asset/asset.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux || windows -// +build darwin linux windows package asset diff --git a/asset/asset_darwin_armx.go b/asset/asset_darwin_armx.go index 3eac25b04..e3b3b5a13 100644 --- a/asset/asset_darwin_armx.go +++ b/asset/asset_darwin_armx.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin && (arm || arm64) -// +build darwin -// +build arm arm64 package asset diff --git a/asset/asset_desktop.go b/asset/asset_desktop.go index a36099504..af7c45f82 100644 --- a/asset/asset_desktop.go +++ b/asset/asset_desktop.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build (linux && !android) || (darwin && !arm && !arm64) || windows -// +build linux,!android darwin,!arm,!arm64 windows package asset diff --git a/bind/implicit.go b/bind/implicit.go index 5144209c3..bf1d418c0 100644 --- a/bind/implicit.go +++ b/bind/implicit.go @@ -1,7 +1,6 @@ // This file imports implicit dependencies required by generated code. //go:build mobile_implicit -// +build mobile_implicit package bind diff --git a/bind/testdata/testpkg/tagged.go b/bind/testdata/testpkg/tagged.go index b5fe898e5..701a58044 100644 --- a/bind/testdata/testpkg/tagged.go +++ b/bind/testdata/testpkg/tagged.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aaa && bbb -// +build aaa,bbb // This file tests that tags work with gomobile. package testpkg diff --git a/cmd/gobind/implicit.go b/cmd/gobind/implicit.go index 4289d4b36..e8f6dd57b 100644 --- a/cmd/gobind/implicit.go +++ b/cmd/gobind/implicit.go @@ -1,7 +1,6 @@ // This file imports implicit dependencies required by generated code. //go:build mobile_implicit -// +build mobile_implicit package main diff --git a/cmd/gomobile/gendex.go b/cmd/gomobile/gendex.go index bfc2ad7ac..be470a2bd 100644 --- a/cmd/gomobile/gendex.go +++ b/cmd/gomobile/gendex.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // Gendex generates a dex file used by Go apps created with gomobile. // diff --git a/cmd/gomobile/tools.go b/cmd/gomobile/tools.go index e8d4ade00..bee46004c 100644 --- a/cmd/gomobile/tools.go +++ b/cmd/gomobile/tools.go @@ -1,7 +1,6 @@ // This file includes the tools the gomobile depends on. //go:build tools -// +build tools package main diff --git a/example/basic/main.go b/example/basic/main.go index 94932db4f..fb6167be6 100644 --- a/example/basic/main.go +++ b/example/basic/main.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux || windows -// +build darwin linux windows // An app that draws a green triangle on a red background. // diff --git a/example/basic/main_x.go b/example/basic/main_x.go index 52e8c5399..49d8612d1 100644 --- a/example/basic/main_x.go +++ b/example/basic/main_x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !darwin && !linux && !windows -// +build !darwin,!linux,!windows package main diff --git a/example/flappy/game.go b/example/flappy/game.go index 89b8ae2db..04903c719 100644 --- a/example/flappy/game.go +++ b/example/flappy/game.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux -// +build darwin linux package main diff --git a/example/flappy/main.go b/example/flappy/main.go index 6f298ea6d..b0970f5b8 100644 --- a/example/flappy/main.go +++ b/example/flappy/main.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux -// +build darwin linux // Flappy Gopher is a simple one-button game that uses the // mobile framework and the experimental sprite engine. diff --git a/example/flappy/main_x.go b/example/flappy/main_x.go index 6739924fe..a056c79f2 100644 --- a/example/flappy/main_x.go +++ b/example/flappy/main_x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !darwin && !linux -// +build !darwin,!linux package main diff --git a/example/ivy/tools.go b/example/ivy/tools.go index 85a60697e..ab067c246 100644 --- a/example/ivy/tools.go +++ b/example/ivy/tools.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package dummy diff --git a/example/network/main.go b/example/network/main.go index 4b23cbed4..5ac2f2cc9 100644 --- a/example/network/main.go +++ b/example/network/main.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux || windows -// +build darwin linux windows // An app that paints green if golang.org is reachable when the app first // starts, or red otherwise. diff --git a/example/network/main_x.go b/example/network/main_x.go index 9bda7ac77..e6cd77852 100644 --- a/example/network/main_x.go +++ b/example/network/main_x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !darwin && !linux && !windows -// +build !darwin,!linux,!windows package main diff --git a/exp/app/debug/fps.go b/exp/app/debug/fps.go index bef808dd5..c01570582 100644 --- a/exp/app/debug/fps.go +++ b/exp/app/debug/fps.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux || windows -// +build darwin linux windows // Package debug provides GL-based debugging tools for apps. package debug // import "golang.org/x/mobile/exp/app/debug" diff --git a/exp/audio/al/al.go b/exp/audio/al/al.go index b02cbb761..974488967 100644 --- a/exp/audio/al/al.go +++ b/exp/audio/al/al.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux || windows -// +build darwin linux windows // Package al provides OpenAL Soft bindings for Go. // diff --git a/exp/audio/al/al_notandroid.go b/exp/audio/al/al_notandroid.go index 577fee361..06fee46ac 100644 --- a/exp/audio/al/al_notandroid.go +++ b/exp/audio/al/al_notandroid.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || (linux && !android) || windows -// +build darwin linux,!android windows package al diff --git a/exp/audio/al/alc.go b/exp/audio/al/alc.go index f0b421553..1c9c44282 100644 --- a/exp/audio/al/alc.go +++ b/exp/audio/al/alc.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux || windows -// +build darwin linux windows package al diff --git a/exp/audio/al/alc_notandroid.go b/exp/audio/al/alc_notandroid.go index 68e907c1c..a87df647f 100644 --- a/exp/audio/al/alc_notandroid.go +++ b/exp/audio/al/alc_notandroid.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || (linux && !android) || windows -// +build darwin linux,!android windows package al diff --git a/exp/audio/al/const.go b/exp/audio/al/const.go index aef054328..2408cbe97 100644 --- a/exp/audio/al/const.go +++ b/exp/audio/al/const.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux || windows -// +build darwin linux windows package al diff --git a/exp/f32/gen.go b/exp/f32/gen.go index fdd1c3f63..2af3327bf 100644 --- a/exp/f32/gen.go +++ b/exp/f32/gen.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/exp/font/font.go b/exp/font/font.go index c14513409..02e2b9765 100644 --- a/exp/font/font.go +++ b/exp/font/font.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux || darwin -// +build linux darwin package font diff --git a/exp/font/font_linux.go b/exp/font/font_linux.go index 65316233e..f0beb34b5 100644 --- a/exp/font/font_linux.go +++ b/exp/font/font_linux.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !android -// +build !android package font diff --git a/exp/font/font_test.go b/exp/font/font_test.go index c93c28237..f98752565 100644 --- a/exp/font/font_test.go +++ b/exp/font/font_test.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux || darwin -// +build linux darwin package font diff --git a/exp/gl/glutil/context_darwin_desktop.go b/exp/gl/glutil/context_darwin_desktop.go index 344c73e41..725cdd2e6 100644 --- a/exp/gl/glutil/context_darwin_desktop.go +++ b/exp/gl/glutil/context_darwin_desktop.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin && !ios -// +build darwin,!ios package glutil diff --git a/exp/gl/glutil/context_x11.go b/exp/gl/glutil/context_x11.go index 394f1b197..826b026d5 100644 --- a/exp/gl/glutil/context_x11.go +++ b/exp/gl/glutil/context_x11.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && !android -// +build linux,!android package glutil diff --git a/exp/gl/glutil/glimage.go b/exp/gl/glutil/glimage.go index ffe953d54..72a205f8c 100644 --- a/exp/gl/glutil/glimage.go +++ b/exp/gl/glutil/glimage.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux || darwin || windows -// +build linux darwin windows package glutil diff --git a/exp/gl/glutil/glimage_test.go b/exp/gl/glutil/glimage_test.go index 975e30504..2468303b4 100644 --- a/exp/gl/glutil/glimage_test.go +++ b/exp/gl/glutil/glimage_test.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || (linux && !android) -// +build darwin linux,!android // TODO(crawshaw): Run tests on other OSs when more contexts are supported. diff --git a/exp/gl/glutil/glutil.go b/exp/gl/glutil/glutil.go index 18b09113b..880b97e28 100644 --- a/exp/gl/glutil/glutil.go +++ b/exp/gl/glutil/glutil.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux || windows -// +build darwin linux windows package glutil // import "golang.org/x/mobile/exp/gl/glutil" diff --git a/exp/sensor/android.go b/exp/sensor/android.go index ad8a98b6e..a44861450 100644 --- a/exp/sensor/android.go +++ b/exp/sensor/android.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build android -// +build android package sensor diff --git a/exp/sensor/darwin_armx.go b/exp/sensor/darwin_armx.go index 2c8df049a..699a7aa72 100644 --- a/exp/sensor/darwin_armx.go +++ b/exp/sensor/darwin_armx.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin && (arm || arm64) -// +build darwin -// +build arm arm64 package sensor diff --git a/exp/sensor/notmobile.go b/exp/sensor/notmobile.go index 3362e548c..dc6f328c0 100644 --- a/exp/sensor/notmobile.go +++ b/exp/sensor/notmobile.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build (linux && !android) || (darwin && !arm && !arm64) || windows -// +build linux,!android darwin,!arm,!arm64 windows package sensor diff --git a/exp/sprite/glsprite/glsprite.go b/exp/sprite/glsprite/glsprite.go index 4f2522b54..1e9fa0cda 100644 --- a/exp/sprite/glsprite/glsprite.go +++ b/exp/sprite/glsprite/glsprite.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux || windows -// +build darwin linux windows // Package glsprite implements a sprite Engine using OpenGL ES 2. // diff --git a/gl/gendebug.go b/gl/gendebug.go index 2e6563cd8..146826f07 100644 --- a/gl/gendebug.go +++ b/gl/gendebug.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // The gendebug program takes gl.go and generates a version of it // where each function includes tracing code that writes its arguments @@ -885,8 +884,7 @@ const preamble = `// Copyright 2014 The Go Authors. All rights reserved. // Code generated from gl.go using go generate. DO NOT EDIT. // See doc.go for details. -// +build darwin linux openbsd windows -// +build gldebug +//go:build (darwin || linux || openbsd || windows) && gldebug package gl diff --git a/gl/gl.go b/gl/gl.go index 195a30919..28e747b09 100644 --- a/gl/gl.go +++ b/gl/gl.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (darwin || linux || openbsd || windows) && !gldebug -// +build darwin linux openbsd windows -// +build !gldebug package gl diff --git a/gl/gldebug.go b/gl/gldebug.go index 5a4bf71da..fb79bb7ac 100644 --- a/gl/gldebug.go +++ b/gl/gldebug.go @@ -6,8 +6,6 @@ // See doc.go for details. //go:build (darwin || linux || openbsd || windows) && gldebug -// +build darwin linux openbsd windows -// +build gldebug package gl diff --git a/gl/types_debug.go b/gl/types_debug.go index b6dbaaad0..ea011704e 100644 --- a/gl/types_debug.go +++ b/gl/types_debug.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (darwin || linux || openbsd || windows) && gldebug -// +build darwin linux openbsd windows -// +build gldebug package gl diff --git a/gl/types_prod.go b/gl/types_prod.go index e1c8b423c..f87f91f75 100644 --- a/gl/types_prod.go +++ b/gl/types_prod.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (darwin || linux || openbsd || windows) && !gldebug -// +build darwin linux openbsd windows -// +build !gldebug package gl diff --git a/gl/work.go b/gl/work.go index 65eaf9a23..c603adfe6 100644 --- a/gl/work.go +++ b/gl/work.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || linux || openbsd -// +build darwin linux openbsd package gl diff --git a/gl/work_other.go b/gl/work_other.go index b4b48f445..3bc597d43 100644 --- a/gl/work_other.go +++ b/gl/work_other.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (!cgo || (!darwin && !linux && !openbsd)) && !windows -// +build !cgo !darwin,!linux,!openbsd -// +build !windows package gl diff --git a/go.mod b/go.mod index 56984a74e..3b8143300 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module golang.org/x/mobile -go 1.17 +go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 diff --git a/internal/binres/genarsc.go b/internal/binres/genarsc.go index 4ec35fbc5..2e71f29f0 100644 --- a/internal/binres/genarsc.go +++ b/internal/binres/genarsc.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // Genarsc generates stripped down version of android.jar resources used // for validation of manifest entries. From dc64209e86f1af016ddbda6a5fb7a6e45adf32b5 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 6 Sep 2023 01:38:57 +0900 Subject: [PATCH 22/68] cmd/gomobile: add go statements to autogenerated go.mod files 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. Fixes golang/go#62458 Change-Id: Ibabd1974f8cd7a3e01eb89994080e32a7115693a Reviewed-on: https://go-review.googlesource.com/c/mobile/+/525695 Run-TryBot: Hajime Hoshi Reviewed-by: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov Reviewed-by: Hyang-Ah Hana Kim TryBot-Result: Gopher Robot --- cmd/gomobile/bind.go | 29 +++++++++++-- cmd/gomobile/bind_test.go | 90 ++++++++++++++++++++++++++++++++++++--- cmd/gomobile/main.go | 24 +++++++---- 3 files changed, 124 insertions(+), 19 deletions(-) diff --git a/cmd/gomobile/bind.go b/cmd/gomobile/bind.go index 11b406256..fc9f75631 100644 --- a/cmd/gomobile/bind.go +++ b/cmd/gomobile/bind.go @@ -251,7 +251,9 @@ func getModuleVersions(targetPlatform string, targetArch string, src string) (*m } f := &modfile.File{} - f.AddModuleStmt("gobind") + if err := f.AddModuleStmt("gobind"); err != nil { + return nil, err + } e := json.NewDecoder(bytes.NewReader(output)) for { var mod *Module @@ -266,13 +268,19 @@ func getModuleVersions(targetPlatform string, targetArch string, src string) (*m // replaced by a local directory p = mod.Replace.Dir } - f.AddReplace(mod.Path, mod.Version, p, v) + if err := f.AddReplace(mod.Path, mod.Version, p, v); err != nil { + return nil, err + } } else { // When the version part is empty, the module is local and mod.Dir represents the location. if v := mod.Version; v == "" { - f.AddReplace(mod.Path, mod.Version, mod.Dir, "") + if err := f.AddReplace(mod.Path, mod.Version, mod.Dir, ""); err != nil { + return nil, err + } } else { - f.AddRequire(mod.Path, v) + if err := f.AddRequire(mod.Path, v); err != nil { + return nil, err + } } } } @@ -280,6 +288,19 @@ func getModuleVersions(targetPlatform string, targetArch string, src string) (*m break } } + + v, err := ensureGoVersion() + if err != nil { + return nil, err + } + // ensureGoVersion can return an empty string for a devel version. In this case, use the minimum version. + if v == "" { + v = fmt.Sprintf("go1.%d", minimumGoMinorVersion) + } + if err := f.AddGoStmt(strings.TrimPrefix(v, "go")); err != nil { + return nil, err + } + return f, nil } diff --git a/cmd/gomobile/bind_test.go b/cmd/gomobile/bind_test.go index 22a88d533..42d3f1110 100644 --- a/cmd/gomobile/bind_test.go +++ b/cmd/gomobile/bind_test.go @@ -6,7 +6,6 @@ package main import ( "bytes" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -251,16 +250,75 @@ func TestBindAppleAll(t *testing.T) { } } +const ambiguousPathsGoMod = `module ambiguouspaths + +go 1.18 + +require golang.org/x/mobile v0.0.0-20230905140555-fbe1c053b6a9 + +require ( + golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 // indirect + golang.org/x/image v0.11.0 // indirect + golang.org/x/sys v0.11.0 // indirect +) +` + +const ambiguousPathsGoSum = `github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= +golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= +golang.org/x/image v0.11.0 h1:ds2RoQvBvYTiJkwpSFDwCcDFNX7DqjL2WsUgTNk0Ooo= +golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8= +golang.org/x/mobile v0.0.0-20230905140555-fbe1c053b6a9 h1:LaLfQUz4L1tfuOlrtEouZLZ0qHDwKn87E1NKoiudP/o= +golang.org/x/mobile v0.0.0-20230905140555-fbe1c053b6a9/go.mod h1:2jxcxt/JNJik+N+QcB8q308+SyrE3bu43+sGZDmJ02M= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +` + +const ambiguousPathsGo = `package ambiguouspaths + +import ( + _ "golang.org/x/mobile/app" +) + +func Dummy() {} +` + func TestBindWithGoModules(t *testing.T) { if runtime.GOOS == "android" || runtime.GOOS == "ios" { t.Skipf("gomobile and gobind are not available on %s", runtime.GOOS) } - dir, err := ioutil.TempDir("", "gomobile-test") - if err != nil { - t.Fatal(err) - } - defer os.RemoveAll(dir) + dir := t.TempDir() if out, err := exec.Command("go", "build", "-o="+dir, "golang.org/x/mobile/cmd/gobind").CombinedOutput(); err != nil { t.Fatalf("%v: %s", err, string(out)) @@ -273,7 +331,22 @@ func TestBindWithGoModules(t *testing.T) { path += string(filepath.ListSeparator) + p } + // Create a source package dynamically to avoid go.mod files in this repository. See golang/go#34352 for more details. + if err := os.Mkdir(filepath.Join(dir, "ambiguouspaths"), 0755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(dir, "ambiguouspaths", "go.mod"), []byte(ambiguousPathsGoMod), 0644); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(dir, "ambiguouspaths", "go.sum"), []byte(ambiguousPathsGoSum), 0644); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(dir, "ambiguouspaths", "ambiguouspaths.go"), []byte(ambiguousPathsGo), 0644); err != nil { + t.Fatal(err) + } + for _, target := range []string{"android", "ios"} { + target := target t.Run(target, func(t *testing.T) { switch target { case "android": @@ -308,6 +381,11 @@ func TestBindWithGoModules(t *testing.T) { Path: "./bind/testdata/cgopkg", Dir: filepath.Join("..", ".."), }, + { + Name: "Ambiguous Paths", + Path: ".", + Dir: filepath.Join(dir, "ambiguouspaths"), + }, } for _, tc := range tests { diff --git a/cmd/gomobile/main.go b/cmd/gomobile/main.go index 9814a0d49..fe6fd7e16 100644 --- a/cmd/gomobile/main.go +++ b/cmd/gomobile/main.go @@ -9,7 +9,6 @@ package main import ( "bufio" "bytes" - "errors" "flag" "fmt" "html/template" @@ -24,9 +23,11 @@ import ( var ( gomobileName = "gomobile" - goVersionOut = []byte(nil) + goVersion string ) +const minimumGoMinorVersion = 18 + func printUsage(w io.Writer) { bufw := bufio.NewWriter(w) if err := usageTmpl.Execute(bufw, commands); err != nil { @@ -58,7 +59,7 @@ func main() { return } - if err := determineGoVersion(); err != nil { + if _, err := ensureGoVersion(); err != nil { fmt.Fprintf(os.Stderr, "%s: %v\n", gomobileName, err) os.Exit(1) } @@ -84,20 +85,25 @@ func main() { os.Exit(2) } -func determineGoVersion() error { +func ensureGoVersion() (string, error) { + if goVersion != "" { + return goVersion, nil + } + goVersionOut, err := exec.Command("go", "version").CombinedOutput() if err != nil { - return fmt.Errorf("'go version' failed: %v, %s", err, goVersionOut) + return "", fmt.Errorf("'go version' failed: %v, %s", err, goVersionOut) } var minor int if _, err := fmt.Sscanf(string(goVersionOut), "go version go1.%d", &minor); err != nil { // Ignore unknown versions; it's probably a devel version. - return nil + return "", nil } - if minor < 16 { - return errors.New("Go 1.16 or newer is required") + goVersion = fmt.Sprintf("go1.%d", minor) + if minor < minimumGoMinorVersion { + return "", fmt.Errorf("Go 1.%d or newer is required", minimumGoMinorVersion) } - return nil + return goVersion, nil } func help(args []string) { From 2077a32245712f1a55baf9c461e98b569abe852a Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Wed, 6 Sep 2023 12:21:26 +0000 Subject: [PATCH 23/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I6fe5f820573eed19138f9ec230955e394370798f Reviewed-on: https://go-review.googlesource.com/c/mobile/+/526035 Reviewed-by: Dmitri Shuralyov Reviewed-by: Carlos Amedee LUCI-TryBot-Result: Go LUCI Auto-Submit: Gopher Robot Reviewed-by: Dmitri Shuralyov --- go.mod | 6 +++--- go.sum | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 3b8143300..6815f29e2 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.11.0 + golang.org/x/image v0.12.0 golang.org/x/mod v0.12.0 golang.org/x/sync v0.3.0 - golang.org/x/tools v0.12.1-0.20230818130535-1517d1a3ba60 + golang.org/x/tools v0.13.0 ) -require golang.org/x/sys v0.11.0 // indirect +require golang.org/x/sys v0.12.0 // indirect diff --git a/go.sum b/go.sum index a85cc444e..8a8553b7c 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.11.0 h1:ds2RoQvBvYTiJkwpSFDwCcDFNX7DqjL2WsUgTNk0Ooo= -golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8= +golang.org/x/image v0.12.0 h1:w13vZbU4o5rKOFFR8y7M+c4A5jXDC0uXTdHYRP8X2DQ= +golang.org/x/image v0.12.0/go.mod h1:Lu90jvHG7GfemOIcldsh9A2hS01ocl6oNO7ype5mEnk= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= @@ -24,8 +24,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -33,11 +33,11 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.12.1-0.20230818130535-1517d1a3ba60 h1:o4bs4seAAlSiZQAZbO6/RP5XBCZCooQS3Pgc0AUjWts= -golang.org/x/tools v0.12.1-0.20230818130535-1517d1a3ba60/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From e2f452493d570cfe278e63eccec99e62d4c775e5 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 21 Sep 2023 23:55:41 +0900 Subject: [PATCH 24/68] cmd/gomobile: resolve symbolic links as a workaround for an Xcode bug 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. Fixes golang/go#63141 Change-Id: Ieb684223192fc3e354b79dededaecdb0b25937e6 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/530135 TryBot-Result: Gopher Robot Run-TryBot: Hajime Hoshi Reviewed-by: Bryan Mills Reviewed-by: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov Auto-Submit: Hajime Hoshi --- cmd/gomobile/bind_iosapp.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/gomobile/bind_iosapp.go b/cmd/gomobile/bind_iosapp.go index a9f7a7f53..38437439c 100644 --- a/cmd/gomobile/bind_iosapp.go +++ b/cmd/gomobile/bind_iosapp.go @@ -269,6 +269,14 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) xcframeworkArgs := []string{"-create-xcframework"} for _, dir := range frameworkDirs { + // 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. + dir, err := filepath.EvalSymlinks(dir) + if err != nil { + return err + } xcframeworkArgs = append(xcframeworkArgs, "-framework", dir) } From 2b44d11868fe87303c853ff0f8b8a8b0c33da4f2 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Fri, 6 Oct 2023 11:09:39 +0000 Subject: [PATCH 25/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: Ia243abc717b04a327f90fb0db14cd40504bcf412 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/533380 LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov Reviewed-by: Carlos Amedee Auto-Submit: Gopher Robot --- go.mod | 10 +++++----- go.sum | 51 ++++++++++----------------------------------------- 2 files changed, 15 insertions(+), 46 deletions(-) diff --git a/go.mod b/go.mod index 6815f29e2..4d5636222 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.12.0 - golang.org/x/mod v0.12.0 - golang.org/x/sync v0.3.0 - golang.org/x/tools v0.13.0 + golang.org/x/image v0.13.0 + golang.org/x/mod v0.13.0 + golang.org/x/sync v0.4.0 + golang.org/x/tools v0.14.0 ) -require golang.org/x/sys v0.12.0 // indirect +require golang.org/x/sys v0.13.0 // indirect diff --git a/go.sum b/go.sum index 8a8553b7c..a1e5b027a 100644 --- a/go.sum +++ b/go.sum @@ -1,43 +1,12 @@ -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.12.0 h1:w13vZbU4o5rKOFFR8y7M+c4A5jXDC0uXTdHYRP8X2DQ= -golang.org/x/image v0.12.0/go.mod h1:Lu90jvHG7GfemOIcldsh9A2hS01ocl6oNO7ype5mEnk= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/image v0.13.0 h1:3cge/F/QTkNLauhf2QoE9zp+7sr+ZcL4HnoZmdwg9sg= +golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= From 35478a0c49da882188b186a3893d45be6ff74327 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Wed, 8 Nov 2023 22:58:57 +0000 Subject: [PATCH 26/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I4f17695a3f1568ad38c6cf63e51d2f0d58c59ffc Reviewed-on: https://go-review.googlesource.com/c/mobile/+/540821 Reviewed-by: Heschi Kreinick Auto-Submit: Gopher Robot LUCI-TryBot-Result: Go LUCI Reviewed-by: Carlos Amedee --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 4d5636222..56b6bdb0d 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.13.0 - golang.org/x/mod v0.13.0 - golang.org/x/sync v0.4.0 - golang.org/x/tools v0.14.0 + golang.org/x/image v0.14.0 + golang.org/x/mod v0.14.0 + golang.org/x/sync v0.5.0 + golang.org/x/tools v0.15.0 ) -require golang.org/x/sys v0.13.0 // indirect +require golang.org/x/sys v0.14.0 // indirect diff --git a/go.sum b/go.sum index a1e5b027a..26aecf893 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,12 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.13.0 h1:3cge/F/QTkNLauhf2QoE9zp+7sr+ZcL4HnoZmdwg9sg= -golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4= +golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= +golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= From 76ac6878050a2eef81867f2c6c21108e59919e8f Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Mon, 27 Nov 2023 18:30:54 +0000 Subject: [PATCH 27/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I220944631310aa41f80e4862d64df04036e7f36f Reviewed-on: https://go-review.googlesource.com/c/mobile/+/545256 LUCI-TryBot-Result: Go LUCI Auto-Submit: Gopher Robot Reviewed-by: Heschi Kreinick Reviewed-by: Dmitri Shuralyov --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 56b6bdb0d..7323bc3d6 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( golang.org/x/image v0.14.0 golang.org/x/mod v0.14.0 golang.org/x/sync v0.5.0 - golang.org/x/tools v0.15.0 + golang.org/x/tools v0.16.0 ) -require golang.org/x/sys v0.14.0 // indirect +require golang.org/x/sys v0.15.0 // indirect diff --git a/go.sum b/go.sum index 26aecf893..1b5415417 100644 --- a/go.sum +++ b/go.sum @@ -6,7 +6,7 @@ golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= -golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= +golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= From c713f31d574bb632a93f169b2cc99c9e753fef0e Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Thu, 11 Jan 2024 22:58:17 +0000 Subject: [PATCH 28/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I5c0afe458ee23e43bc4cb0619d9297b0a7795aa1 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/555518 Auto-Submit: Gopher Robot LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov Reviewed-by: Than McIntosh --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 7323bc3d6..ee2c3f2ff 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.14.0 + golang.org/x/image v0.15.0 golang.org/x/mod v0.14.0 - golang.org/x/sync v0.5.0 - golang.org/x/tools v0.16.0 + golang.org/x/sync v0.6.0 + golang.org/x/tools v0.17.0 ) -require golang.org/x/sys v0.15.0 // indirect +require golang.org/x/sys v0.16.0 // indirect diff --git a/go.sum b/go.sum index 1b5415417..cfc97dfdc 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,12 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4= -golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= +golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8= +golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= From d1f7d34360758c8fa4e81b703102e5a1e44e65f5 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Mon, 12 Feb 2024 23:03:23 +0000 Subject: [PATCH 29/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I580f00b3c82b1bc521470eddc78ef5b3a3e48300 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/563557 Auto-Submit: Gopher Robot Reviewed-by: Than McIntosh LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index ee2c3f2ff..dfdab4142 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 golang.org/x/image v0.15.0 - golang.org/x/mod v0.14.0 + golang.org/x/mod v0.15.0 golang.org/x/sync v0.6.0 - golang.org/x/tools v0.17.0 + golang.org/x/tools v0.18.0 ) -require golang.org/x/sys v0.16.0 // indirect +require golang.org/x/sys v0.17.0 // indirect diff --git a/go.sum b/go.sum index cfc97dfdc..69b595b04 100644 --- a/go.sum +++ b/go.sum @@ -2,11 +2,11 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1 golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8= golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= From 19e4cdff4698e6e1e3332362aa283798fd26aa8c Mon Sep 17 00:00:00 2001 From: scosman Date: Sun, 17 Mar 2024 14:28:57 +0000 Subject: [PATCH 30/68] cmd/gomobile: fix a compatibility issue with Xcode 15.3 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 Fixes golang/go#66018 Change-Id: I3e8ee99adb09071aa89a541dc97271a44b552ea3 GitHub-Last-Rev: 6277c7d66a26efa8b9ff99dea191eeb7bef136a6 GitHub-Pull-Request: golang/mobile#96 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/572175 TryBot-Result: Gopher Robot TryBot-Bypass: Hyang-Ah Hana Kim Reviewed-by: Hajime Hoshi Reviewed-by: Dmitri Shuralyov Run-TryBot: Hajime Hoshi Reviewed-by: Hyang-Ah Hana Kim Auto-Submit: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov --- cmd/gomobile/bind_iosapp.go | 45 +++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/cmd/gomobile/bind_iosapp.go b/cmd/gomobile/bind_iosapp.go index 38437439c..e92aa369c 100644 --- a/cmd/gomobile/bind_iosapp.go +++ b/cmd/gomobile/bind_iosapp.go @@ -5,6 +5,8 @@ package main import ( + "bytes" + "encoding/xml" "errors" "fmt" "io" @@ -230,6 +232,14 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) if err != nil { return err } + + err = writeFile(filepath.Join(frameworkDir, "Info.plist"), func(w io.Writer) error { + _, err := w.Write([]byte(appleBlankInfoPlist)) + return err + }) + if err != nil { + return err + } } if err := mkdir(filepath.Join(versionsADir, "Resources")); err != nil { @@ -239,7 +249,15 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) return err } err = writeFile(filepath.Join(frameworkDir, "Resources", "Info.plist"), func(w io.Writer) error { - _, err := w.Write([]byte(appleBindInfoPlist)) + infoFrameworkPlistlData := infoFrameworkPlistlData{ + BundleID: escapePlistValue(rfc1034Label(title)), + ExecutableName: escapePlistValue(title), + } + infoplist := new(bytes.Buffer) + if err := infoFrameworkPlistTmpl.Execute(infoplist, infoFrameworkPlistlData); err != nil { + return err + } + _, err := w.Write(infoplist.Bytes()) return err }) if err != nil { @@ -286,7 +304,7 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) return err } -const appleBindInfoPlist = ` +const appleBlankInfoPlist = ` @@ -294,6 +312,29 @@ const appleBindInfoPlist = ` ` +type infoFrameworkPlistlData struct { + BundleID string + ExecutableName string +} + +var infoFrameworkPlistTmpl = template.Must(template.New("infoFrameworkPlist").Parse(` + + + + CFBundleExecutable + {{.ExecutableName}} + CFBundleIdentifier + {{.BundleID}} + + +`)) + +func escapePlistValue(value string) string { + var b bytes.Buffer + xml.EscapeText(&b, []byte(value)) + return b.String() +} + var appleModuleMapTmpl = template.Must(template.New("iosmmap").Parse(`framework module "{{.Module}}" { header "ref.h" {{range .Headers}} header "{{.}}" From c58ccf4b0c872b591d01fb9385f3cc4a71edfc49 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Tue, 5 Mar 2024 00:07:47 +0000 Subject: [PATCH 31/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: Ia4925c83dad0a905dc8b74b8494a0d750fbe18be Reviewed-on: https://go-review.googlesource.com/c/mobile/+/569055 LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov Auto-Submit: Gopher Robot Reviewed-by: Dmitri Shuralyov Reviewed-by: Than McIntosh --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index dfdab4142..1af8e5dca 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 golang.org/x/image v0.15.0 - golang.org/x/mod v0.15.0 + golang.org/x/mod v0.16.0 golang.org/x/sync v0.6.0 - golang.org/x/tools v0.18.0 + golang.org/x/tools v0.19.0 ) -require golang.org/x/sys v0.17.0 // indirect +require golang.org/x/sys v0.18.0 // indirect diff --git a/go.sum b/go.sum index 69b595b04..a7475d851 100644 --- a/go.sum +++ b/go.sum @@ -2,11 +2,11 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1 golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8= golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= From c76e57eead388dbb2912348f6598b6716b8f6535 Mon Sep 17 00:00:00 2001 From: vitalmotif Date: Wed, 20 Mar 2024 11:28:43 +0000 Subject: [PATCH 32/68] all: remove the repetitive words Change-Id: Ifdadb14d311a3620e499f0b33feefa3e0448a6f1 GitHub-Last-Rev: 4c346f55374cb8ab87c7a258c7d4ed932faa25ad GitHub-Pull-Request: golang/mobile#97 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/573035 Reviewed-by: Hajime Hoshi Reviewed-by: Hyang-Ah Hana Kim Reviewed-by: Dmitri Shuralyov Auto-Submit: Dmitri Shuralyov Run-TryBot: Hajime Hoshi TryBot-Result: Gopher Robot LUCI-TryBot-Result: Go LUCI Auto-Submit: Hyang-Ah Hana Kim --- bind/genobjc.go | 2 +- geom/geom.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bind/genobjc.go b/bind/genobjc.go index d0982207d..d5914138a 100644 --- a/bind/genobjc.go +++ b/bind/genobjc.go @@ -977,7 +977,7 @@ func (g *ObjcGen) genInterfaceMethodProxy(obj *types.TypeName, m *types.Func) { if isErrorType(obj.Type()) && m.Name() == "Error" { // As a special case, ObjC NSErrors are passed to Go pretending to implement the Go error interface. - // They don't actually have an Error method, so calls to to it needs to be rerouted. + // They don't actually have an Error method, so calls to it needs to be rerouted. g.Printf("%s = [o localizedDescription];\n", s.retParams[0].name) } else { if s.ret == "void" { diff --git a/geom/geom.go b/geom/geom.go index 23cf67bea..1bfd14f3e 100644 --- a/geom/geom.go +++ b/geom/geom.go @@ -74,7 +74,7 @@ import "fmt" // // The unit Pt is a typographical point, 1/72 of an inch (0.3527 mm). // -// It can be be converted to a length in current device pixels by +// It can be converted to a length in current device pixels by // multiplying with PixelsPerPt after app initialization is complete. type Pt float32 From 268e6c3a80d13e6acfd3b93ef02c3e2605e1ef46 Mon Sep 17 00:00:00 2001 From: scosman Date: Mon, 25 Mar 2024 16:46:07 +0000 Subject: [PATCH 33/68] cmd/gomobile: produce frameworks which follow Apple's specs per platform, fixing Xcode 15.3 compatibility issues 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 fixes golang/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 Fixes golang/go#66406 Fixes golang/go#66500 Change-Id: I8538989efe67cb0d2d0496087dcbeca923c3dffe GitHub-Last-Rev: 28dca85888bedcc5eb44d3c74af6b88cf5121914 GitHub-Pull-Request: golang/mobile#98 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/574055 Reviewed-by: Dmitri Shuralyov Reviewed-by: Hajime Hoshi Auto-Submit: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Reviewed-by: Than McIntosh Reviewed-by: Dmitri Shuralyov --- cmd/gomobile/bind_iosapp.go | 109 ++++++++++++++++++++++-------------- 1 file changed, 67 insertions(+), 42 deletions(-) diff --git a/cmd/gomobile/bind_iosapp.go b/cmd/gomobile/bind_iosapp.go index e92aa369c..e8ebcc770 100644 --- a/cmd/gomobile/bind_iosapp.go +++ b/cmd/gomobile/bind_iosapp.go @@ -151,9 +151,12 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) frameworkDirs = append(frameworkDirs, frameworkDir) frameworkArchCount[frameworkDir] = frameworkArchCount[frameworkDir] + 1 - versionsDir := filepath.Join(frameworkDir, "Versions") - versionsADir := filepath.Join(versionsDir, "A") - titlePath := filepath.Join(versionsADir, title) + frameworkLayout, err := frameworkLayoutForTarget(t, title) + if err != nil { + return err + } + + titlePath := filepath.Join(frameworkDir, frameworkLayout.binaryPath, title) if frameworkArchCount[frameworkDir] > 1 { // Not the first static lib, attach to a fat library and skip create headers fatCmd := exec.Command( @@ -166,17 +169,8 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) continue } - versionsAHeadersDir := filepath.Join(versionsADir, "Headers") - if err := mkdir(versionsAHeadersDir); err != nil { - return err - } - if err := symlink("A", filepath.Join(versionsDir, "Current")); err != nil { - return err - } - if err := symlink("Versions/Current/Headers", filepath.Join(frameworkDir, "Headers")); err != nil { - return err - } - if err := symlink(filepath.Join("Versions/Current", title), filepath.Join(frameworkDir, title)); err != nil { + headersDir := filepath.Join(frameworkDir, frameworkLayout.headerPath) + if err := mkdir(headersDir); err != nil { return err } @@ -199,7 +193,7 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) if len(fileBases) == 1 { headerFiles = append(headerFiles, title+".h") err := copyFile( - filepath.Join(versionsAHeadersDir, title+".h"), + filepath.Join(headersDir, title+".h"), filepath.Join(gobindDir, bindPrefix+title+".objc.h"), ) if err != nil { @@ -209,7 +203,7 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) for _, fileBase := range fileBases { headerFiles = append(headerFiles, fileBase+".objc.h") err := copyFile( - filepath.Join(versionsAHeadersDir, fileBase+".objc.h"), + filepath.Join(headersDir, fileBase+".objc.h"), filepath.Join(gobindDir, fileBase+".objc.h"), ) if err != nil { @@ -217,14 +211,14 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) } } err := copyFile( - filepath.Join(versionsAHeadersDir, "ref.h"), + filepath.Join(headersDir, "ref.h"), filepath.Join(gobindDir, "ref.h"), ) if err != nil { return err } headerFiles = append(headerFiles, title+".h") - err = writeFile(filepath.Join(versionsAHeadersDir, title+".h"), func(w io.Writer) error { + err = writeFile(filepath.Join(headersDir, title+".h"), func(w io.Writer) error { return appleBindHeaderTmpl.Execute(w, map[string]interface{}{ "pkgs": pkgs, "title": title, "bases": fileBases, }) @@ -232,23 +226,13 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) if err != nil { return err } - - err = writeFile(filepath.Join(frameworkDir, "Info.plist"), func(w io.Writer) error { - _, err := w.Write([]byte(appleBlankInfoPlist)) - return err - }) - if err != nil { - return err - } } - if err := mkdir(filepath.Join(versionsADir, "Resources")); err != nil { - return err - } - if err := symlink("Versions/Current/Resources", filepath.Join(frameworkDir, "Resources")); err != nil { + frameworkInfoPlistDir := filepath.Join(frameworkDir, frameworkLayout.infoPlistPath) + if err := mkdir(frameworkInfoPlistDir); err != nil { return err } - err = writeFile(filepath.Join(frameworkDir, "Resources", "Info.plist"), func(w io.Writer) error { + err = writeFile(filepath.Join(frameworkInfoPlistDir, "Info.plist"), func(w io.Writer) error { infoFrameworkPlistlData := infoFrameworkPlistlData{ BundleID: escapePlistValue(rfc1034Label(title)), ExecutableName: escapePlistValue(title), @@ -271,15 +255,18 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) Module: title, Headers: headerFiles, } - err = writeFile(filepath.Join(versionsADir, "Modules", "module.modulemap"), func(w io.Writer) error { + modulesDir := filepath.Join(frameworkDir, frameworkLayout.modulePath) + err = writeFile(filepath.Join(modulesDir, "module.modulemap"), func(w io.Writer) error { return appleModuleMapTmpl.Execute(w, mmVals) }) if err != nil { return err } - err = symlink(filepath.Join("Versions/Current/Modules"), filepath.Join(frameworkDir, "Modules")) - if err != nil { - return err + + for src, dst := range frameworkLayout.symlinks { + if err := symlink(src, filepath.Join(frameworkDir, dst)); err != nil { + return err + } } } @@ -304,19 +291,53 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) return err } -const appleBlankInfoPlist = ` - - - - - -` +type frameworkLayout struct { + headerPath string + binaryPath string + modulePath string + infoPlistPath string + // symlinks to create in the framework. Maps src (relative to dst) -> dst (relative to framework bundle root) + symlinks map[string]string +} + +// frameworkLayoutForTarget generates the filestructure for a framework for the given target platform (macos, ios, etc), +// according to Apple's spec https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle +func frameworkLayoutForTarget(t targetInfo, title string) (*frameworkLayout, error) { + switch t.platform { + case "macos", "maccatalyst": + return &frameworkLayout{ + headerPath: "Versions/A/Headers", + binaryPath: "Versions/A", + modulePath: "Versions/A/Modules", + infoPlistPath: "Versions/A/Resources", + symlinks: map[string]string{ + "A": "Versions/Current", + "Versions/Current/Resources": "Resources", + "Versions/Current/Headers": "Headers", + "Versions/Current/Modules": "Modules", + filepath.Join("Versions/Current", title): title, + }, + }, nil + case "ios", "iossimulator": + return &frameworkLayout{ + headerPath: "Headers", + binaryPath: ".", + modulePath: "Modules", + infoPlistPath: ".", + }, nil + } + + return nil, fmt.Errorf("unsupported platform %q", t.platform) +} type infoFrameworkPlistlData struct { BundleID string ExecutableName string } +// infoFrameworkPlistTmpl is a template for the Info.plist file in a framework. +// Minimum OS version == 100.0 is a workaround for SPM issue +// https://github.com/firebase/firebase-ios-sdk/pull/12439/files#diff-f4eb4ff5ec89af999cbe8fa3ffe5647d7853ffbc9c1515b337ca043c684b6bb4R679 var infoFrameworkPlistTmpl = template.Must(template.New("infoFrameworkPlist").Parse(` @@ -325,6 +346,10 @@ var infoFrameworkPlistTmpl = template.Must(template.New("infoFrameworkPlist").Pa {{.ExecutableName}} CFBundleIdentifier {{.BundleID}} + MinimumOSVersion + 100.0 + CFBundlePackageType + FMWK `)) From 365c3533877076b351b0f5611a486ca6840d6864 Mon Sep 17 00:00:00 2001 From: scosman Date: Fri, 29 Mar 2024 00:30:25 +0000 Subject: [PATCH 34/68] cmd/gomobile: add CFBundleShortVersionString and CFBundleVersion, fixing Apple validation/distribution 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). Fixes golang/go#66500 Change-Id: I2e0718247301ec7db36f8d85aea81b203ca7848b GitHub-Last-Rev: 1455c5e8165eecca82a5ab96d7d0c31b36607f7a GitHub-Pull-Request: golang/mobile#100 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/575115 Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Auto-Submit: Dmitri Shuralyov Reviewed-by: Hajime Hoshi Reviewed-by: Than McIntosh --- cmd/gomobile/bind_iosapp.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/gomobile/bind_iosapp.go b/cmd/gomobile/bind_iosapp.go index e8ebcc770..9a3e52169 100644 --- a/cmd/gomobile/bind_iosapp.go +++ b/cmd/gomobile/bind_iosapp.go @@ -15,6 +15,7 @@ import ( "strconv" "strings" "text/template" + "time" "golang.org/x/sync/errgroup" "golang.org/x/tools/go/packages" @@ -233,9 +234,11 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo) return err } err = writeFile(filepath.Join(frameworkInfoPlistDir, "Info.plist"), func(w io.Writer) error { + fmVersion := fmt.Sprintf("0.0.%d", time.Now().Unix()) infoFrameworkPlistlData := infoFrameworkPlistlData{ BundleID: escapePlistValue(rfc1034Label(title)), ExecutableName: escapePlistValue(title), + Version: escapePlistValue(fmVersion), } infoplist := new(bytes.Buffer) if err := infoFrameworkPlistTmpl.Execute(infoplist, infoFrameworkPlistlData); err != nil { @@ -333,6 +336,7 @@ func frameworkLayoutForTarget(t targetInfo, title string) (*frameworkLayout, err type infoFrameworkPlistlData struct { BundleID string ExecutableName string + Version string } // infoFrameworkPlistTmpl is a template for the Info.plist file in a framework. @@ -348,6 +352,10 @@ var infoFrameworkPlistTmpl = template.Must(template.New("infoFrameworkPlist").Pa {{.BundleID}} MinimumOSVersion 100.0 + CFBundleShortVersionString + {{.Version}} + CFBundleVersion + {{.Version}} CFBundlePackageType FMWK From 755f4ef71bbd9f9bd4cc123148409d88a25a2187 Mon Sep 17 00:00:00 2001 From: Sander Bruens Date: Fri, 16 Feb 2024 11:53:42 -0500 Subject: [PATCH 35/68] cmd/gomobile: fix error message to reflect current build target Change-Id: I94b7d1c7029102c252a77f75929066281040b9f2 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/564856 LUCI-TryBot-Result: Go LUCI Reviewed-by: Emmanuel Odeke Reviewed-by: Hyang-Ah Hana Kim Auto-Submit: Hyang-Ah Hana Kim --- cmd/gomobile/build.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gomobile/build.go b/cmd/gomobile/build.go index c9483434d..f8895eb31 100644 --- a/cmd/gomobile/build.go +++ b/cmd/gomobile/build.go @@ -160,7 +160,7 @@ func runBuildImpl(cmd *command) (*packages.Package, error) { return pkg, nil } if buildBundleID == "" { - return nil, fmt.Errorf("-target=ios requires -bundleid set") + return nil, fmt.Errorf("-target=%s requires -bundleid set", buildTarget) } nmpkgs, err = goAppleBuild(pkg, buildBundleID, targets) if err != nil { From 09dbf07665ed261ce09d387a5a9aea3e9c29069c Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Thu, 4 Apr 2024 22:17:56 +0000 Subject: [PATCH 36/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: Ie35799c1d449abe67ebd57c89c0d586eae5cfc02 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/576638 Auto-Submit: Gopher Robot LUCI-TryBot-Result: Go LUCI Reviewed-by: Than McIntosh Reviewed-by: Dmitri Shuralyov --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 1af8e5dca..033e1fe96 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 golang.org/x/image v0.15.0 - golang.org/x/mod v0.16.0 - golang.org/x/sync v0.6.0 - golang.org/x/tools v0.19.0 + golang.org/x/mod v0.17.0 + golang.org/x/sync v0.7.0 + golang.org/x/tools v0.20.0 ) -require golang.org/x/sys v0.18.0 // indirect +require golang.org/x/sys v0.19.0 // indirect diff --git a/go.sum b/go.sum index a7475d851..c4c8b2e5b 100644 --- a/go.sum +++ b/go.sum @@ -2,11 +2,11 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1 golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8= golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= -golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= -golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= From a1a533f289d32c6297d63bfdc30e42c80b5a1f55 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Mon, 6 May 2024 17:52:11 +0000 Subject: [PATCH 37/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I573cd0cd9833927ef61b0c23fe30dc9140dd5696 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/583595 Auto-Submit: Gopher Robot Reviewed-by: Dmitri Shuralyov Reviewed-by: Than McIntosh LUCI-TryBot-Result: Go LUCI --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 033e1fe96..5affd088d 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.15.0 + golang.org/x/image v0.16.0 golang.org/x/mod v0.17.0 golang.org/x/sync v0.7.0 - golang.org/x/tools v0.20.0 + golang.org/x/tools v0.21.0 ) -require golang.org/x/sys v0.19.0 // indirect +require golang.org/x/sys v0.20.0 // indirect diff --git a/go.sum b/go.sum index c4c8b2e5b..1a91fae92 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,12 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8= -golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= +golang.org/x/image v0.16.0 h1:9kloLAKhUufZhA12l5fwnx2NZW39/we1UhBesW433jw= +golang.org/x/image v0.16.0/go.mod h1:ugSZItdV4nOxyqp56HmXwH0Ry0nBCpjnZdpDaIHdoPs= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= -golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= From fa72addaaa1b12cbfbf3a6fb1a1d5e54a44ee017 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 18 May 2024 16:37:25 +0900 Subject: [PATCH 38/68] all: replace ALooper_pollAll with ALooper_pollOnce ALooper_pollAll is no longer available as of Android SDK 34. Fixes golang/go#67496 Change-Id: I1f781ef70d569df50d3059ce355a2f7d1edb435a Reviewed-on: https://go-review.googlesource.com/c/mobile/+/586595 Run-TryBot: Hajime Hoshi LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot Reviewed-by: Dmitri Shuralyov Reviewed-by: Hyang-Ah Hana Kim Auto-Submit: Hajime Hoshi --- app/android.go | 2 +- exp/sensor/android.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/android.go b/app/android.go index ebbd4b509..5ee5605e4 100644 --- a/app/android.go +++ b/app/android.go @@ -365,7 +365,7 @@ func runInputQueue(vm, jniEnv, ctx uintptr) error { var q *C.AInputQueue for { - if C.ALooper_pollAll(-1, nil, nil, nil) == C.ALOOPER_POLL_WAKE { + if C.ALooper_pollOnce(-1, nil, nil, nil) == C.ALOOPER_POLL_WAKE { select { default: case p := <-pending: diff --git a/exp/sensor/android.c b/exp/sensor/android.c index 1ac722351..1cf934014 100644 --- a/exp/sensor/android.c +++ b/exp/sensor/android.c @@ -61,7 +61,7 @@ int GoAndroid_readQueue(int n, int32_t* types, int64_t* timestamps, float* vecto // Try n times read from the event queue. // If anytime timeout occurs, don't retry to read and immediately return. // Consume the event queue entirely between polls. - while (i < n && (id = ALooper_pollAll(GO_ANDROID_READ_TIMEOUT_MS, NULL, &events, NULL)) >= 0) { + while (i < n && (id = ALooper_pollOnce(GO_ANDROID_READ_TIMEOUT_MS, NULL, &events, NULL)) >= 0) { if (id != GO_ANDROID_SENSOR_LOOPER_ID) { continue; } From 2782386b8afd99b366f5d2b5738af9f2c82273a5 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Tue, 4 Jun 2024 18:46:36 +0000 Subject: [PATCH 39/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I8374c5df7d1cade76e1898b1d6377edd8c26537a Reviewed-on: https://go-review.googlesource.com/c/mobile/+/590455 Auto-Submit: Gopher Robot Reviewed-by: Dmitri Shuralyov Reviewed-by: Michael Knyszek LUCI-TryBot-Result: Go LUCI --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 5affd088d..b63212b84 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.16.0 - golang.org/x/mod v0.17.0 + golang.org/x/image v0.17.0 + golang.org/x/mod v0.18.0 golang.org/x/sync v0.7.0 - golang.org/x/tools v0.21.0 + golang.org/x/tools v0.22.0 ) -require golang.org/x/sys v0.20.0 // indirect +require golang.org/x/sys v0.21.0 // indirect diff --git a/go.sum b/go.sum index 1a91fae92..ed74aec4e 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,12 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.16.0 h1:9kloLAKhUufZhA12l5fwnx2NZW39/we1UhBesW433jw= -golang.org/x/image v0.16.0/go.mod h1:ugSZItdV4nOxyqp56HmXwH0Ry0nBCpjnZdpDaIHdoPs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/image v0.17.0 h1:nTRVVdajgB8zCMZVsViyzhnMKPwYeroEERRC64JuLco= +golang.org/x/image v0.17.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= -golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= From b765e5d5218fbc6a3fdae18e37d389b14b2904aa Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Sun, 7 Jul 2024 20:31:24 +0000 Subject: [PATCH 40/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I86ba44822d818d83ac6f24d3456b12a37a974dda Reviewed-on: https://go-review.googlesource.com/c/mobile/+/596996 Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Reviewed-by: Than McIntosh Auto-Submit: Gopher Robot --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index b63212b84..7cf4a8b22 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.17.0 - golang.org/x/mod v0.18.0 + golang.org/x/image v0.18.0 + golang.org/x/mod v0.19.0 golang.org/x/sync v0.7.0 - golang.org/x/tools v0.22.0 + golang.org/x/tools v0.23.0 ) -require golang.org/x/sys v0.21.0 // indirect +require golang.org/x/sys v0.22.0 // indirect diff --git a/go.sum b/go.sum index ed74aec4e..a28ac815e 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,12 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.17.0 h1:nTRVVdajgB8zCMZVsViyzhnMKPwYeroEERRC64JuLco= -golang.org/x/image v0.17.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ= +golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= From 1ad2df20a8b68aaaeb8a16bb2815d476837050a8 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 16 Jul 2024 11:35:21 -0400 Subject: [PATCH 41/68] LICENSE: update per Google Legal Very minor tweaks: - Remove (c) pseudosymbol. - Remove "All Rights Reserved." - Change "Google Inc." (no longer exists) to "Google LLC". [git-generate] echo ' ,s/\(c\) // ,s/ All rights reserved.// ,s/Google Inc./Google LLC/ w q ' | sam -d LICENSE Change-Id: Ib9d60f53433c8e92a0968c2b6d920876b5f7e7e9 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/598523 LUCI-TryBot-Result: Go LUCI Auto-Submit: Russ Cox Reviewed-by: Ian Lance Taylor --- LICENSE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 6a66aea5e..2a7cf70da 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. From 81131f6468ab9df03bc2b539cac4cf99d79f2447 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Tue, 6 Aug 2024 20:01:20 +0000 Subject: [PATCH 42/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: Id31b88c1c74c05ce63204c3a833ef554ec296112 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/603616 LUCI-TryBot-Result: Go LUCI Auto-Submit: Gopher Robot Reviewed-by: Dmitri Shuralyov Reviewed-by: David Chase --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 7cf4a8b22..d273059ac 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.18 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.18.0 - golang.org/x/mod v0.19.0 - golang.org/x/sync v0.7.0 - golang.org/x/tools v0.23.0 + golang.org/x/image v0.19.0 + golang.org/x/mod v0.20.0 + golang.org/x/sync v0.8.0 + golang.org/x/tools v0.24.0 ) -require golang.org/x/sys v0.22.0 // indirect +require golang.org/x/sys v0.23.0 // indirect diff --git a/go.sum b/go.sum index a28ac815e..588cf916e 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,12 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ= -golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= -golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= +golang.org/x/image v0.19.0 h1:D9FX4QWkLfkeqaC62SonffIIuYdOk/UE2XKUBgRIBIQ= +golang.org/x/image v0.19.0/go.mod h1:y0zrRqlQRWQ5PXaYCOMLTW2fpsxZ8Qh9I/ohnInJEys= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= From 7c4916698cc93475ebfea76748ee0faba2deb2a5 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Wed, 4 Sep 2024 19:26:21 -0400 Subject: [PATCH 43/68] all: fix printf(var) mistakes detected by latest printf checker There's some similarity here to the situation in CL 610676. The calls that now look like g.Printf("%s", something) would perhaps be better expressed like g.Print(something) or g.WriteString(something), but that's a bigger potential change to consider. This is a minimal fix. For golang/go#69267. Change-Id: I9cf23aef7bf2b9d9c7e9dcf3b48ecb23231016dd Reviewed-on: https://go-review.googlesource.com/c/mobile/+/610800 Reviewed-by: Tim King Reviewed-by: Dmitri Shuralyov Reviewed-by: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Auto-Submit: Dmitri Shuralyov --- bind/genclasses.go | 8 ++++---- bind/gengo.go | 2 +- bind/genjava.go | 18 +++++++++--------- bind/genobjc.go | 2 +- bind/genobjcw.go | 10 ++++------ internal/binres/binres_test.go | 5 +++-- 6 files changed, 22 insertions(+), 23 deletions(-) diff --git a/bind/genclasses.go b/bind/genclasses.go index 8746ab27e..a69d02b36 100644 --- a/bind/genclasses.go +++ b/bind/genclasses.go @@ -381,7 +381,7 @@ func (g *ClassGen) genCMethodBody(cls *java.Class, f *java.Func, virtual bool) { g.Printf("Nonvirtual") } if f.Ret != nil { - g.Printf(f.Ret.JNICallType()) + g.Printf("%s", f.Ret.JNICallType()) } else { g.Printf("Void") } @@ -430,7 +430,7 @@ func (g *ClassGen) genFuncDecl(local bool, fs *java.FuncSet) { if i == len(fs.Params)-1 && fs.Variadic { g.Printf("...") } - g.Printf(g.goType(a, local)) + g.Printf("%s", g.goType(a, local)) } g.Printf(")") if fs.Throws { @@ -879,7 +879,7 @@ func (g *ClassGen) genInterface(cls *java.Class) { if !g.isFuncSetSupported(fs) { continue } - g.Printf(fs.GoName) + g.Printf("%s", fs.GoName) g.genFuncDecl(true, fs) g.Printf("\n") } @@ -904,7 +904,7 @@ func flattenName(n string) string { return strings.Replace(strings.Replace(n, ".", "_", -1), "$", "_", -1) } -var ( +const ( classesPkgHeader = gobindPreamble + ` package Java diff --git a/bind/gengo.go b/bind/gengo.go index 8087c7ad2..bb3634e4f 100644 --- a/bind/gengo.go +++ b/bind/gengo.go @@ -341,7 +341,7 @@ func (g *goGen) genInterface(obj *types.TypeName) { g.Printf(") ") if res.Len() == 1 { - g.Printf(g.typeString(res.At(0).Type())) + g.Printf("%s", g.typeString(res.At(0).Type())) } else if res.Len() == 2 { g.Printf("(%s, error)", g.typeString(res.At(0).Type())) } diff --git a/bind/genjava.go b/bind/genjava.go index b197640aa..f1852a2bc 100644 --- a/bind/genjava.go +++ b/bind/genjava.go @@ -437,7 +437,7 @@ func (g *JavaGen) genConstructor(f *types.Func, n string, jcls bool) { if i > 0 { g.Printf(", ") } - g.Printf(g.paramName(params, i)) + g.Printf("%s", g.paramName(params, i)) } g.Printf(");\n") } @@ -447,7 +447,7 @@ func (g *JavaGen) genConstructor(f *types.Func, n string, jcls bool) { if i > 0 { g.Printf(", ") } - g.Printf(g.paramName(params, i)) + g.Printf("%s", g.paramName(params, i)) } g.Printf(");\n") g.Printf("Seq.trackGoRef(refnum, this);\n") @@ -757,21 +757,21 @@ func (g *JavaGen) genJNIFuncSignature(o *types.Func, sName string, jm *java.Func g.Printf("Java_%s_", g.jniPkgName()) if sName != "" { if proxy { - g.Printf(java.JNIMangle(g.className())) + g.Printf("%s", java.JNIMangle(g.className())) // 0024 is the mangled form of $, for naming inner classes. g.Printf("_00024proxy%s", sName) } else { - g.Printf(java.JNIMangle(g.javaTypeName(sName))) + g.Printf("%s", java.JNIMangle(g.javaTypeName(sName))) } } else { - g.Printf(java.JNIMangle(g.className())) + g.Printf("%s", java.JNIMangle(g.className())) } g.Printf("_") if jm != nil { - g.Printf(jm.JNIName) + g.Printf("%s", jm.JNIName) } else { oName := javaNameReplacer(lowerFirst(o.Name())) - g.Printf(java.JNIMangle(oName)) + g.Printf("%s", java.JNIMangle(oName)) } g.Printf("(JNIEnv* env, ") if sName != "" { @@ -839,9 +839,9 @@ func (g *JavaGen) genFuncSignature(o *types.Func, jm *java.Func, hasThis bool) { g.Printf("%s ", ret) if jm != nil { - g.Printf(jm.Name) + g.Printf("%s", jm.Name) } else { - g.Printf(javaNameReplacer(lowerFirst(o.Name()))) + g.Printf("%s", javaNameReplacer(lowerFirst(o.Name()))) } g.Printf("(") g.genFuncArgs(o, jm, hasThis) diff --git a/bind/genobjc.go b/bind/genobjc.go index d5914138a..b556212a4 100644 --- a/bind/genobjc.go +++ b/bind/genobjc.go @@ -1060,7 +1060,7 @@ func (g *ObjcGen) genStructH(obj *types.TypeName, t *types.Struct) { if oinf != nil { for _, sup := range oinf.supers { if !sup.Protocol { - g.Printf(sup.Name) + g.Printf("%s", sup.Name) } else { prots = append(prots, sup.Name) } diff --git a/bind/genobjcw.go b/bind/genobjcw.go index 1f5ccf63f..731f1ae51 100644 --- a/bind/genobjcw.go +++ b/bind/genobjcw.go @@ -286,14 +286,13 @@ func (g *ObjcWrapper) genCFuncDecl(prefix, name string, f *objc.Func) { case ret != nil && returnsErr: g.Printf("ret_%s", strings.Replace(g.cType(ret), " ", "_", -1)) case ret != nil: - g.Printf(g.cType(ret)) + g.Printf("%s", g.cType(ret)) case returnsErr: g.Printf("int") default: g.Printf("void") } - g.Printf(" ") - g.Printf(prefix) + g.Printf(" %s", prefix) if f.Static { g.Printf("_s") } @@ -397,8 +396,7 @@ func (g *ObjcWrapper) genFuncBody(n *objc.Named, f *objc.Func, prefix string) { if ret != nil || errParam != nil { g.Printf("res := ") } - g.Printf("C.") - g.Printf(prefix) + g.Printf("C.%s", prefix) if f.Static { g.Printf("_s") } @@ -575,7 +573,7 @@ func (g *ObjcWrapper) genInterface(n *objc.Named) { if !g.isFuncSupported(f) { continue } - g.Printf(f.GoName) + g.Printf("%s", f.GoName) g.genFuncDecl(true, f) g.Printf("\n") } diff --git a/internal/binres/binres_test.go b/internal/binres/binres_test.go index dbac875a1..7e4f214c8 100644 --- a/internal/binres/binres_test.go +++ b/internal/binres/binres_test.go @@ -8,6 +8,7 @@ import ( "bytes" "encoding" "encoding/xml" + "errors" "fmt" "io/ioutil" "log" @@ -103,7 +104,7 @@ func compareBytes(a, b []byte) error { fmt.Fprint(buf, "... output truncated.\n") } } - return fmt.Errorf(buf.String()) + return errors.New(buf.String()) } func TestBootstrap(t *testing.T) { @@ -329,7 +330,7 @@ func compareElements(have, want *XML) error { } } if buf.Len() > 0 { - return fmt.Errorf(buf.String()) + return errors.New(buf.String()) } return nil } From 642950227fb3dd9e9ec517d7630b10397f1d5e01 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Mon, 9 Sep 2024 15:51:57 +0000 Subject: [PATCH 44/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I47a97af459b0151af8af9df1bed5ee25312579a9 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/611936 Reviewed-by: Dmitri Shuralyov Reviewed-by: David Chase TryBot-Bypass: Dmitri Shuralyov Auto-Submit: Gopher Robot --- go.mod | 10 +++++----- go.sum | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index d273059ac..2c5f05647 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,13 @@ module golang.org/x/mobile -go 1.18 +go 1.22.0 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.19.0 - golang.org/x/mod v0.20.0 + golang.org/x/image v0.20.0 + golang.org/x/mod v0.21.0 golang.org/x/sync v0.8.0 - golang.org/x/tools v0.24.0 + golang.org/x/tools v0.25.0 ) -require golang.org/x/sys v0.23.0 // indirect +require golang.org/x/sys v0.25.0 // indirect diff --git a/go.sum b/go.sum index 588cf916e..58acbec3a 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,12 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.19.0 h1:D9FX4QWkLfkeqaC62SonffIIuYdOk/UE2XKUBgRIBIQ= -golang.org/x/image v0.19.0/go.mod h1:y0zrRqlQRWQ5PXaYCOMLTW2fpsxZ8Qh9I/ohnInJEys= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/image v0.20.0 h1:7cVCUjQwfL18gyBJOmYvptfSHS8Fb3YUDtfLIZ7Nbpw= +golang.org/x/image v0.20.0/go.mod h1:0a88To4CYVBAHp5FXJm8o7QbUl37Vd85ply1vyD8auM= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= From c6794c95c70b02ddb1a79d92fec29f8b8ddd8836 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 30 Sep 2024 21:51:57 +0900 Subject: [PATCH 45/68] asset: do not use 'assets' directory for iOS The iOS implementation was just copied from the desktop version, and had and extra directory 'assets'. Also, files had an incorrect assumption that Arm Darwin should be an iOS. This change addresses these issues. Fixes golang/go#37177 Change-Id: I8e4de5337fbbe0b7697a8d519c8bded783399244 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/616655 Reviewed-by: Dmitri Shuralyov Auto-Submit: Hyang-Ah Hana Kim Reviewed-by: Hyang-Ah Hana Kim Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI --- asset/asset_darwin_armx.go | 23 ----------------------- asset/asset_desktop.go | 2 +- asset/asset_ios.go | 13 +++++++++++++ 3 files changed, 14 insertions(+), 24 deletions(-) delete mode 100644 asset/asset_darwin_armx.go create mode 100644 asset/asset_ios.go diff --git a/asset/asset_darwin_armx.go b/asset/asset_darwin_armx.go deleted file mode 100644 index e3b3b5a13..000000000 --- a/asset/asset_darwin_armx.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build darwin && (arm || arm64) - -package asset - -import ( - "os" - "path/filepath" -) - -func openAsset(name string) (File, error) { - if !filepath.IsAbs(name) { - name = filepath.Join("assets", name) - } - f, err := os.Open(name) - if err != nil { - return nil, err - } - return f, nil -} diff --git a/asset/asset_desktop.go b/asset/asset_desktop.go index af7c45f82..1c3805627 100644 --- a/asset/asset_desktop.go +++ b/asset/asset_desktop.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (linux && !android) || (darwin && !arm && !arm64) || windows +//go:build (linux && !android) || (darwin && !ios) || windows package asset diff --git a/asset/asset_ios.go b/asset/asset_ios.go new file mode 100644 index 000000000..4b7b37f4e --- /dev/null +++ b/asset/asset_ios.go @@ -0,0 +1,13 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package asset + +import ( + "os" +) + +func openAsset(name string) (File, error) { + return os.Open(name) +} From 08a83c5af9f8c7088ee059144335eec7fbbdb32c Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Fri, 4 Oct 2024 18:26:02 +0000 Subject: [PATCH 46/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: Ieee46df13d96ef0bc2be98e40f38f58c73131bcc Reviewed-on: https://go-review.googlesource.com/c/mobile/+/617960 Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Auto-Submit: Gopher Robot Reviewed-by: David Chase --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 2c5f05647..76a7d8194 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.22.0 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.20.0 + golang.org/x/image v0.21.0 golang.org/x/mod v0.21.0 golang.org/x/sync v0.8.0 - golang.org/x/tools v0.25.0 + golang.org/x/tools v0.26.0 ) -require golang.org/x/sys v0.25.0 // indirect +require golang.org/x/sys v0.26.0 // indirect diff --git a/go.sum b/go.sum index 58acbec3a..2e81dca14 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,12 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.20.0 h1:7cVCUjQwfL18gyBJOmYvptfSHS8Fb3YUDtfLIZ7Nbpw= -golang.org/x/image v0.20.0/go.mod h1:0a88To4CYVBAHp5FXJm8o7QbUl37Vd85ply1vyD8auM= +golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s= +golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78= golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= -golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= From 7ff83004ec2c864311acb5f558c65f372f05a25d Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 15 Oct 2024 17:38:47 +0900 Subject: [PATCH 47/68] cmd/gomobile: use Output instead of CombinedOutput at envClang 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. Fixes golang/go#53316 Change-Id: Ia2c518c44c0003b4f9b50dba85fb971c2ef4340d Reviewed-on: https://go-review.googlesource.com/c/mobile/+/620315 Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov Reviewed-by: Michael Knyszek --- cmd/gomobile/env.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/gomobile/env.go b/cmd/gomobile/env.go index 43f24b99d..082d76951 100644 --- a/cmd/gomobile/env.go +++ b/cmd/gomobile/env.go @@ -436,15 +436,21 @@ func envClang(sdkName string) (clang, cflags string, err error) { return sdkName + "-clang", "-isysroot " + sdkName, nil } cmd := exec.Command("xcrun", "--sdk", sdkName, "--find", "clang") - out, err := cmd.CombinedOutput() + out, err := cmd.Output() if err != nil { + if ee := (*exec.ExitError)(nil); errors.As(err, &ee) { + out = append(out, ee.Stderr...) + } return "", "", fmt.Errorf("xcrun --find: %v\n%s", err, out) } clang = strings.TrimSpace(string(out)) cmd = exec.Command("xcrun", "--sdk", sdkName, "--show-sdk-path") - out, err = cmd.CombinedOutput() + out, err = cmd.Output() if err != nil { + if ee := (*exec.ExitError)(nil); errors.As(err, &ee) { + out = append(out, ee.Stderr...) + } return "", "", fmt.Errorf("xcrun --show-sdk-path: %v\n%s", err, out) } sdk := strings.TrimSpace(string(out)) From 2b9d635e74e54c8475b1a0452de0ba0a7a3bc08c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 5 Nov 2024 11:33:30 -0800 Subject: [PATCH 48/68] README: mention the git repo Change-Id: Id01077e4708b481e42b5aab6a34c25d6e34d1fe0 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/625397 Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor Reviewed-by: Hyang-Ah Hana Kim Commit-Queue: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 48253c6af..5e5a02528 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,11 @@ and the [bind](https://golang.org/x/mobile/example/bind) example apps. -- -Contributions to Go are appreciated. See https://golang.org/doc/contribute.html. +Contributions to Go are appreciated. See https://go.dev/doc/contribute. -* Bugs can be filed at the [Go issue tracker](https://golang.org/issue/new?title=x/mobile:+). +The git repository is https://go.googlesource.com/mobile. + +* Bugs can be filed at the [Go issue tracker](https://go.dev/issue/new?title=x/mobile:+). * Feature requests should preliminary be discussed on [golang-nuts](https://groups.google.com/forum/#!forum/golang-nuts) mailing list. From cee99c0f96fe2002e8a7c606904ece3a1d61ebd6 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Fri, 8 Nov 2024 13:13:23 -0500 Subject: [PATCH 49/68] example/ivy: use tools build constraint in tools.go In modern versions of the go command, the go mod tidy command doesn't consider module requirements coming from files with an "ignore" build constraint. Use "tools" instead. This way, running go mod tidy on this module becomes a no-op, instead of deleting all of the requirements from go.mod and go.sum. Change-Id: I42a24c462acf7340410614fa3b0dd80608efcdaa Reviewed-on: https://go-review.googlesource.com/c/mobile/+/626655 Reviewed-by: David Chase Reviewed-by: Dmitri Shuralyov Auto-Submit: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI --- example/ivy/tools.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/ivy/tools.go b/example/ivy/tools.go index ab067c246..de6105c52 100644 --- a/example/ivy/tools.go +++ b/example/ivy/tools.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build ignore +//go:build tools package dummy From fa514ef75a0ffd7d89e1b4c9b45485f7bb39cf83 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Fri, 8 Nov 2024 17:25:57 +0000 Subject: [PATCH 50/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I088f0acac42498a4148da7e98ace3a823be94ffe Reviewed-on: https://go-review.googlesource.com/c/mobile/+/626595 LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase Auto-Submit: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 76a7d8194..234c36712 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.22.0 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.21.0 - golang.org/x/mod v0.21.0 - golang.org/x/sync v0.8.0 - golang.org/x/tools v0.26.0 + golang.org/x/image v0.22.0 + golang.org/x/mod v0.22.0 + golang.org/x/sync v0.9.0 + golang.org/x/tools v0.27.0 ) -require golang.org/x/sys v0.26.0 // indirect +require golang.org/x/sys v0.27.0 // indirect diff --git a/go.sum b/go.sum index 2e81dca14..b892031ad 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,12 @@ golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s= -golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78= -golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= -golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= -golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= +golang.org/x/image v0.22.0 h1:UtK5yLUzilVrkjMAZAZ34DXGpASN8i8pj8g+O+yd10g= +golang.org/x/image v0.22.0/go.mod h1:9hPFhljd4zZ1GNSIZJ49sqbp45GKK9t6w+iXvGqZUz4= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= +golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= From ce44b2716d33505bd9e00bc3b17295042361e049 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Wed, 4 Dec 2024 23:09:52 +0000 Subject: [PATCH 51/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: Ia4e7f4bf74f5d06295bd5fccd8542940796022ee Reviewed-on: https://go-review.googlesource.com/c/mobile/+/633588 LUCI-TryBot-Result: Go LUCI Auto-Submit: Gopher Robot Reviewed-by: Dmitri Shuralyov Reviewed-by: David Chase --- go.mod | 8 ++++---- go.sum | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 234c36712..640c297c2 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.22.0 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.22.0 + golang.org/x/image v0.23.0 golang.org/x/mod v0.22.0 - golang.org/x/sync v0.9.0 - golang.org/x/tools v0.27.0 + golang.org/x/sync v0.10.0 + golang.org/x/tools v0.28.0 ) -require golang.org/x/sys v0.27.0 // indirect +require golang.org/x/sys v0.28.0 // indirect diff --git a/go.sum b/go.sum index b892031ad..8faf4f944 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,14 @@ +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.22.0 h1:UtK5yLUzilVrkjMAZAZ34DXGpASN8i8pj8g+O+yd10g= -golang.org/x/image v0.22.0/go.mod h1:9hPFhljd4zZ1GNSIZJ49sqbp45GKK9t6w+iXvGqZUz4= +golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68= +golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= From a87c1cf6cf463f0d4476cfe0fcf67c2953d76e7c Mon Sep 17 00:00:00 2001 From: "Hana (Hyang-Ah) Kim" Date: Wed, 11 Dec 2024 17:23:16 -0500 Subject: [PATCH 52/68] cmd/gomobile: work around for corrupted build on Mac Catalyst The problem was observed after Go 1.18. x/mobile requires go1.22.0+. Patch from https://github.com/stffabi/go-mobile/commit/e31230fb8e5d45adb0be5b69854b6b9bafb8151f For golang/go#52299 Co-authored-by: stffabi Change-Id: I856c68f60ad7c45acf4ae550a1e66747ef7719db Reviewed-on: https://go-review.googlesource.com/c/mobile/+/635342 Auto-Submit: Hyang-Ah Hana Kim LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor --- cmd/gomobile/env.go | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/cmd/gomobile/env.go b/cmd/gomobile/env.go index 082d76951..e9fd5dcc7 100644 --- a/cmd/gomobile/env.go +++ b/cmd/gomobile/env.go @@ -63,9 +63,11 @@ func platformOS(platform string) string { case "macos", "maccatalyst": // For "maccatalyst", Go packages should be built with GOOS=darwin, // not GOOS=ios, since the underlying OS (and kernel, runtime) is macOS. + // But, using GOOS=darwin with build-tag ios leads to corrupt builds: https://go.dev/issue/52299 + // => So we use GOOS=ios for now. // We also apply a "macos" or "maccatalyst" build tag, respectively. // See below for additional context. - return "darwin" + return "ios" default: panic(fmt.Sprintf("unexpected platform: %s", platform)) } @@ -82,17 +84,17 @@ func platformTags(platform string) []string { case "maccatalyst": // Mac Catalyst is a subset of iOS APIs made available on macOS // designed to ease porting apps developed for iPad to macOS. - // See https://developer.apple.com/mac-catalyst/. - // Because of this, when building a Go package targeting maccatalyst, - // GOOS=darwin (not ios). To bridge the gap and enable maccatalyst - // packages to be compiled, we also specify the "ios" build tag. + // See + // https://developer.apple.com/mac-catalyst/. + // https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets/49560690#49560690 + // + // Historically gomobile used GOOS=darwin with build tag ios when + // targeting Mac Catalyst. However, this configuration is not officially + // supported and leads to corrupt builds after go1.18: https://go.dev/issues/52299 + // Use GOOS=ios. // To help discriminate between darwin, ios, macos, and maccatalyst // targets, there is also a "maccatalyst" tag. - // Some additional context on this can be found here: - // https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets/49560690#49560690 - // TODO(ydnar): remove tag "ios" when cgo supports Catalyst - // See golang.org/issues/47228 - return []string{"ios", "macos", "maccatalyst"} + return []string{"macos", "maccatalyst"} default: panic(fmt.Sprintf("unexpected platform: %s", platform)) } @@ -217,17 +219,11 @@ func envInit() (err error) { cflags += " -mios-simulator-version-min=" + buildIOSVersion cflags += " -fembed-bitcode" case "maccatalyst": - // Mac Catalyst is a subset of iOS APIs made available on macOS - // designed to ease porting apps developed for iPad to macOS. - // See https://developer.apple.com/mac-catalyst/. - // Because of this, when building a Go package targeting maccatalyst, - // GOOS=darwin (not ios). To bridge the gap and enable maccatalyst - // packages to be compiled, we also specify the "ios" build tag. - // To help discriminate between darwin, ios, macos, and maccatalyst - // targets, there is also a "maccatalyst" tag. - // Some additional context on this can be found here: - // https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets/49560690#49560690 - goos = "darwin" + // See the comment about maccatalyst's GOOS, build tags configuration + // in platformOS and platformTags. + // Using GOOS=darwin with build-tag ios leads to corrupt builds: https://go.dev/issue/52299 + // => So we use GOOS=ios for now. + goos = "ios" sdk = "macosx" clang, cflags, err = envClang(sdk) // TODO(ydnar): the following 3 lines MAY be needed to compile From 5e5de4c8566398af0cdd9ee4164eeded53b1c0b3 Mon Sep 17 00:00:00 2001 From: cuishuang Date: Wed, 1 Jan 2025 22:18:56 +0800 Subject: [PATCH 53/68] all: make function and struct comments match the names Change-Id: I26f303201caebbe159f2e79f577e8d05b325c6ee Reviewed-on: https://go-review.googlesource.com/c/mobile/+/639615 Reviewed-by: Jorropo Auto-Submit: Jorropo Auto-Submit: Ian Lance Taylor Reviewed-by: Hyang-Ah Hana Kim LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov --- gl/interface.go | 8 ++++---- gl/work.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gl/interface.go b/gl/interface.go index 189c29e4e..6ad9ff65f 100644 --- a/gl/interface.go +++ b/gl/interface.go @@ -81,7 +81,7 @@ type Context interface { // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendFunc.xhtml BlendFunc(sfactor, dfactor Enum) - // BlendFunc sets the pixel RGB and alpha blending factors separately. + // BlendFuncSeparate sets the pixel RGB and alpha blending factors separately. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendFuncSeparate.xhtml BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha Enum) @@ -192,7 +192,7 @@ type Context interface { // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenTextures.xhtml CreateTexture() Texture - // CreateTVertexArray creates a vertex array. + // CreateVertexArray creates a vertex array. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenVertexArrays.xhtml CreateVertexArray() VertexArray @@ -599,7 +599,7 @@ type Context interface { // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilFunc.xhtml StencilFunc(fn Enum, ref int, mask uint32) - // StencilFunc sets the front or back stencil test reference value. + // StencilFuncSeparate sets the front or back stencil test reference value. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilFuncSeparate.xhtml StencilFuncSeparate(face, fn Enum, ref int, mask uint32) @@ -737,7 +737,7 @@ type Context interface { // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml Uniform4i(dst Uniform, v0, v1, v2, v3 int32) - // Uniform4i writes an ivec4 uniform array of len(src)/4 elements. + // Uniform4iv writes an ivec4 uniform array of len(src)/4 elements. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml Uniform4iv(dst Uniform, src []int32) diff --git a/gl/work.go b/gl/work.go index c603adfe6..a778b0c52 100644 --- a/gl/work.go +++ b/gl/work.go @@ -160,7 +160,7 @@ func (ctx *context) cString(str string) (uintptr, func()) { return uintptr(ptr), func() { C.free(ptr) } } -// cString creates a pointer to a C string off the Go heap. +// cStringPtr creates a pointer to a C string off the Go heap. // ret is a **char. func (ctx *context) cStringPtr(str string) (uintptr, func()) { s, free := ctx.cString(str) From c31d5b91ecc32c0d598b8fe8457d244ca0b4e815 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Mon, 6 Jan 2025 10:08:18 -0800 Subject: [PATCH 54/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: Idf8f21610ad2aa7b52f54849dcc920a1990c6407 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/640697 Reviewed-by: Dmitri Shuralyov Reviewed-by: David Chase Auto-Submit: Gopher Robot LUCI-TryBot-Result: Go LUCI --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 640c297c2..91f3e8f77 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( golang.org/x/image v0.23.0 golang.org/x/mod v0.22.0 golang.org/x/sync v0.10.0 - golang.org/x/tools v0.28.0 + golang.org/x/tools v0.29.0 ) -require golang.org/x/sys v0.28.0 // indirect +require golang.org/x/sys v0.29.0 // indirect diff --git a/go.sum b/go.sum index 8faf4f944..a45638ecb 100644 --- a/go.sum +++ b/go.sum @@ -8,7 +8,7 @@ golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= -golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= +golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= From b38b8813d6076f4e4ff25d71ee2c45f051a3a0cb Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Mon, 10 Feb 2025 10:28:08 -0800 Subject: [PATCH 55/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I4ec34da0a0903d47fc2b25a116fef256d63f8f1f Reviewed-on: https://go-review.googlesource.com/c/mobile/+/648176 LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase Auto-Submit: Gopher Robot Reviewed-by: Dmitri Shuralyov --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 91f3e8f77..ff1959ab5 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.22.0 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.23.0 - golang.org/x/mod v0.22.0 - golang.org/x/sync v0.10.0 - golang.org/x/tools v0.29.0 + golang.org/x/image v0.24.0 + golang.org/x/mod v0.23.0 + golang.org/x/sync v0.11.0 + golang.org/x/tools v0.30.0 ) -require golang.org/x/sys v0.29.0 // indirect +require golang.org/x/sys v0.30.0 // indirect diff --git a/go.sum b/go.sum index a45638ecb..31424023e 100644 --- a/go.sum +++ b/go.sum @@ -2,13 +2,13 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68= -golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY= -golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= -golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= -golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= +golang.org/x/image v0.24.0 h1:AN7zRgVsbvmTfNyqIbbOraYL8mSwcKncEj8ofjgzcMQ= +golang.org/x/image v0.24.0/go.mod h1:4b/ITuLfqYq1hqZcjofwctIhi7sZh2WaCjvsBNjjya8= +golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= +golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= +golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= From ba142f8e7d3c04ffd3a1c19500840f7be8bb742b Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Sat, 15 Feb 2025 18:44:12 -0500 Subject: [PATCH 56/68] bind: pin go/types to not produce types.Alias types Bind currently targets the earlier go/types semantics (gotypesalias=0), and needs to be updated to be compatible with the new (gotypesalias=1). This is the only way in which the module isn't compatible with Go 1.23 language semantics, so add an explicit godebug line for it with a TODO. This unblocks moving the module to Go 1.23 (as done in the next CL). For golang/go#70698. Change-Id: I59a61defdcf327aed9ccd67b123b1516cd118d9e Reviewed-on: https://go-review.googlesource.com/c/mobile/+/649381 LUCI-TryBot-Result: Go LUCI Reviewed-by: Hajime Hoshi Auto-Submit: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov Reviewed-by: Michael Knyszek --- go.mod | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/go.mod b/go.mod index ff1959ab5..db1d25bd6 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,19 @@ module golang.org/x/mobile go 1.22.0 +// The modern go/types type checker produces types.Alias +// types for the explicit representation of type aliases. +// (Initial opt-in support for it was added in Go 1.22, +// and it became the default behavior in Go 1.23.) +// +// TODO(go.dev/issue/70698): Update the golang.org/x/mobile/bind +// code generator for the new behavior and delete this temporary¹ +// forced pre-1.23 go/types behavior. +// +// ¹ It's temporary because this godebug setting will be removed +// in a future Go release. +godebug gotypesalias=0 + require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 golang.org/x/image v0.24.0 From 21e291c9c26e620157cc44792253ce737982a4c5 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Fri, 14 Feb 2025 21:11:39 +0000 Subject: [PATCH 57/68] all: upgrade go directive to at least 1.23.0 [generated] By now Go 1.24.0 has been released, and Go 1.22 is no longer supported per the Go Release Policy (https://go.dev/doc/devel/release#policy). For golang/go#69095. [git-generate] (cd example/ivy && go get go@1.23.0 && go mod tidy && go fix ./... && go mod edit -toolchain=none) (cd . && go get go@1.23.0 && go mod tidy && go fix ./... && go mod edit -toolchain=none) Change-Id: Icc4624c0ff649e040bef1b068e92b43fdb57c72e Reviewed-on: https://go-review.googlesource.com/c/mobile/+/649378 Reviewed-by: Cherry Mui Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Auto-Submit: Dmitri Shuralyov --- example/ivy/go.mod | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/ivy/go.mod b/example/ivy/go.mod index 884df3db7..7b4640ba4 100644 --- a/example/ivy/go.mod +++ b/example/ivy/go.mod @@ -1,6 +1,6 @@ module golang.org/x/mobile/example/ivy -go 1.17 +go 1.23.0 require ( golang.org/x/mobile v0.0.0-20210924032853-1c027f395ef7 diff --git a/go.mod b/go.mod index db1d25bd6..23b39fa82 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module golang.org/x/mobile -go 1.22.0 +go 1.23.0 // The modern go/types type checker produces types.Alias // types for the explicit representation of type aliases. From a8bae7367306ade4b4f4a8bd8a57579d89f2f6a0 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Sat, 15 Feb 2025 19:08:13 -0500 Subject: [PATCH 58/68] all: make copyright headers consistent The standard copyright header at https://go.dev/doc/contribute#copyright has a single space (also see CL 20022). Also, add it to a files where it was missed. Change-Id: I341ce5b5c455efa768b65597c387866e47a6757e Reviewed-on: https://go-review.googlesource.com/c/mobile/+/649382 Auto-Submit: Dmitri Shuralyov Reviewed-by: Hajime Hoshi LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek Reviewed-by: Dmitri Shuralyov --- bind/bind_test.go | 4 ++++ bind/testdata/basictypes.go | 2 +- bind/testdata/classes.go | 2 +- bind/testdata/customprefix.go | 2 +- bind/testdata/doc.go | 2 +- bind/testdata/ignore.go | 2 +- bind/testdata/interfaces.go | 2 +- bind/testdata/issue10788.go | 2 +- bind/testdata/issue12328.go | 2 +- bind/testdata/java.go | 2 +- bind/testdata/keywords.go | 2 +- bind/testdata/objc.go | 2 +- bind/testdata/objcw.go | 2 +- bind/testdata/structs.go | 2 +- bind/testdata/try.go | 2 +- cmd/gobind/doc.go | 2 +- cmd/gobind/gen.go | 2 +- cmd/gobind/gobind_test.go | 2 +- cmd/gobind/main.go | 2 +- cmd/gomobile/bind.go | 2 +- cmd/gomobile/bind_androidapp.go | 2 +- cmd/gomobile/bind_iosapp.go | 2 +- cmd/gomobile/bind_test.go | 2 +- cmd/gomobile/build.go | 2 +- cmd/gomobile/build_androidapp.go | 2 +- cmd/gomobile/build_apple.go | 2 +- cmd/gomobile/build_darwin_test.go | 2 +- cmd/gomobile/build_test.go | 2 +- cmd/gomobile/cert.go | 2 +- cmd/gomobile/cert_test.go | 2 +- cmd/gomobile/clean.go | 2 +- cmd/gomobile/dex.go | 2 +- cmd/gomobile/doc.go | 2 +- cmd/gomobile/env.go | 4 ++++ cmd/gomobile/env_test.go | 2 +- cmd/gomobile/gendex.go | 4 ++-- cmd/gomobile/init.go | 2 +- cmd/gomobile/init_test.go | 2 +- cmd/gomobile/install.go | 2 +- cmd/gomobile/main.go | 4 ++-- cmd/gomobile/manifest.go | 2 +- cmd/gomobile/strings_flag.go | 2 +- cmd/gomobile/version.go | 2 +- cmd/gomobile/writer.go | 2 +- cmd/gomobile/writer_test.go | 2 +- example/ivy/doc.go | 2 +- example/ivy/tools.go | 2 +- exp/f32/affine_test.go | 4 ++++ gl/consts.go | 2 +- gl/doc.go | 2 +- gl/fn.go | 2 +- gl/gendebug.go | 4 ++-- gl/gl.go | 2 +- gl/gldebug.go | 2 +- gl/interface.go | 2 +- gl/types_debug.go | 2 +- gl/types_prod.go | 2 +- internal/binres/arsc.go | 2 +- internal/binres/binres.go | 2 +- internal/binres/binres_test.go | 2 +- internal/binres/genarsc.go | 4 ++-- internal/binres/node.go | 2 +- internal/binres/pool.go | 2 +- internal/binres/sdk.go | 4 ++++ internal/binres/table.go | 2 +- internal/importers/ast.go | 2 +- internal/importers/ast_test.go | 4 ++++ internal/sdkpath/sdkpath.go | 2 +- 68 files changed, 87 insertions(+), 67 deletions(-) diff --git a/bind/bind_test.go b/bind/bind_test.go index fae951b31..af0973323 100644 --- a/bind/bind_test.go +++ b/bind/bind_test.go @@ -1,3 +1,7 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package bind import ( diff --git a/bind/testdata/basictypes.go b/bind/testdata/basictypes.go index 1fc02e63a..1ff804e4b 100644 --- a/bind/testdata/basictypes.go +++ b/bind/testdata/basictypes.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/classes.go b/bind/testdata/classes.go index 7263ac771..6d60349ca 100644 --- a/bind/testdata/classes.go +++ b/bind/testdata/classes.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/customprefix.go b/bind/testdata/customprefix.go index b3a0967bb..057f78514 100644 --- a/bind/testdata/customprefix.go +++ b/bind/testdata/customprefix.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/doc.go b/bind/testdata/doc.go index c17da8295..11125d0fb 100644 --- a/bind/testdata/doc.go +++ b/bind/testdata/doc.go @@ -1,4 +1,4 @@ -// Copyright 2016 The Go Authors. All rights reserved. +// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/ignore.go b/bind/testdata/ignore.go index 2d3e1a686..e8b8517a9 100644 --- a/bind/testdata/ignore.go +++ b/bind/testdata/ignore.go @@ -1,4 +1,4 @@ -// Copyright 2016 The Go Authors. All rights reserved. +// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/interfaces.go b/bind/testdata/interfaces.go index 9e2da3a34..c0e63bba6 100644 --- a/bind/testdata/interfaces.go +++ b/bind/testdata/interfaces.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/issue10788.go b/bind/testdata/issue10788.go index af487218e..d3ceb75bc 100644 --- a/bind/testdata/issue10788.go +++ b/bind/testdata/issue10788.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/issue12328.go b/bind/testdata/issue12328.go index 2b4ab887f..2dc5ee407 100644 --- a/bind/testdata/issue12328.go +++ b/bind/testdata/issue12328.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/java.go b/bind/testdata/java.go index 8550582ff..f37e0386c 100644 --- a/bind/testdata/java.go +++ b/bind/testdata/java.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/keywords.go b/bind/testdata/keywords.go index 6a04f0bdd..8a8808d92 100644 --- a/bind/testdata/keywords.go +++ b/bind/testdata/keywords.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/objc.go b/bind/testdata/objc.go index ca42fb95f..2d154c306 100644 --- a/bind/testdata/objc.go +++ b/bind/testdata/objc.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/objcw.go b/bind/testdata/objcw.go index dadfd93bc..353795b77 100644 --- a/bind/testdata/objcw.go +++ b/bind/testdata/objcw.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/structs.go b/bind/testdata/structs.go index 5974bdc36..53be1c747 100644 --- a/bind/testdata/structs.go +++ b/bind/testdata/structs.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/bind/testdata/try.go b/bind/testdata/try.go index 5d3d21787..8dff65295 100644 --- a/bind/testdata/try.go +++ b/bind/testdata/try.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gobind/doc.go b/cmd/gobind/doc.go index 0823d5d81..cffb0d8b5 100644 --- a/cmd/gobind/doc.go +++ b/cmd/gobind/doc.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gobind/gen.go b/cmd/gobind/gen.go index fedbc2705..87c72d9d2 100644 --- a/cmd/gobind/gen.go +++ b/cmd/gobind/gen.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gobind/gobind_test.go b/cmd/gobind/gobind_test.go index 302103c9e..f8c7879eb 100644 --- a/cmd/gobind/gobind_test.go +++ b/cmd/gobind/gobind_test.go @@ -1,4 +1,4 @@ -// Copyright 2016 The Go Authors. All rights reserved. +// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gobind/main.go b/cmd/gobind/main.go index 8ccb9951e..b2503080a 100644 --- a/cmd/gobind/main.go +++ b/cmd/gobind/main.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/bind.go b/cmd/gomobile/bind.go index fc9f75631..4e1c453f4 100644 --- a/cmd/gomobile/bind.go +++ b/cmd/gomobile/bind.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/bind_androidapp.go b/cmd/gomobile/bind_androidapp.go index f8fcabe1b..a8fab279d 100644 --- a/cmd/gomobile/bind_androidapp.go +++ b/cmd/gomobile/bind_androidapp.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/bind_iosapp.go b/cmd/gomobile/bind_iosapp.go index 9a3e52169..ca3815e3a 100644 --- a/cmd/gomobile/bind_iosapp.go +++ b/cmd/gomobile/bind_iosapp.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/bind_test.go b/cmd/gomobile/bind_test.go index 42d3f1110..07e366560 100644 --- a/cmd/gomobile/bind_test.go +++ b/cmd/gomobile/bind_test.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/build.go b/cmd/gomobile/build.go index f8895eb31..a8f0ad2cc 100644 --- a/cmd/gomobile/build.go +++ b/cmd/gomobile/build.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/build_androidapp.go b/cmd/gomobile/build_androidapp.go index bcd2664bd..5063f94ac 100644 --- a/cmd/gomobile/build_androidapp.go +++ b/cmd/gomobile/build_androidapp.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/build_apple.go b/cmd/gomobile/build_apple.go index f7b682389..298367bdf 100644 --- a/cmd/gomobile/build_apple.go +++ b/cmd/gomobile/build_apple.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/build_darwin_test.go b/cmd/gomobile/build_darwin_test.go index 43ca683ee..c640fa80e 100644 --- a/cmd/gomobile/build_darwin_test.go +++ b/cmd/gomobile/build_darwin_test.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/build_test.go b/cmd/gomobile/build_test.go index b50aba752..5cec2acf2 100644 --- a/cmd/gomobile/build_test.go +++ b/cmd/gomobile/build_test.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/cert.go b/cmd/gomobile/cert.go index 0aa00b3a4..f61299366 100644 --- a/cmd/gomobile/cert.go +++ b/cmd/gomobile/cert.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/cert_test.go b/cmd/gomobile/cert_test.go index a4ab860b7..c871394b4 100644 --- a/cmd/gomobile/cert_test.go +++ b/cmd/gomobile/cert_test.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/clean.go b/cmd/gomobile/clean.go index 1c0e348e3..6c3dddf28 100644 --- a/cmd/gomobile/clean.go +++ b/cmd/gomobile/clean.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/dex.go b/cmd/gomobile/dex.go index ff844b348..59dc3defe 100644 --- a/cmd/gomobile/dex.go +++ b/cmd/gomobile/dex.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/doc.go b/cmd/gomobile/doc.go index 74090da67..205f167b2 100644 --- a/cmd/gomobile/doc.go +++ b/cmd/gomobile/doc.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/env.go b/cmd/gomobile/env.go index e9fd5dcc7..320597994 100644 --- a/cmd/gomobile/env.go +++ b/cmd/gomobile/env.go @@ -1,3 +1,7 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package main import ( diff --git a/cmd/gomobile/env_test.go b/cmd/gomobile/env_test.go index e5ad28259..1b9e452b4 100644 --- a/cmd/gomobile/env_test.go +++ b/cmd/gomobile/env_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Go Authors. All rights reserved. +// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/gendex.go b/cmd/gomobile/gendex.go index be470a2bd..9ef5b315d 100644 --- a/cmd/gomobile/gendex.go +++ b/cmd/gomobile/gendex.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -148,7 +148,7 @@ func findLast(path string) (string, error) { return path + "/" + children[len(children)-1], nil } -var header = `// Copyright 2015 The Go Authors. All rights reserved. +var header = `// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/init.go b/cmd/gomobile/init.go index e7392df71..48642e22b 100644 --- a/cmd/gomobile/init.go +++ b/cmd/gomobile/init.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/init_test.go b/cmd/gomobile/init_test.go index 2eabda1a8..8a51e75ac 100644 --- a/cmd/gomobile/init_test.go +++ b/cmd/gomobile/init_test.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/install.go b/cmd/gomobile/install.go index beb7e5262..5a893c2ab 100644 --- a/cmd/gomobile/install.go +++ b/cmd/gomobile/install.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/main.go b/cmd/gomobile/main.go index fe6fd7e16..2d280b864 100644 --- a/cmd/gomobile/main.go +++ b/cmd/gomobile/main.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -128,7 +128,7 @@ func help(args []string) { os.Exit(2) } -const documentationHeader = `// Copyright 2015 The Go Authors. All rights reserved. +const documentationHeader = `// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/manifest.go b/cmd/gomobile/manifest.go index 09b8ff0e0..53fe32071 100644 --- a/cmd/gomobile/manifest.go +++ b/cmd/gomobile/manifest.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/strings_flag.go b/cmd/gomobile/strings_flag.go index 330833e70..6cf51c345 100644 --- a/cmd/gomobile/strings_flag.go +++ b/cmd/gomobile/strings_flag.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/version.go b/cmd/gomobile/version.go index 27fd6bde0..faf072428 100644 --- a/cmd/gomobile/version.go +++ b/cmd/gomobile/version.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/writer.go b/cmd/gomobile/writer.go index 880104120..029e6eeee 100644 --- a/cmd/gomobile/writer.go +++ b/cmd/gomobile/writer.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmd/gomobile/writer_test.go b/cmd/gomobile/writer_test.go index ae6e2c710..345ab2821 100644 --- a/cmd/gomobile/writer_test.go +++ b/cmd/gomobile/writer_test.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/example/ivy/doc.go b/example/ivy/doc.go index fa37ea90d..47eaa1fb6 100644 --- a/example/ivy/doc.go +++ b/example/ivy/doc.go @@ -1,4 +1,4 @@ -// Copyright 2021 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/example/ivy/tools.go b/example/ivy/tools.go index de6105c52..4219529ba 100644 --- a/example/ivy/tools.go +++ b/example/ivy/tools.go @@ -1,4 +1,4 @@ -// Copyright 2021 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/exp/f32/affine_test.go b/exp/f32/affine_test.go index f1d84cdd9..0c7009750 100644 --- a/exp/f32/affine_test.go +++ b/exp/f32/affine_test.go @@ -1,3 +1,7 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package f32 import ( diff --git a/gl/consts.go b/gl/consts.go index 370d0b859..62d93aab0 100644 --- a/gl/consts.go +++ b/gl/consts.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gl/doc.go b/gl/doc.go index 880d5f925..4cf95042c 100644 --- a/gl/doc.go +++ b/gl/doc.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gl/fn.go b/gl/fn.go index 3f2f3adea..c34e51662 100644 --- a/gl/fn.go +++ b/gl/fn.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gl/gendebug.go b/gl/gendebug.go index 146826f07..7e3d5a2a6 100644 --- a/gl/gendebug.go +++ b/gl/gendebug.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -877,7 +877,7 @@ func setEnqueueBlocking(c *ast.CallExpr) { }) } -const preamble = `// Copyright 2014 The Go Authors. All rights reserved. +const preamble = `// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gl/gl.go b/gl/gl.go index 28e747b09..2272c59d1 100644 --- a/gl/gl.go +++ b/gl/gl.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gl/gldebug.go b/gl/gldebug.go index fb79bb7ac..b3aca42e3 100644 --- a/gl/gldebug.go +++ b/gl/gldebug.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gl/interface.go b/gl/interface.go index 6ad9ff65f..693abe422 100644 --- a/gl/interface.go +++ b/gl/interface.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gl/types_debug.go b/gl/types_debug.go index ea011704e..e9e9bd7c8 100644 --- a/gl/types_debug.go +++ b/gl/types_debug.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gl/types_prod.go b/gl/types_prod.go index f87f91f75..6817c6f04 100644 --- a/gl/types_prod.go +++ b/gl/types_prod.go @@ -1,4 +1,4 @@ -// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/internal/binres/arsc.go b/internal/binres/arsc.go index 1b4dff223..bd583ffa5 100644 --- a/internal/binres/arsc.go +++ b/internal/binres/arsc.go @@ -1,4 +1,4 @@ -// Copyright 2016 The Go Authors. All rights reserved. +// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/internal/binres/binres.go b/internal/binres/binres.go index d77bde265..2f6dc7aae 100644 --- a/internal/binres/binres.go +++ b/internal/binres/binres.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/internal/binres/binres_test.go b/internal/binres/binres_test.go index 7e4f214c8..06259b420 100644 --- a/internal/binres/binres_test.go +++ b/internal/binres/binres_test.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/internal/binres/genarsc.go b/internal/binres/genarsc.go index 2e71f29f0..7d975cb8d 100644 --- a/internal/binres/genarsc.go +++ b/internal/binres/genarsc.go @@ -1,4 +1,4 @@ -// Copyright 2016 The Go Authors. All rights reserved. +// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -19,7 +19,7 @@ import ( "golang.org/x/mobile/internal/binres" ) -const tmpl = `// Copyright 2016 The Go Authors. All rights reserved. +const tmpl = `// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/internal/binres/node.go b/internal/binres/node.go index 491825143..20328fb9e 100644 --- a/internal/binres/node.go +++ b/internal/binres/node.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/internal/binres/pool.go b/internal/binres/pool.go index 273e94c72..c90350ce7 100644 --- a/internal/binres/pool.go +++ b/internal/binres/pool.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/internal/binres/sdk.go b/internal/binres/sdk.go index 607e0b7dc..44419c6ce 100644 --- a/internal/binres/sdk.go +++ b/internal/binres/sdk.go @@ -1,3 +1,7 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package binres import ( diff --git a/internal/binres/table.go b/internal/binres/table.go index b552cbaff..06dfb4392 100644 --- a/internal/binres/table.go +++ b/internal/binres/table.go @@ -1,4 +1,4 @@ -// Copyright 2015 The Go Authors. All rights reserved. +// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/internal/importers/ast.go b/internal/importers/ast.go index 64da4a188..dafad08b8 100644 --- a/internal/importers/ast.go +++ b/internal/importers/ast.go @@ -1,4 +1,4 @@ -// Copyright 2016 The Go Authors. All rights reserved. +// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/internal/importers/ast_test.go b/internal/importers/ast_test.go index 8e329940e..52c6d6304 100644 --- a/internal/importers/ast_test.go +++ b/internal/importers/ast_test.go @@ -1,3 +1,7 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package importers import ( diff --git a/internal/sdkpath/sdkpath.go b/internal/sdkpath/sdkpath.go index 91e9a5124..cdcf152cb 100644 --- a/internal/sdkpath/sdkpath.go +++ b/internal/sdkpath/sdkpath.go @@ -1,4 +1,4 @@ -// Copyright 2022 The Go Authors. All rights reserved. +// Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. From cd096645fcd3325d4006c702e6514a9f6b13b94a Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Sat, 15 Feb 2025 19:23:24 -0500 Subject: [PATCH 59/68] all: delete obsolete import comments Import comments were initially used to specify the canonical import path of a package, to prevent it from being used with a non-canonical path by accident. The module path in the go.mod file serves that purpose now. Change-Id: I36ebca191eb996b7254a6d452aa4f8dba88a6f94 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/649383 LUCI-TryBot-Result: Go LUCI Auto-Submit: Dmitri Shuralyov Reviewed-by: Michael Knyszek Reviewed-by: Dmitri Shuralyov Reviewed-by: Hajime Hoshi --- app/doc.go | 2 +- asset/doc.go | 2 +- bind/bind.go | 2 +- bind/java/context_android.go | 2 +- bind/seq/seq.go | 2 +- cmd/gobind/doc.go | 2 +- cmd/gomobile/doc.go | 2 +- event/lifecycle/lifecycle.go | 2 +- event/mouse/mouse.go | 2 +- event/paint/paint.go | 2 +- event/size/size.go | 2 +- event/touch/touch.go | 2 +- exp/app/debug/fps.go | 2 +- exp/audio/al/al.go | 2 +- exp/f32/f32.go | 2 +- exp/font/doc.go | 2 +- exp/gl/glutil/doc.go | 2 +- exp/gl/glutil/glutil.go | 2 +- exp/sensor/sensor.go | 2 +- exp/sprite/clock/clock.go | 2 +- exp/sprite/glsprite/glsprite.go | 2 +- exp/sprite/portable/portable.go | 2 +- exp/sprite/sprite.go | 2 +- geom/geom.go | 2 +- gl/doc.go | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/doc.go b/app/doc.go index 02bd6db80..2fabcd9de 100644 --- a/app/doc.go +++ b/app/doc.go @@ -85,4 +85,4 @@ response to lifecycle events. Such packages should call: in an init function inside that package. */ -package app // import "golang.org/x/mobile/app" +package app diff --git a/asset/doc.go b/asset/doc.go index b40d4a44d..37bb9bb34 100644 --- a/asset/doc.go +++ b/asset/doc.go @@ -14,4 +14,4 @@ // // For consistency when debugging on a desktop, assets are read from a // directory named assets under the current working directory. -package asset // import "golang.org/x/mobile/asset" +package asset diff --git a/bind/bind.go b/bind/bind.go index e5690835e..7c1b22e88 100644 --- a/bind/bind.go +++ b/bind/bind.go @@ -7,7 +7,7 @@ // See the documentation on the gobind command for usage details // and the list of currently supported types. // (http://godoc.org/golang.org/x/mobile/cmd/gobind) -package bind // import "golang.org/x/mobile/bind" +package bind // TODO(crawshaw): slice support // TODO(crawshaw): channel support diff --git a/bind/java/context_android.go b/bind/java/context_android.go index dc4443130..ee77a7e8a 100644 --- a/bind/java/context_android.go +++ b/bind/java/context_android.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package java // import "golang.org/x/mobile/bind/java" +package java // #cgo LDFLAGS: -llog // diff --git a/bind/seq/seq.go b/bind/seq/seq.go index 0740ca80f..699263669 100644 --- a/bind/seq/seq.go +++ b/bind/seq/seq.go @@ -9,7 +9,7 @@ // // Designed only for use by the code generated by gobind. Don't try to // use this directly. -package seq // import "golang.org/x/mobile/bind/seq" +package seq import _ "golang.org/x/mobile/internal/mobileinit" diff --git a/cmd/gobind/doc.go b/cmd/gobind/doc.go index cffb0d8b5..07b9df6ea 100644 --- a/cmd/gobind/doc.go +++ b/cmd/gobind/doc.go @@ -249,4 +249,4 @@ Examples can be found in http://golang.org/x/mobile/example. Design doc: http://golang.org/s/gobind */ -package main // import "golang.org/x/mobile/cmd/gobind" +package main diff --git a/cmd/gomobile/doc.go b/cmd/gomobile/doc.go index 205f167b2..6922125c2 100644 --- a/cmd/gomobile/doc.go +++ b/cmd/gomobile/doc.go @@ -167,4 +167,4 @@ Usage: Version prints versions of the gomobile binary and tools */ -package main // import "golang.org/x/mobile/cmd/gomobile" +package main diff --git a/event/lifecycle/lifecycle.go b/event/lifecycle/lifecycle.go index 4c588582d..58de2c419 100644 --- a/event/lifecycle/lifecycle.go +++ b/event/lifecycle/lifecycle.go @@ -17,7 +17,7 @@ // means it has lost the focus. // // See the golang.org/x/mobile/app package for details on the event model. -package lifecycle // import "golang.org/x/mobile/event/lifecycle" +package lifecycle import ( "fmt" diff --git a/event/mouse/mouse.go b/event/mouse/mouse.go index eec2fc078..e98131d37 100644 --- a/event/mouse/mouse.go +++ b/event/mouse/mouse.go @@ -5,7 +5,7 @@ // Package mouse defines an event for mouse input. // // See the golang.org/x/mobile/app package for details on the event model. -package mouse // import "golang.org/x/mobile/event/mouse" +package mouse import ( "fmt" diff --git a/event/paint/paint.go b/event/paint/paint.go index 0f24b1ad1..179136c46 100644 --- a/event/paint/paint.go +++ b/event/paint/paint.go @@ -5,7 +5,7 @@ // Package paint defines an event for the app being ready to paint. // // See the golang.org/x/mobile/app package for details on the event model. -package paint // import "golang.org/x/mobile/event/paint" +package paint // Event indicates that the app is ready to paint the next frame of the GUI. // diff --git a/event/size/size.go b/event/size/size.go index f39672819..4c4070b44 100644 --- a/event/size/size.go +++ b/event/size/size.go @@ -6,7 +6,7 @@ // orientation of the app's window. // // See the golang.org/x/mobile/app package for details on the event model. -package size // import "golang.org/x/mobile/event/size" +package size import ( "image" diff --git a/event/touch/touch.go b/event/touch/touch.go index c91967be2..94c4853ae 100644 --- a/event/touch/touch.go +++ b/event/touch/touch.go @@ -5,7 +5,7 @@ // Package touch defines an event for touch input. // // See the golang.org/x/mobile/app package for details on the event model. -package touch // import "golang.org/x/mobile/event/touch" +package touch // The best source on android input events is the NDK: include/android/input.h // diff --git a/exp/app/debug/fps.go b/exp/app/debug/fps.go index c01570582..67b194fc5 100644 --- a/exp/app/debug/fps.go +++ b/exp/app/debug/fps.go @@ -5,7 +5,7 @@ //go:build darwin || linux || windows // Package debug provides GL-based debugging tools for apps. -package debug // import "golang.org/x/mobile/exp/app/debug" +package debug import ( "image" diff --git a/exp/audio/al/al.go b/exp/audio/al/al.go index 974488967..f27dca258 100644 --- a/exp/audio/al/al.go +++ b/exp/audio/al/al.go @@ -22,7 +22,7 @@ // license file to the open source notices of your application. // OpenAL Soft's license file could be found at // http://repo.or.cz/w/openal-soft.git/blob/HEAD:/COPYING. -package al // import "golang.org/x/mobile/exp/audio/al" +package al // Capability represents OpenAL extension capabilities. type Capability int32 diff --git a/exp/f32/f32.go b/exp/f32/f32.go index 59e1b651c..a0a3ed0d9 100644 --- a/exp/f32/f32.go +++ b/exp/f32/f32.go @@ -23,7 +23,7 @@ // The interface to this package is not stable. It will change considerably. // Only use functions that provide package documentation. Semantics are // non-obvious. Be prepared for the package name to change. -package f32 // import "golang.org/x/mobile/exp/f32" +package f32 import ( "encoding/binary" diff --git a/exp/font/doc.go b/exp/font/doc.go index 5ae720518..349feb461 100644 --- a/exp/font/doc.go +++ b/exp/font/doc.go @@ -3,4 +3,4 @@ // license that can be found in the LICENSE file. // Package font provides platform independent access to system fonts. -package font // import "golang.org/x/mobile/exp/font" +package font diff --git a/exp/gl/glutil/doc.go b/exp/gl/glutil/doc.go index 44b121075..94e4a6ce1 100644 --- a/exp/gl/glutil/doc.go +++ b/exp/gl/glutil/doc.go @@ -3,4 +3,4 @@ // license that can be found in the LICENSE file. // Package glutil implements OpenGL utility functions. -package glutil // import "golang.org/x/mobile/exp/gl/glutil" +package glutil diff --git a/exp/gl/glutil/glutil.go b/exp/gl/glutil/glutil.go index 880b97e28..26edca145 100644 --- a/exp/gl/glutil/glutil.go +++ b/exp/gl/glutil/glutil.go @@ -4,7 +4,7 @@ //go:build darwin || linux || windows -package glutil // import "golang.org/x/mobile/exp/gl/glutil" +package glutil import ( "fmt" diff --git a/exp/sensor/sensor.go b/exp/sensor/sensor.go index 2c697b6dd..d03003504 100644 --- a/exp/sensor/sensor.go +++ b/exp/sensor/sensor.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // Package sensor provides sensor events from various movement sensors. -package sensor // import "golang.org/x/mobile/exp/sensor" +package sensor import ( "errors" diff --git a/exp/sprite/clock/clock.go b/exp/sprite/clock/clock.go index a468e66e7..6d4dbc27b 100644 --- a/exp/sprite/clock/clock.go +++ b/exp/sprite/clock/clock.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // Package clock provides a clock and time functions for a sprite engine. -package clock // import "golang.org/x/mobile/exp/sprite/clock" +package clock // A Time represents an instant in sprite time. // diff --git a/exp/sprite/glsprite/glsprite.go b/exp/sprite/glsprite/glsprite.go index 1e9fa0cda..32ca899e5 100644 --- a/exp/sprite/glsprite/glsprite.go +++ b/exp/sprite/glsprite/glsprite.go @@ -8,7 +8,7 @@ // // Each sprite.Texture is loaded as a GL texture object and drawn // to the screen via an affine transform done in a simple shader. -package glsprite // import "golang.org/x/mobile/exp/sprite/glsprite" +package glsprite import ( "image" diff --git a/exp/sprite/portable/portable.go b/exp/sprite/portable/portable.go index 4b6c9155f..bcf07240d 100644 --- a/exp/sprite/portable/portable.go +++ b/exp/sprite/portable/portable.go @@ -7,7 +7,7 @@ // It is intended to serve as a reference implementation for testing // other sprite Engines written against OpenGL, or other more exotic // modern hardware interfaces. -package portable // import "golang.org/x/mobile/exp/sprite/portable" +package portable import ( "image" diff --git a/exp/sprite/sprite.go b/exp/sprite/sprite.go index df13fb595..cbc9f458e 100644 --- a/exp/sprite/sprite.go +++ b/exp/sprite/sprite.go @@ -22,7 +22,7 @@ // modify the scene's nodes and animations (Arranger values) // e.Render(scene, t, sz) // } -package sprite // import "golang.org/x/mobile/exp/sprite" +package sprite import ( "image" diff --git a/geom/geom.go b/geom/geom.go index 1bfd14f3e..6b7394465 100644 --- a/geom/geom.go +++ b/geom/geom.go @@ -19,7 +19,7 @@ the screen. Positions on the plane are measured in typographic points, Any interface that draws to the screen using types from the geom package scales the number of pixels to maintain a Pt as 1/72 of an inch. */ -package geom // import "golang.org/x/mobile/geom" +package geom /* Notes on the various underlying coordinate systems. diff --git a/gl/doc.go b/gl/doc.go index 4cf95042c..408c35a68 100644 --- a/gl/doc.go +++ b/gl/doc.go @@ -42,7 +42,7 @@ error messages. For example, The gldebug tracing has very high overhead, so make sure to remove the build tag before deploying any binaries. */ -package gl // import "golang.org/x/mobile/gl" +package gl /* Implementation details. From 3a7bc9f8a4de41ecf23e44f7906242ae68b84ac5 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Wed, 5 Mar 2025 12:57:28 -0800 Subject: [PATCH 60/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I38d44c7d8e64e31452841c3901aad7a7604c6936 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/655042 Reviewed-by: David Chase Reviewed-by: Dmitri Shuralyov Auto-Submit: Gopher Robot LUCI-TryBot-Result: Go LUCI --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 23b39fa82..5b5e8c499 100644 --- a/go.mod +++ b/go.mod @@ -17,10 +17,10 @@ godebug gotypesalias=0 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.24.0 - golang.org/x/mod v0.23.0 - golang.org/x/sync v0.11.0 - golang.org/x/tools v0.30.0 + golang.org/x/image v0.25.0 + golang.org/x/mod v0.24.0 + golang.org/x/sync v0.12.0 + golang.org/x/tools v0.31.0 ) -require golang.org/x/sys v0.30.0 // indirect +require golang.org/x/sys v0.31.0 // indirect diff --git a/go.sum b/go.sum index 31424023e..4b7c42337 100644 --- a/go.sum +++ b/go.sum @@ -2,13 +2,13 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.24.0 h1:AN7zRgVsbvmTfNyqIbbOraYL8mSwcKncEj8ofjgzcMQ= -golang.org/x/image v0.24.0/go.mod h1:4b/ITuLfqYq1hqZcjofwctIhi7sZh2WaCjvsBNjjya8= -golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= -golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= -golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= +golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ= +golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs= +golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= +golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= +golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= From 978277e7eaf70fef73261815df6ce0d6e606af18 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Mon, 7 Apr 2025 19:17:51 -0700 Subject: [PATCH 61/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I61af4d63aed7548220a58b231e0347f5c67004a5 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/663619 Auto-Submit: Gopher Robot Reviewed-by: David Chase Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 5b5e8c499..72c5401a8 100644 --- a/go.mod +++ b/go.mod @@ -17,10 +17,10 @@ godebug gotypesalias=0 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.25.0 + golang.org/x/image v0.26.0 golang.org/x/mod v0.24.0 - golang.org/x/sync v0.12.0 - golang.org/x/tools v0.31.0 + golang.org/x/sync v0.13.0 + golang.org/x/tools v0.32.0 ) -require golang.org/x/sys v0.31.0 // indirect +require golang.org/x/sys v0.32.0 // indirect diff --git a/go.sum b/go.sum index 4b7c42337..bc1cdbc4f 100644 --- a/go.sum +++ b/go.sum @@ -2,13 +2,13 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ= -golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs= +golang.org/x/image v0.26.0 h1:4XjIFEZWQmCZi6Wv8BoxsDhRU3RVnLX04dToTDAEPlY= +golang.org/x/image v0.26.0/go.mod h1:lcxbMFAovzpnJxzXS3nyL83K27tmqtKzIJpctK8YO5c= golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= -golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= -golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= -golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU= +golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s= From 78cd7a343bde765feaecace9f575518435d13e11 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Mon, 5 May 2025 14:56:29 -0700 Subject: [PATCH 62/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: Ie9c5a8e8b88723773c5884317a7724771fdc0db8 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/670099 Reviewed-by: Cherry Mui Auto-Submit: Gopher Robot Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 72c5401a8..d3a3ceefb 100644 --- a/go.mod +++ b/go.mod @@ -17,10 +17,10 @@ godebug gotypesalias=0 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.26.0 + golang.org/x/image v0.27.0 golang.org/x/mod v0.24.0 - golang.org/x/sync v0.13.0 - golang.org/x/tools v0.32.0 + golang.org/x/sync v0.14.0 + golang.org/x/tools v0.33.0 ) -require golang.org/x/sys v0.32.0 // indirect +require golang.org/x/sys v0.33.0 // indirect diff --git a/go.sum b/go.sum index bc1cdbc4f..093fbf4e8 100644 --- a/go.sum +++ b/go.sum @@ -2,13 +2,13 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.26.0 h1:4XjIFEZWQmCZi6Wv8BoxsDhRU3RVnLX04dToTDAEPlY= -golang.org/x/image v0.26.0/go.mod h1:lcxbMFAovzpnJxzXS3nyL83K27tmqtKzIJpctK8YO5c= +golang.org/x/image v0.27.0 h1:C8gA4oWU/tKkdCfYT6T2u4faJu3MeNS5O8UPWlPF61w= +golang.org/x/image v0.27.0/go.mod h1:xbdrClrAUway1MUTEZDq9mz/UpRwYAkFFNUslZtcB+g= golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= -golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= -golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= -golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU= -golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s= +golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= +golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= +golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= From a1d90793fc63015513ae877a689ddcc0903750ae Mon Sep 17 00:00:00 2001 From: Iliya Lyan <68940374+12ya@users.noreply.github.com> Date: Mon, 19 May 2025 12:08:46 +0000 Subject: [PATCH 63/68] all: replace deprecated io/ioutil package Change-Id: Ie22fc00b1382fbf854ce5c2cd617bc9cb1e0c674 GitHub-Last-Rev: 3176a9fecffd48bad69493a188116a4f0961640d GitHub-Pull-Request: golang/mobile#110 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/674035 Reviewed-by: David Chase Reviewed-by: Hajime Hoshi Auto-Submit: Hajime Hoshi LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov --- app/app_test.go | 3 +-- bind/bind_test.go | 19 +++++++++---------- bind/java/seq_test.go | 11 +++++------ bind/objc/seq_test.go | 7 +++---- bind/testdata/testpkg/testpkg.go | 4 ++-- cmd/gobind/gen.go | 21 ++++++++++----------- cmd/gobind/main.go | 3 +-- cmd/gomobile/bind.go | 3 +-- cmd/gomobile/bind_androidapp.go | 5 ++--- cmd/gomobile/build_androidapp.go | 5 ++--- cmd/gomobile/build_apple.go | 3 +-- cmd/gomobile/build_test.go | 3 +-- cmd/gomobile/cert_test.go | 3 +-- cmd/gomobile/env.go | 5 ++--- cmd/gomobile/env_test.go | 3 +-- cmd/gomobile/gendex.go | 5 ++--- cmd/gomobile/init.go | 5 ++--- cmd/gomobile/init_test.go | 5 ++--- cmd/gomobile/main.go | 3 +-- cmd/gomobile/writer_test.go | 5 ++--- exp/f32/gen.go | 4 ++-- exp/font/font_android.go | 6 +++--- exp/font/font_linux.go | 10 +++++----- exp/sprite/portable/affine_test.go | 3 +-- gl/dll_windows.go | 17 ++++++++--------- gl/gendebug.go | 3 +-- internal/binres/binres_test.go | 5 ++--- internal/binres/genarsc.go | 4 ++-- 28 files changed, 75 insertions(+), 98 deletions(-) diff --git a/app/app_test.go b/app/app_test.go index 91742192b..9fa2a188a 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -9,7 +9,6 @@ import ( "image" "image/color" _ "image/png" - "io/ioutil" "net" "os" "os/exec" @@ -56,7 +55,7 @@ func TestAndroidApp(t *testing.T) { t.Fatal(err) } - tmpdir, err := ioutil.TempDir("", "app-test-") + tmpdir, err := os.MkdirTemp("", "app-test-") if err != nil { t.Fatal(err) } diff --git a/bind/bind_test.go b/bind/bind_test.go index af0973323..96288a4e2 100644 --- a/bind/bind_test.go +++ b/bind/bind_test.go @@ -15,7 +15,6 @@ import ( "go/token" "go/types" "io" - "io/ioutil" "log" "os" "os/exec" @@ -125,7 +124,7 @@ func diff(a, b string) string { } func writeTempFile(t *testing.T, name string, contents []byte) string { - f, err := ioutil.TempFile("", name) + f, err := os.CreateTemp("", name) if err != nil { t.Fatal(err) } @@ -219,14 +218,14 @@ func genObjcPackages(t *testing.T, dir string, cg *ObjcWrapper) { pkgFile := filepath.Join(pkgDir, "package.go") cg.Buf.Reset() cg.GenPackage(i) - if err := ioutil.WriteFile(pkgFile, cg.Buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(pkgFile, cg.Buf.Bytes(), 0600); err != nil { t.Fatal(err) } } cg.Buf.Reset() cg.GenInterfaces() clsFile := filepath.Join(pkgBase, "interfaces.go") - if err := ioutil.WriteFile(clsFile, cg.Buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(clsFile, cg.Buf.Bytes(), 0600); err != nil { t.Fatal(err) } @@ -258,7 +257,7 @@ func genJavaPackages(t *testing.T, dir string, cg *ClassGen) { pkgFile := filepath.Join(pkgDir, "package.go") cg.Buf.Reset() cg.GenPackage(i) - if err := ioutil.WriteFile(pkgFile, cg.Buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(pkgFile, cg.Buf.Bytes(), 0600); err != nil { t.Fatal(err) } io.Copy(buf, cg.Buf) @@ -266,7 +265,7 @@ func genJavaPackages(t *testing.T, dir string, cg *ClassGen) { cg.Buf.Reset() cg.GenInterfaces() clsFile := filepath.Join(pkgBase, "interfaces.go") - if err := ioutil.WriteFile(clsFile, cg.Buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(clsFile, cg.Buf.Bytes(), 0600); err != nil { t.Fatal(err) } io.Copy(buf, cg.Buf) @@ -306,7 +305,7 @@ func TestGenJava(t *testing.T) { } tmpGopath := "" if len(classes) > 0 { - tmpGopath, err = ioutil.TempDir(os.TempDir(), "gomobile-bind-test-") + tmpGopath, err = os.MkdirTemp(os.TempDir(), "gomobile-bind-test-") if err != nil { t.Fatal(err) } @@ -423,7 +422,7 @@ func TestGenGoJavaWrappers(t *testing.T) { if err != nil { t.Fatal(err) } - tmpGopath, err := ioutil.TempDir(os.TempDir(), "gomobile-bind-test-") + tmpGopath, err := os.MkdirTemp(os.TempDir(), "gomobile-bind-test-") if err != nil { t.Fatal(err) } @@ -453,7 +452,7 @@ func TestGenGoObjcWrappers(t *testing.T) { if err != nil { t.Fatal(err) } - tmpGopath, err := ioutil.TempDir(os.TempDir(), "gomobile-bind-test-") + tmpGopath, err := os.MkdirTemp(os.TempDir(), "gomobile-bind-test-") if err != nil { t.Fatal(err) } @@ -499,7 +498,7 @@ func testGenGo(t *testing.T, filename string, buf *bytes.Buffer, pkg *types.Pack } golden += ".golden" - goldenContents, err := ioutil.ReadFile(golden) + goldenContents, err := os.ReadFile(golden) if err != nil { t.Fatalf("failed to read golden file: %v", err) } diff --git a/bind/java/seq_test.go b/bind/java/seq_test.go index a5151d40b..4d9cd2fda 100644 --- a/bind/java/seq_test.go +++ b/bind/java/seq_test.go @@ -7,7 +7,6 @@ package java import ( "fmt" "io" - "io/ioutil" "log" "os" "os/exec" @@ -28,7 +27,7 @@ func TestMain(m *testing.M) { func testMain(m *testing.M) int { // Build gomobile and gobind and put them into PATH. - binDir, err := ioutil.TempDir("", "bind-java-test-") + binDir, err := os.MkdirTemp("", "bind-java-test-") if err != nil { log.Fatal(err) } @@ -117,7 +116,7 @@ func runTest(t *testing.T, pkgNames []string, javaPkg, javaCls string) { if err != nil { t.Fatalf("failed pwd: %v", err) } - tmpdir, err := ioutil.TempDir("", "bind-java-seq-test-") + tmpdir, err := os.MkdirTemp("", "bind-java-seq-test-") if err != nil { t.Fatalf("failed to prepare temp dir: %v", err) } @@ -164,20 +163,20 @@ func runTest(t *testing.T, pkgNames []string, javaPkg, javaCls string) { } fname = filepath.Join(tmpdir, "src/main/AndroidManifest.xml") - err = ioutil.WriteFile(fname, []byte(androidmanifest), 0700) + err = os.WriteFile(fname, []byte(androidmanifest), 0700) if err != nil { t.Fatalf("failed to write android manifest file: %v", err) } // Add a dummy string resource to avoid errors from the Android build system. fname = filepath.Join(tmpdir, "src/main/res/values/strings.xml") - err = ioutil.WriteFile(fname, []byte(stringsxml), 0700) + err = os.WriteFile(fname, []byte(stringsxml), 0700) if err != nil { t.Fatalf("failed to write strings.xml file: %v", err) } fname = filepath.Join(tmpdir, "build.gradle") - err = ioutil.WriteFile(fname, []byte(buildgradle), 0700) + err = os.WriteFile(fname, []byte(buildgradle), 0700) if err != nil { t.Fatalf("failed to write build.gradle file: %v", err) } diff --git a/bind/objc/seq_test.go b/bind/objc/seq_test.go index e6ef5e71d..0aa4bdcf6 100644 --- a/bind/objc/seq_test.go +++ b/bind/objc/seq_test.go @@ -8,7 +8,6 @@ import ( "flag" "fmt" "io" - "io/ioutil" "log" "os" "os/exec" @@ -43,7 +42,7 @@ func TestMain(m *testing.M) { } func testMain(m *testing.M) int { - binDir, err := ioutil.TempDir("", "bind-objc-test-") + binDir, err := os.MkdirTemp("", "bind-objc-test-") if err != nil { log.Fatal(err) } @@ -108,7 +107,7 @@ func runTest(t *testing.T, pkgNames []string, prefix, testfile, framework string t.Skip("command xcodebuild not found, skipping") } - tmpdir, err := ioutil.TempDir("", "bind-objc-seq-test-") + tmpdir, err := os.MkdirTemp("", "bind-objc-seq-test-") if err != nil { t.Fatalf("failed to prepare temp dir: %v", err) } @@ -200,7 +199,7 @@ func createProject(dir, testfile, framework string) error { {"xcodetest/AppDelegate.m", appdelegatem}, } for _, f := range files { - if err := ioutil.WriteFile(filepath.Join(dir, f.path), []byte(f.content), 0700); err != nil { + if err := os.WriteFile(filepath.Join(dir, f.path), []byte(f.content), 0700); err != nil { return err } } diff --git a/bind/testdata/testpkg/testpkg.go b/bind/testdata/testpkg/testpkg.go index cd7a2ea04..40203bfe3 100644 --- a/bind/testdata/testpkg/testpkg.go +++ b/bind/testdata/testpkg/testpkg.go @@ -12,7 +12,7 @@ import ( "context" "errors" "fmt" - "io/ioutil" + "io" "log" "math" "os" @@ -232,7 +232,7 @@ func ReadAsset() string { } defer rc.Close() - b, err := ioutil.ReadAll(rc) + b, err := io.ReadAll(rc) if err != nil { log.Fatal(err) } diff --git a/cmd/gobind/gen.go b/cmd/gobind/gen.go index 87c72d9d2..1bce3a433 100644 --- a/cmd/gobind/gen.go +++ b/cmd/gobind/gen.go @@ -11,7 +11,6 @@ import ( "go/token" "go/types" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -203,7 +202,7 @@ func genObjcPackages(dir string, types []*objc.Named, embedders []importers.Stru pkgFile := filepath.Join(pkgDir, "package.go") buf.Reset() cg.GenPackage(i) - if err := ioutil.WriteFile(pkgFile, buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(pkgFile, buf.Bytes(), 0600); err != nil { return err } } @@ -213,7 +212,7 @@ func genObjcPackages(dir string, types []*objc.Named, embedders []importers.Stru if err := os.MkdirAll(objcBase, 0700); err != nil { return err } - if err := ioutil.WriteFile(filepath.Join(objcBase, "interfaces.go"), buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(filepath.Join(objcBase, "interfaces.go"), buf.Bytes(), 0600); err != nil { return err } goBase := filepath.Join(dir, "src", "gobind") @@ -222,17 +221,17 @@ func genObjcPackages(dir string, types []*objc.Named, embedders []importers.Stru } buf.Reset() cg.GenGo() - if err := ioutil.WriteFile(filepath.Join(goBase, "interfaces_darwin.go"), buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(filepath.Join(goBase, "interfaces_darwin.go"), buf.Bytes(), 0600); err != nil { return err } buf.Reset() cg.GenH() - if err := ioutil.WriteFile(filepath.Join(goBase, "interfaces.h"), buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(filepath.Join(goBase, "interfaces.h"), buf.Bytes(), 0600); err != nil { return err } buf.Reset() cg.GenM() - if err := ioutil.WriteFile(filepath.Join(goBase, "interfaces_darwin.m"), buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(filepath.Join(goBase, "interfaces_darwin.m"), buf.Bytes(), 0600); err != nil { return err } return nil @@ -256,7 +255,7 @@ func genJavaPackages(dir string, classes []*java.Class, embedders []importers.St pkgFile := filepath.Join(pkgDir, "package.go") buf.Reset() cg.GenPackage(i) - if err := ioutil.WriteFile(pkgFile, buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(pkgFile, buf.Bytes(), 0600); err != nil { return err } } @@ -266,7 +265,7 @@ func genJavaPackages(dir string, classes []*java.Class, embedders []importers.St if err := os.MkdirAll(javaBase, 0700); err != nil { return err } - if err := ioutil.WriteFile(filepath.Join(javaBase, "interfaces.go"), buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(filepath.Join(javaBase, "interfaces.go"), buf.Bytes(), 0600); err != nil { return err } goBase := filepath.Join(dir, "src", "gobind") @@ -275,17 +274,17 @@ func genJavaPackages(dir string, classes []*java.Class, embedders []importers.St } buf.Reset() cg.GenGo() - if err := ioutil.WriteFile(filepath.Join(goBase, "classes_android.go"), buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(filepath.Join(goBase, "classes_android.go"), buf.Bytes(), 0600); err != nil { return err } buf.Reset() cg.GenH() - if err := ioutil.WriteFile(filepath.Join(goBase, "classes.h"), buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(filepath.Join(goBase, "classes.h"), buf.Bytes(), 0600); err != nil { return err } buf.Reset() cg.GenC() - if err := ioutil.WriteFile(filepath.Join(goBase, "classes_android.c"), buf.Bytes(), 0600); err != nil { + if err := os.WriteFile(filepath.Join(goBase, "classes_android.c"), buf.Bytes(), 0600); err != nil { return err } return nil diff --git a/cmd/gobind/main.go b/cmd/gobind/main.go index b2503080a..bf1e7778e 100644 --- a/cmd/gobind/main.go +++ b/cmd/gobind/main.go @@ -10,7 +10,6 @@ import ( "fmt" "go/ast" "go/types" - "io/ioutil" "log" "os" "os/exec" @@ -102,7 +101,7 @@ func run() { if len(classes) > 0 || len(otypes) > 0 { srcDir := *outdir if srcDir == "" { - srcDir, err = ioutil.TempDir(os.TempDir(), "gobind-") + srcDir, err = os.MkdirTemp(os.TempDir(), "gobind-") if err != nil { log.Fatal(err) } diff --git a/cmd/gomobile/bind.go b/cmd/gomobile/bind.go index 4e1c453f4..2cab5609c 100644 --- a/cmd/gomobile/bind.go +++ b/cmd/gomobile/bind.go @@ -10,7 +10,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -197,7 +196,7 @@ func writeFile(filename string, generate func(io.Writer) error) error { } if buildN { - return generate(ioutil.Discard) + return generate(io.Discard) } f, err := os.Create(filename) diff --git a/cmd/gomobile/bind_androidapp.go b/cmd/gomobile/bind_androidapp.go index a8fab279d..d03e64968 100644 --- a/cmd/gomobile/bind_androidapp.go +++ b/cmd/gomobile/bind_androidapp.go @@ -8,7 +8,6 @@ import ( "archive/zip" "fmt" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -73,7 +72,7 @@ func goAndroidBind(gobind string, pkgs []*packages.Package, targets []targetInfo } func buildSrcJar(src string) error { - var out io.Writer = ioutil.Discard + var out io.Writer = io.Discard if !buildN { ext := filepath.Ext(buildO) f, err := os.Create(buildO[:len(buildO)-len(ext)] + "-sources.jar") @@ -110,7 +109,7 @@ func buildSrcJar(src string) error { // // javac and jar commands are needed to build classes.jar. func buildAAR(srcDir, androidDir string, pkgs []*packages.Package, targets []targetInfo) (err error) { - var out io.Writer = ioutil.Discard + var out io.Writer = io.Discard if buildO == "" { buildO = pkgs[0].Name + ".aar" } diff --git a/cmd/gomobile/build_androidapp.go b/cmd/gomobile/build_androidapp.go index 5063f94ac..48837b5c4 100644 --- a/cmd/gomobile/build_androidapp.go +++ b/cmd/gomobile/build_androidapp.go @@ -13,7 +13,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "os" "path" @@ -37,7 +36,7 @@ func goAndroidBuild(pkg *packages.Package, targets []targetInfo) (map[string]boo dir := filepath.Dir(pkg.GoFiles[0]) manifestPath := filepath.Join(dir, "AndroidManifest.xml") - manifestData, err := ioutil.ReadFile(manifestPath) + manifestData, err := os.ReadFile(manifestPath) if err != nil { if !os.IsNotExist(err) { return nil, err @@ -129,7 +128,7 @@ func goAndroidBuild(pkg *packages.Package, targets []targetInfo) (map[string]boo fmt.Fprintf(os.Stderr, "apk: %s\n", name) } if buildN { - return ioutil.Discard, nil + return io.Discard, nil } return apkw.Create(name) } diff --git a/cmd/gomobile/build_apple.go b/cmd/gomobile/build_apple.go index 298367bdf..1919a7ed7 100644 --- a/cmd/gomobile/build_apple.go +++ b/cmd/gomobile/build_apple.go @@ -9,7 +9,6 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "io/ioutil" "os" "os/exec" "path" @@ -69,7 +68,7 @@ func goAppleBuild(pkg *packages.Package, bundleID string, targets []targetInfo) printcmd("echo \"%s\" > %s", file.contents, file.name) } if !buildN { - if err := ioutil.WriteFile(file.name, file.contents, 0644); err != nil { + if err := os.WriteFile(file.name, file.contents, 0644); err != nil { return nil, err } } diff --git a/cmd/gomobile/build_test.go b/cmd/gomobile/build_test.go index 5cec2acf2..e5e412ab7 100644 --- a/cmd/gomobile/build_test.go +++ b/cmd/gomobile/build_test.go @@ -6,7 +6,6 @@ package main import ( "bytes" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -212,7 +211,7 @@ func TestBuildWithGoModules(t *testing.T) { t.Skipf("gomobile are not available on %s", runtime.GOOS) } - dir, err := ioutil.TempDir("", "gomobile-test") + dir, err := os.MkdirTemp("", "gomobile-test") if err != nil { t.Fatal(err) } diff --git a/cmd/gomobile/cert_test.go b/cmd/gomobile/cert_test.go index c871394b4..c5c5e3c6b 100644 --- a/cmd/gomobile/cert_test.go +++ b/cmd/gomobile/cert_test.go @@ -8,7 +8,6 @@ import ( "crypto/rand" "crypto/x509" "encoding/pem" - "io/ioutil" "os" "os/exec" "testing" @@ -30,7 +29,7 @@ func TestSignPKCS7(t *testing.T) { if err != nil { t.Fatal(err) } - sig, err := ioutil.TempFile("", "content.rsa") + sig, err := os.CreateTemp("", "content.rsa") if err != nil { t.Fatal(err) } diff --git a/cmd/gomobile/env.go b/cmd/gomobile/env.go index 320597994..869e38cf3 100644 --- a/cmd/gomobile/env.go +++ b/cmd/gomobile/env.go @@ -10,7 +10,6 @@ import ( "errors" "fmt" "io/fs" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -144,7 +143,7 @@ func buildEnvInit() (cleanup func(), err error) { tmpdir = "$WORK" cleanupFn = func() {} } else { - tmpdir, err = ioutil.TempDir("", "gomobile-work-") + tmpdir, err = os.MkdirTemp("", "gomobile-work-") if err != nil { return nil, err } @@ -340,7 +339,7 @@ func checkNDKRoot(ndkRoot string, targets []targetInfo) error { // compatibleNDKRoots searches the side-by-side NDK dirs for compatible SDKs. func compatibleNDKRoots(ndkForest string, targets []targetInfo) ([]string, error) { - ndkDirs, err := ioutil.ReadDir(ndkForest) + ndkDirs, err := os.ReadDir(ndkForest) if err != nil { return nil, err } diff --git a/cmd/gomobile/env_test.go b/cmd/gomobile/env_test.go index 1b9e452b4..9090eaab3 100644 --- a/cmd/gomobile/env_test.go +++ b/cmd/gomobile/env_test.go @@ -6,14 +6,13 @@ package main import ( "fmt" - "io/ioutil" "os" "path/filepath" "testing" ) func TestNdkRoot(t *testing.T) { - home, err := ioutil.TempDir("", "gomobile-test-") + home, err := os.MkdirTemp("", "gomobile-test-") if err != nil { t.Fatal(err) } diff --git a/cmd/gomobile/gendex.go b/cmd/gomobile/gendex.go index 9ef5b315d..1e5efc957 100644 --- a/cmd/gomobile/gendex.go +++ b/cmd/gomobile/gendex.go @@ -23,7 +23,6 @@ import ( "flag" "fmt" "go/format" - "io/ioutil" "log" "os" "os/exec" @@ -40,7 +39,7 @@ func main() { flag.Parse() var err error - tmpdir, err = ioutil.TempDir("", "gendex-") + tmpdir, err = os.MkdirTemp("", "gendex-") if err != nil { log.Fatal(err) } @@ -98,7 +97,7 @@ func gendex() error { os.Stderr.Write(out) return err } - src, err := ioutil.ReadFile(tmpdir + "/classes.dex") + src, err := os.ReadFile(tmpdir + "/classes.dex") if err != nil { return err } diff --git a/cmd/gomobile/init.go b/cmd/gomobile/init.go index 48642e22b..be4eaea81 100644 --- a/cmd/gomobile/init.go +++ b/cmd/gomobile/init.go @@ -9,7 +9,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -63,7 +62,7 @@ func runInit(cmd *command) error { tmpdir = filepath.Join(gomobilepath, "work") } else { var err error - tmpdir, err = ioutil.TempDir(gomobilepath, "work-") + tmpdir, err = os.MkdirTemp(gomobilepath, "work-") if err != nil { return err } @@ -153,7 +152,7 @@ func installOpenAL(gomobilepath string) error { alTmpDir = filepath.Join(gomobilepath, "work") } else { var err error - alTmpDir, err = ioutil.TempDir(gomobilepath, "openal-release-") + alTmpDir, err = os.MkdirTemp(gomobilepath, "openal-release-") if err != nil { return err } diff --git a/cmd/gomobile/init_test.go b/cmd/gomobile/init_test.go index 8a51e75ac..0e737170e 100644 --- a/cmd/gomobile/init_test.go +++ b/cmd/gomobile/init_test.go @@ -6,7 +6,6 @@ package main import ( "bytes" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -40,7 +39,7 @@ func TestInit(t *testing.T) { // Test that first GOPATH element is chosen correctly. var err error - gopath, err = ioutil.TempDir("", "gomobile-test") + gopath, err = os.MkdirTemp("", "gomobile-test") if err != nil { t.Fatal(err) } @@ -55,7 +54,7 @@ func TestInit(t *testing.T) { os.Setenv("HOMEDRIVE", "C:") } - emptymod, err := ioutil.TempDir("", "gomobile-test") + emptymod, err := os.MkdirTemp("", "gomobile-test") if err != nil { t.Fatal(err) } diff --git a/cmd/gomobile/main.go b/cmd/gomobile/main.go index 2d280b864..c123263f5 100644 --- a/cmd/gomobile/main.go +++ b/cmd/gomobile/main.go @@ -13,7 +13,6 @@ import ( "fmt" "html/template" "io" - "io/ioutil" "log" "os" "os/exec" @@ -159,7 +158,7 @@ func helpDocumentation(path string) { w.WriteString("*/\npackage main // import \"golang.org/x/mobile/cmd/gomobile\"\n") - if err := ioutil.WriteFile(path, w.Bytes(), 0666); err != nil { + if err := os.WriteFile(path, w.Bytes(), 0666); err != nil { log.Fatal(err) } } diff --git a/cmd/gomobile/writer_test.go b/cmd/gomobile/writer_test.go index 345ab2821..324659a8b 100644 --- a/cmd/gomobile/writer_test.go +++ b/cmd/gomobile/writer_test.go @@ -8,7 +8,6 @@ import ( "crypto/x509" "encoding/pem" "io" - "io/ioutil" "os" "os/exec" "testing" @@ -28,7 +27,7 @@ func TestWriter(t *testing.T) { t.Fatal(err) } - f, err := ioutil.TempFile("", "testapk-") + f, err := os.CreateTemp("", "testapk-") if err != nil { t.Fatal(err) } @@ -141,7 +140,7 @@ const androidManifest = ` ` func writeTempFile(data string) (string, error) { - f, err := ioutil.TempFile("", "gofmt") + f, err := os.CreateTemp("", "gofmt") if err != nil { return "", err } diff --git a/exp/f32/gen.go b/exp/f32/gen.go index 2af3327bf..267948381 100644 --- a/exp/f32/gen.go +++ b/exp/f32/gen.go @@ -16,9 +16,9 @@ import ( "flag" "fmt" "go/format" - "io/ioutil" "log" "math" + "os" ) // N is the number of entries in the sin look-up table. It must be a power of 2. @@ -42,7 +42,7 @@ func main() { if err != nil { log.Fatal(err) } - if err := ioutil.WriteFile(*filename, data, 0644); err != nil { + if err := os.WriteFile(*filename, data, 0644); err != nil { log.Fatal(err) } } diff --git a/exp/font/font_android.go b/exp/font/font_android.go index 3503ec991..bbc0f34e2 100644 --- a/exp/font/font_android.go +++ b/exp/font/font_android.go @@ -4,12 +4,12 @@ package font -import "io/ioutil" +import "os" func buildDefault() ([]byte, error) { - return ioutil.ReadFile("/system/fonts/DroidSans.ttf") + return os.ReadFile("/system/fonts/DroidSans.ttf") } func buildMonospace() ([]byte, error) { - return ioutil.ReadFile("/system/fonts/DroidSansMono.ttf") + return os.ReadFile("/system/fonts/DroidSansMono.ttf") } diff --git a/exp/font/font_linux.go b/exp/font/font_linux.go index f0beb34b5..c0f00c88d 100644 --- a/exp/font/font_linux.go +++ b/exp/font/font_linux.go @@ -6,13 +6,13 @@ package font -import "io/ioutil" +import "os" func buildDefault() ([]byte, error) { // Try Noto first, but fall back to Droid as the latter was deprecated - noto, nerr := ioutil.ReadFile("/usr/share/fonts/truetype/noto/NotoSans-Regular.ttf") + noto, nerr := os.ReadFile("/usr/share/fonts/truetype/noto/NotoSans-Regular.ttf") if nerr != nil { - if droid, err := ioutil.ReadFile("/usr/share/fonts/truetype/droid/DroidSans.ttf"); err == nil { + if droid, err := os.ReadFile("/usr/share/fonts/truetype/droid/DroidSans.ttf"); err == nil { return droid, nil } } @@ -21,9 +21,9 @@ func buildDefault() ([]byte, error) { func buildMonospace() ([]byte, error) { // Try Noto first, but fall back to Droid as the latter was deprecated - noto, nerr := ioutil.ReadFile("/usr/share/fonts/truetype/noto/NotoMono-Regular.ttf") + noto, nerr := os.ReadFile("/usr/share/fonts/truetype/noto/NotoMono-Regular.ttf") if nerr != nil { - if droid, err := ioutil.ReadFile("/usr/share/fonts/truetype/droid/DroidSansMono.ttf"); err == nil { + if droid, err := os.ReadFile("/usr/share/fonts/truetype/droid/DroidSansMono.ttf"); err == nil { return droid, nil } } diff --git a/exp/sprite/portable/affine_test.go b/exp/sprite/portable/affine_test.go index 4b98e7c44..943a81267 100644 --- a/exp/sprite/portable/affine_test.go +++ b/exp/sprite/portable/affine_test.go @@ -9,7 +9,6 @@ import ( "image/color" "image/draw" "image/png" - "io/ioutil" "math" "os" "runtime" @@ -147,7 +146,7 @@ func TestAffineMask(t *testing.T) { } func writeTempPNG(prefix string, m image.Image) (string, error) { - f, err := ioutil.TempFile("", prefix+"-") + f, err := os.CreateTemp("", prefix+"-") if err != nil { return "", err } diff --git a/gl/dll_windows.go b/gl/dll_windows.go index 1afc5f8ef..b7a0d90ee 100644 --- a/gl/dll_windows.go +++ b/gl/dll_windows.go @@ -10,7 +10,6 @@ import ( "debug/pe" "fmt" "io" - "io/ioutil" "log" "net/http" "os" @@ -18,7 +17,7 @@ import ( "runtime" ) -var debug = log.New(ioutil.Discard, "gl: ", log.LstdFlags) +var debug = log.New(io.Discard, "gl: ", log.LstdFlags) func downloadDLLs() (path string, err error) { url := "https://dl.google.com/go/mobile/angle-bd3f8780b-" + runtime.GOARCH + ".tgz" @@ -54,11 +53,11 @@ func downloadDLLs() (path string, err error) { } switch header.Name { case "angle-" + runtime.GOARCH + "/libglesv2.dll": - bytesGLESv2, err = ioutil.ReadAll(tr) + bytesGLESv2, err = io.ReadAll(tr) case "angle-" + runtime.GOARCH + "/libegl.dll": - bytesEGL, err = ioutil.ReadAll(tr) + bytesEGL, err = io.ReadAll(tr) case "angle-" + runtime.GOARCH + "/d3dcompiler_47.dll": - bytesD3DCompiler, err = ioutil.ReadAll(tr) + bytesD3DCompiler, err = io.ReadAll(tr) default: // skip } if err != nil { @@ -70,13 +69,13 @@ func downloadDLLs() (path string, err error) { } writeDLLs := func(path string) error { - if err := ioutil.WriteFile(filepath.Join(path, "libglesv2.dll"), bytesGLESv2, 0755); err != nil { + if err := os.WriteFile(filepath.Join(path, "libglesv2.dll"), bytesGLESv2, 0755); err != nil { return fmt.Errorf("gl: cannot install ANGLE: %v", err) } - if err := ioutil.WriteFile(filepath.Join(path, "libegl.dll"), bytesEGL, 0755); err != nil { + if err := os.WriteFile(filepath.Join(path, "libegl.dll"), bytesEGL, 0755); err != nil { return fmt.Errorf("gl: cannot install ANGLE: %v", err) } - if err := ioutil.WriteFile(filepath.Join(path, "d3dcompiler_47.dll"), bytesD3DCompiler, 0755); err != nil { + if err := os.WriteFile(filepath.Join(path, "d3dcompiler_47.dll"), bytesD3DCompiler, 0755); err != nil { return fmt.Errorf("gl: cannot install ANGLE: %v", err) } return nil @@ -152,7 +151,7 @@ func chromePath() string { } for _, installdir := range installdirs { - versiondirs, err := ioutil.ReadDir(installdir) + versiondirs, err := os.ReadDir(installdir) if err != nil { continue } diff --git a/gl/gendebug.go b/gl/gendebug.go index 7e3d5a2a6..b04e3ca28 100644 --- a/gl/gendebug.go +++ b/gl/gendebug.go @@ -18,7 +18,6 @@ import ( "go/parser" "go/printer" "go/token" - "io/ioutil" "log" "os" "strconv" @@ -835,7 +834,7 @@ func main() { os.Stdout.Write(b) return } - if err := ioutil.WriteFile(*outfile, b, 0666); err != nil { + if err := os.WriteFile(*outfile, b, 0666); err != nil { die(err) } } diff --git a/internal/binres/binres_test.go b/internal/binres/binres_test.go index 06259b420..fecefaca4 100644 --- a/internal/binres/binres_test.go +++ b/internal/binres/binres_test.go @@ -10,7 +10,6 @@ import ( "encoding/xml" "errors" "fmt" - "io/ioutil" "log" "math" "os" @@ -108,7 +107,7 @@ func compareBytes(a, b []byte) error { } func TestBootstrap(t *testing.T) { - bin, err := ioutil.ReadFile("testdata/bootstrap.bin") + bin, err := os.ReadFile("testdata/bootstrap.bin") if err != nil { log.Fatal(err) } @@ -218,7 +217,7 @@ func TestEncode(t *testing.T) { t.Fatal(err) } - bin, err := ioutil.ReadFile("testdata/bootstrap.bin") + bin, err := os.ReadFile("testdata/bootstrap.bin") if err != nil { log.Fatal(err) } diff --git a/internal/binres/genarsc.go b/internal/binres/genarsc.go index 7d975cb8d..f05963646 100644 --- a/internal/binres/genarsc.go +++ b/internal/binres/genarsc.go @@ -12,8 +12,8 @@ package main import ( "fmt" - "io/ioutil" "log" + "os" "strconv" "golang.org/x/mobile/internal/binres" @@ -34,7 +34,7 @@ func main() { if err != nil { log.Fatal(err) } - if err := ioutil.WriteFile("arsc.go", []byte(fmt.Sprintf(tmpl, strconv.Quote(string(arsc)))), 0644); err != nil { + if err := os.WriteFile("arsc.go", []byte(fmt.Sprintf(tmpl, strconv.Quote(string(arsc)))), 0644); err != nil { log.Fatal(err) } } From a2a15c67f36f571f501e0a86d5a7f5f26e3fd201 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Thu, 5 Jun 2025 16:30:03 -0700 Subject: [PATCH 64/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I6a7818fa8c394792210b206020093b415c87484e Reviewed-on: https://go-review.googlesource.com/c/mobile/+/679222 Reviewed-by: Dmitri Shuralyov Auto-Submit: Gopher Robot Reviewed-by: David Chase LUCI-TryBot-Result: Go LUCI --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index d3a3ceefb..c4f0bbf58 100644 --- a/go.mod +++ b/go.mod @@ -17,10 +17,10 @@ godebug gotypesalias=0 require ( golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.27.0 - golang.org/x/mod v0.24.0 - golang.org/x/sync v0.14.0 - golang.org/x/tools v0.33.0 + golang.org/x/image v0.28.0 + golang.org/x/mod v0.25.0 + golang.org/x/sync v0.15.0 + golang.org/x/tools v0.34.0 ) require golang.org/x/sys v0.33.0 // indirect diff --git a/go.sum b/go.sum index 093fbf4e8..d118a5160 100644 --- a/go.sum +++ b/go.sum @@ -2,13 +2,13 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.27.0 h1:C8gA4oWU/tKkdCfYT6T2u4faJu3MeNS5O8UPWlPF61w= -golang.org/x/image v0.27.0/go.mod h1:xbdrClrAUway1MUTEZDq9mz/UpRwYAkFFNUslZtcB+g= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= -golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= -golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/image v0.28.0 h1:gdem5JW1OLS4FbkWgLO+7ZeFzYtL3xClb97GaUzYMFE= +golang.org/x/image v0.28.0/go.mod h1:GUJYXtnGKEUgggyzh+Vxt+AviiCcyiwpsl8iQ8MvwGY= +golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= +golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= +golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= -golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= +golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= +golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= From d5bb5ecc55c03634c30adcf688f9a2482006dcb0 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Fri, 11 Jul 2025 10:26:19 -0700 Subject: [PATCH 65/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I3b596cf026073a7b222102df5f52a8757de6376c Reviewed-on: https://go-review.googlesource.com/c/mobile/+/687556 Reviewed-by: Dmitri Shuralyov Auto-Submit: Gopher Robot Reviewed-by: David Chase LUCI-TryBot-Result: Go LUCI --- example/ivy/go.mod | 9 ++++----- example/ivy/go.sum | 48 ++++++++++------------------------------------ go.mod | 16 ++++++++++------ go.sum | 28 +++++++++++++++------------ 4 files changed, 40 insertions(+), 61 deletions(-) diff --git a/example/ivy/go.mod b/example/ivy/go.mod index 7b4640ba4..fb88a4f6f 100644 --- a/example/ivy/go.mod +++ b/example/ivy/go.mod @@ -3,13 +3,12 @@ module golang.org/x/mobile/example/ivy go 1.23.0 require ( - golang.org/x/mobile v0.0.0-20210924032853-1c027f395ef7 + golang.org/x/mobile v0.0.0-20250606033058-a2a15c67f36f robpike.io/ivy v0.2.7 ) require ( - golang.org/x/mod v0.4.2 // indirect - golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect - golang.org/x/tools v0.1.2 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + golang.org/x/mod v0.26.0 // indirect + golang.org/x/sync v0.16.0 // indirect + golang.org/x/tools v0.35.0 // indirect ) diff --git a/example/ivy/go.sum b/example/ivy/go.sum index bd42ab121..026100533 100644 --- a/example/ivy/go.sum +++ b/example/ivy/go.sum @@ -1,40 +1,12 @@ -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20210924032853-1c027f395ef7 h1:CyFUjc175y/mbMjxe+WdqI72jguLyjQChKCDe9mfTvg= -golang.org/x/mobile v0.0.0-20210924032853-1c027f395ef7/go.mod h1:c4YKU3ZylDmvbw+H/PSvm42vhdWbuxCzbonauEAP9B8= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +golang.org/x/mobile v0.0.0-20250606033058-a2a15c67f36f h1:/n+PL2HlfqeSiDCuhdBbRNlGS/g2fM4OHufalHaTVG8= +golang.org/x/mobile v0.0.0-20250606033058-a2a15c67f36f/go.mod h1:ESkJ836Z6LpG6mTVAhA48LpfW/8fNR0ifStlH2axyfg= +golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= +golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= +golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= robpike.io/ivy v0.2.7 h1:XVYgWSm7THVm1bk1jfRBB9xhso459T22gbpotHbhk7M= robpike.io/ivy v0.2.7/go.mod h1:6B/DGaft5rvYiF7MgCTiZAAvH5W7vtu0eS2BW77updo= diff --git a/go.mod b/go.mod index c4f0bbf58..29ed63eab 100644 --- a/go.mod +++ b/go.mod @@ -16,11 +16,15 @@ go 1.23.0 godebug gotypesalias=0 require ( - golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/image v0.28.0 - golang.org/x/mod v0.25.0 - golang.org/x/sync v0.15.0 - golang.org/x/tools v0.34.0 + golang.org/x/exp/shiny v0.0.0-20250620022241-b7579e27df2b + golang.org/x/image v0.29.0 + golang.org/x/mod v0.26.0 + golang.org/x/sync v0.16.0 + golang.org/x/tools v0.35.0 + golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated ) -require golang.org/x/sys v0.33.0 // indirect +require ( + golang.org/x/sys v0.34.0 // indirect + golang.org/x/tools/go/expect v0.1.0-deprecated // indirect +) diff --git a/go.sum b/go.sum index d118a5160..38819f9fa 100644 --- a/go.sum +++ b/go.sum @@ -1,14 +1,18 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg= -golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0= -golang.org/x/image v0.28.0 h1:gdem5JW1OLS4FbkWgLO+7ZeFzYtL3xClb97GaUzYMFE= -golang.org/x/image v0.28.0/go.mod h1:GUJYXtnGKEUgggyzh+Vxt+AviiCcyiwpsl8iQ8MvwGY= -golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= -golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= -golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= -golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= -golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= -golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= +golang.org/x/exp/shiny v0.0.0-20250620022241-b7579e27df2b h1:zELBzk+7ERc6m8BxhzU2VYjp03wlEvi+cIgYQR5H3CI= +golang.org/x/exp/shiny v0.0.0-20250620022241-b7579e27df2b/go.mod h1:ygj7T6vSGhhm/9yTpOQQNvuAUFziTH7RUiH74EoE2C8= +golang.org/x/image v0.29.0 h1:HcdsyR4Gsuys/Axh0rDEmlBmB68rW1U9BUdB3UVHsas= +golang.org/x/image v0.29.0/go.mod h1:RVJROnf3SLK8d26OW91j4FrIHGbsJ8QnbEocVTOWQDA= +golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= +golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= +golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= +golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= +golang.org/x/tools/go/expect v0.1.0-deprecated h1:jY2C5HGYR5lqex3gEniOQL0r7Dq5+VGVgY1nudX5lXY= +golang.org/x/tools/go/expect v0.1.0-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= +golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= +golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= From 395d808d53cdcc50f14b84fcb8049ba2c6427a69 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Thu, 7 Aug 2025 14:39:34 -0700 Subject: [PATCH 66/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I4db05e8462d9487db3885e73c35c9945afbee462 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/694003 Reviewed-by: Dmitri Shuralyov Reviewed-by: David Chase Auto-Submit: Gopher Robot LUCI-TryBot-Result: Go LUCI --- example/ivy/go.mod | 6 +++--- example/ivy/go.sum | 12 ++++++------ go.mod | 12 ++++++------ go.sum | 24 ++++++++++++------------ 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/example/ivy/go.mod b/example/ivy/go.mod index fb88a4f6f..8c82200da 100644 --- a/example/ivy/go.mod +++ b/example/ivy/go.mod @@ -3,12 +3,12 @@ module golang.org/x/mobile/example/ivy go 1.23.0 require ( - golang.org/x/mobile v0.0.0-20250606033058-a2a15c67f36f + golang.org/x/mobile v0.0.0-20250711185624-d5bb5ecc55c0 robpike.io/ivy v0.2.7 ) require ( - golang.org/x/mod v0.26.0 // indirect + golang.org/x/mod v0.27.0 // indirect golang.org/x/sync v0.16.0 // indirect - golang.org/x/tools v0.35.0 // indirect + golang.org/x/tools v0.36.0 // indirect ) diff --git a/example/ivy/go.sum b/example/ivy/go.sum index 026100533..d0dffbcda 100644 --- a/example/ivy/go.sum +++ b/example/ivy/go.sum @@ -1,12 +1,12 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -golang.org/x/mobile v0.0.0-20250606033058-a2a15c67f36f h1:/n+PL2HlfqeSiDCuhdBbRNlGS/g2fM4OHufalHaTVG8= -golang.org/x/mobile v0.0.0-20250606033058-a2a15c67f36f/go.mod h1:ESkJ836Z6LpG6mTVAhA48LpfW/8fNR0ifStlH2axyfg= -golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= -golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= +golang.org/x/mobile v0.0.0-20250711185624-d5bb5ecc55c0 h1:Z6EFcPz8e1cx0ge5jWCwqafndPjdsDQf8fk4Kw3pJoI= +golang.org/x/mobile v0.0.0-20250711185624-d5bb5ecc55c0/go.mod h1:kqVs191xxTTCd39tk8zK1UD3jyCS1SPrMHTpJ9ujxZg= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= -golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= robpike.io/ivy v0.2.7 h1:XVYgWSm7THVm1bk1jfRBB9xhso459T22gbpotHbhk7M= robpike.io/ivy v0.2.7/go.mod h1:6B/DGaft5rvYiF7MgCTiZAAvH5W7vtu0eS2BW77updo= diff --git a/go.mod b/go.mod index 29ed63eab..100b3b24c 100644 --- a/go.mod +++ b/go.mod @@ -16,15 +16,15 @@ go 1.23.0 godebug gotypesalias=0 require ( - golang.org/x/exp/shiny v0.0.0-20250620022241-b7579e27df2b - golang.org/x/image v0.29.0 - golang.org/x/mod v0.26.0 + golang.org/x/exp/shiny v0.0.0-20250718183923-645b1fa84792 + golang.org/x/image v0.30.0 + golang.org/x/mod v0.27.0 golang.org/x/sync v0.16.0 - golang.org/x/tools v0.35.0 + golang.org/x/tools v0.36.0 golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated ) require ( - golang.org/x/sys v0.34.0 // indirect - golang.org/x/tools/go/expect v0.1.0-deprecated // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/tools/go/expect v0.1.1-deprecated // indirect ) diff --git a/go.sum b/go.sum index 38819f9fa..7d8d61f56 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,18 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -golang.org/x/exp/shiny v0.0.0-20250620022241-b7579e27df2b h1:zELBzk+7ERc6m8BxhzU2VYjp03wlEvi+cIgYQR5H3CI= -golang.org/x/exp/shiny v0.0.0-20250620022241-b7579e27df2b/go.mod h1:ygj7T6vSGhhm/9yTpOQQNvuAUFziTH7RUiH74EoE2C8= -golang.org/x/image v0.29.0 h1:HcdsyR4Gsuys/Axh0rDEmlBmB68rW1U9BUdB3UVHsas= -golang.org/x/image v0.29.0/go.mod h1:RVJROnf3SLK8d26OW91j4FrIHGbsJ8QnbEocVTOWQDA= -golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= -golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= +golang.org/x/exp/shiny v0.0.0-20250718183923-645b1fa84792 h1:YkeFUC3wFzzmWTi5lYbb5af46Tpk9DLWHXXwGjLF3R0= +golang.org/x/exp/shiny v0.0.0-20250718183923-645b1fa84792/go.mod h1:DUdAjGCS1V5oj0c1HZTX5UNuMxBjfxuU/NIoy/wuiRw= +golang.org/x/image v0.30.0 h1:jD5RhkmVAnjqaCUXfbGBrn3lpxbknfN9w2UhHHU+5B4= +golang.org/x/image v0.30.0/go.mod h1:SAEUTxCCMWSrJcCy/4HwavEsfZZJlYxeHLc6tTiAe/c= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= -golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= -golang.org/x/tools/go/expect v0.1.0-deprecated h1:jY2C5HGYR5lqex3gEniOQL0r7Dq5+VGVgY1nudX5lXY= -golang.org/x/tools/go/expect v0.1.0-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= +golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= +golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= From f12310a0cfd915e168e0cced7198eb3cd73aba76 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Wed, 13 Aug 2025 14:21:47 +0000 Subject: [PATCH 67/68] all: upgrade go directive to at least 1.24.0 [generated] By now Go 1.25.0 has been released, and Go 1.23 is no longer supported per the Go Release Policy (see https://go.dev/doc/devel/release#policy). For golang/go#69095. [git-generate] (cd example/ivy && go get go@1.24.0 && go mod tidy && go fix ./... && go mod edit -toolchain=none) (cd . && go get go@1.24.0 && go mod tidy && go fix ./... && go mod edit -toolchain=none) Change-Id: I8ffd5cb5db1f3551a42787652d09b11a0f75c5c6 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/695418 Reviewed-by: Dmitri Shuralyov Auto-Submit: Gopher Robot LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase --- example/ivy/go.mod | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/ivy/go.mod b/example/ivy/go.mod index 8c82200da..73d1e436b 100644 --- a/example/ivy/go.mod +++ b/example/ivy/go.mod @@ -1,6 +1,6 @@ module golang.org/x/mobile/example/ivy -go 1.23.0 +go 1.24.0 require ( golang.org/x/mobile v0.0.0-20250711185624-d5bb5ecc55c0 diff --git a/go.mod b/go.mod index 100b3b24c..7f80d1e03 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module golang.org/x/mobile -go 1.23.0 +go 1.24.0 // The modern go/types type checker produces types.Alias // types for the explicit representation of type aliases. From 6912353760cf05c80a2c20d05cfba571cb0e66fa Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Wed, 10 Sep 2025 09:39:30 -0700 Subject: [PATCH 68/68] go.mod: update golang.org/x dependencies Update golang.org/x dependencies to their latest tagged versions. Change-Id: I9aa173472d2e4fa473db62bfdbe180633ae06b1e Reviewed-on: https://go-review.googlesource.com/c/mobile/+/702040 Auto-Submit: Gopher Robot LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase Reviewed-by: Dmitri Shuralyov --- example/ivy/go.mod | 8 ++++---- example/ivy/go.sum | 16 ++++++++-------- go.mod | 12 ++++++------ go.sum | 24 ++++++++++++------------ 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/example/ivy/go.mod b/example/ivy/go.mod index 73d1e436b..b2c46d604 100644 --- a/example/ivy/go.mod +++ b/example/ivy/go.mod @@ -3,12 +3,12 @@ module golang.org/x/mobile/example/ivy go 1.24.0 require ( - golang.org/x/mobile v0.0.0-20250711185624-d5bb5ecc55c0 + golang.org/x/mobile v0.0.0-20250813145510-f12310a0cfd9 robpike.io/ivy v0.2.7 ) require ( - golang.org/x/mod v0.27.0 // indirect - golang.org/x/sync v0.16.0 // indirect - golang.org/x/tools v0.36.0 // indirect + golang.org/x/mod v0.28.0 // indirect + golang.org/x/sync v0.17.0 // indirect + golang.org/x/tools v0.37.0 // indirect ) diff --git a/example/ivy/go.sum b/example/ivy/go.sum index d0dffbcda..8c60bdb85 100644 --- a/example/ivy/go.sum +++ b/example/ivy/go.sum @@ -1,12 +1,12 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -golang.org/x/mobile v0.0.0-20250711185624-d5bb5ecc55c0 h1:Z6EFcPz8e1cx0ge5jWCwqafndPjdsDQf8fk4Kw3pJoI= -golang.org/x/mobile v0.0.0-20250711185624-d5bb5ecc55c0/go.mod h1:kqVs191xxTTCd39tk8zK1UD3jyCS1SPrMHTpJ9ujxZg= -golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= -golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= -golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= -golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= -golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= +golang.org/x/mobile v0.0.0-20250813145510-f12310a0cfd9 h1:tf0OY/FXi1sPkoNVKP4w+GStqIfqbFUqDoDDm4B+iCg= +golang.org/x/mobile v0.0.0-20250813145510-f12310a0cfd9/go.mod h1:wNiuiJfmmgv45sw8EHpNeVWqpxLeEwQ8bkUIhuOYUh8= +golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U= +golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= +golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= robpike.io/ivy v0.2.7 h1:XVYgWSm7THVm1bk1jfRBB9xhso459T22gbpotHbhk7M= robpike.io/ivy v0.2.7/go.mod h1:6B/DGaft5rvYiF7MgCTiZAAvH5W7vtu0eS2BW77updo= diff --git a/go.mod b/go.mod index 7f80d1e03..b7f2f9847 100644 --- a/go.mod +++ b/go.mod @@ -16,15 +16,15 @@ go 1.24.0 godebug gotypesalias=0 require ( - golang.org/x/exp/shiny v0.0.0-20250718183923-645b1fa84792 - golang.org/x/image v0.30.0 - golang.org/x/mod v0.27.0 - golang.org/x/sync v0.16.0 - golang.org/x/tools v0.36.0 + golang.org/x/exp/shiny v0.0.0-20250819193227-8b4c13bb791b + golang.org/x/image v0.31.0 + golang.org/x/mod v0.28.0 + golang.org/x/sync v0.17.0 + golang.org/x/tools v0.37.0 golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated ) require ( - golang.org/x/sys v0.35.0 // indirect + golang.org/x/sys v0.36.0 // indirect golang.org/x/tools/go/expect v0.1.1-deprecated // indirect ) diff --git a/go.sum b/go.sum index 7d8d61f56..f8cbd894c 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,17 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -golang.org/x/exp/shiny v0.0.0-20250718183923-645b1fa84792 h1:YkeFUC3wFzzmWTi5lYbb5af46Tpk9DLWHXXwGjLF3R0= -golang.org/x/exp/shiny v0.0.0-20250718183923-645b1fa84792/go.mod h1:DUdAjGCS1V5oj0c1HZTX5UNuMxBjfxuU/NIoy/wuiRw= -golang.org/x/image v0.30.0 h1:jD5RhkmVAnjqaCUXfbGBrn3lpxbknfN9w2UhHHU+5B4= -golang.org/x/image v0.30.0/go.mod h1:SAEUTxCCMWSrJcCy/4HwavEsfZZJlYxeHLc6tTiAe/c= -golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= -golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= -golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= -golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= -golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= -golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= +golang.org/x/exp/shiny v0.0.0-20250819193227-8b4c13bb791b h1:OeyDhfAaNf4u4sBKDtc4k1iKGYngpGDa1L/1Ch049HA= +golang.org/x/exp/shiny v0.0.0-20250819193227-8b4c13bb791b/go.mod h1:QnFR+evpZFrYgSiu+d/Rn6g/6bNqLQTp+rzKaVpFoeI= +golang.org/x/image v0.31.0 h1:mLChjE2MV6g1S7oqbXC0/UcKijjm5fnJLUYKIYrLESA= +golang.org/x/image v0.31.0/go.mod h1:R9ec5Lcp96v9FTF+ajwaH3uGxPH4fKfHHAVbUILxghA= +golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U= +golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= +golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= +golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM=