Update golang.org/x dependencies to their latest tagged versions.
Change-Id: If52cbad4c257f528178b69638f0d1e1f2d5da810
Reviewed-on: https://go-review.googlesource.com/c/exp/+/626481
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
go get golang.org/x/tools@74c255b # CL 519295
go mod tidy
Pulling in the fix for unnecessary dependency on *types.StdSizes, which
is non guaranteed behavior.
Updates golang/go#62103
Change-Id: Ib9a4095d7fcacac5d377f0364aafc8709bb31033
Reviewed-on: https://go-review.googlesource.com/c/exp/+/520575
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Allow use of 1.20 and later features in exp.
Change-Id: I85792cdc98d789028ed4fa222aac1c6b922e8b0d
Reviewed-on: https://go-review.googlesource.com/c/exp/+/486800
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This fixes the failure in apidiff, so remove the test skip.
We also need to explicitly add a "go" line in the synthesized
go.mod for the test module.
Fixesgolang/go#56162.
Change-Id: Iae320af89eeca11f69bea1b0dfa86f342911973f
Reviewed-on: https://go-review.googlesource.com/c/exp/+/445576
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
The old version of tools broke apidiff on 1.20/tip, due to
the unified IR rollout.
Change-Id: If7294fe3b03797ca1c04ee6673eea7f9845ab753
Reviewed-on: https://go-review.googlesource.com/c/exp/+/425156
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Two changes were required to handle generic types.
First, the code that tries to establish a correspondence between two
types could see one types.Type value that came from the type
declaration, looking like this:
type Foo[T any]
and another types.Type value that came from a method argument or
return value, looking like this, with no constraint:
func (Foo[T]) ...
We were using types.Identical in this case, but that function
(rightly, according to its narrow definition) returns false
when given `Foo[T any]` and `Foo[T]`.
So I defined typesEquivalent, which is like types.Identical
but succeeds in the above case.
The second change was also to the establishCorrespondence method.
Previously, any two named types could correspond. With generics, that
isn't true if the types have different type parameters. Here we will
always have the full types, so we check that there are the same number
of type params and they have identical constraints. The type param
names don't matter.
Also, use cmp.Diff for TestChanges to make it easier to fix broken
tests.
Also, update the config for go/packages in the apidiff
command. Apparently there were breaking changes to that package that
made `apidiff -w` fail.
Also, fix a gorelease test because the output of apidiff has changed
for incompatible generic types.
Change-Id: I0a75eb43f3ce4b55748f86a2c33a1cea6d52b35d
Reviewed-on: https://go-review.googlesource.com/c/exp/+/411076
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jean de Klerk <deklerk@google.com>
Clean up dependencies after moving shiny, event, and jsonrpc2 to
separate modules.
For golang/go#37175
Change-Id: Ie72d0eb4b99a625f41615d6ce3bb5c8935eb11c4
Reviewed-on: https://go-review.googlesource.com/c/exp/+/386795
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Add an event handler for OpenTelemetry metrics.
The first time it sees an event.Metric, the handler creates a matching
otel instrument and caches it. On each call, it uses the instrument to
record the metric value.
Change-Id: I07d6f40601c7d2a801ed9fbe3cf7c24d5698f3f1
Reviewed-on: https://go-review.googlesource.com/c/exp/+/320350
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
Update the go version in go.mod to go1.18 so that generics are permitted.
For golang/go#45955
Change-Id: Id5ab52d38c465313c27506008aece9356d34e3c9
Reviewed-on: https://go-review.googlesource.com/c/exp/+/363434
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This will ignore gitignored files during the zip file creation, which means
gitignored files won't be included in the analysis.
Fixesgolang/go#37413
Change-Id: Id5df46408a48e0be53157d95333ef3c2e02765bc
Reviewed-on: https://go-review.googlesource.com/c/exp/+/341930
Trust: Jean de Klerk <deklerk@google.com>
Run-TryBot: Jean de Klerk <deklerk@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
The parent ID of the event is unused; the context is used to convey
information instead.
Change-Id: I03da0a6636182b3532d6f8139cfa2ee51106c3b0
Reviewed-on: https://go-review.googlesource.com/c/exp/+/320090
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
This CL has event adapters for the four most popular logging packages.
Each adapter constructs an event and exports it.
Sometimes an adapter must be configured with the exporter it will
write to (via a context), because the logging API doesn't support
contexts.
Change-Id: Ie570ef6db5d589bb4d4a01406d3accde8f6141b9
Reviewed-on: https://go-review.googlesource.com/c/exp/+/315549
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
This change was produced using 'go mod tidy -go=1.17'
with a go command built at CL 315210.
This activates lazy loading, and updates the go.mod file to maintain
the lazy-loading invariants (namely, including an explicit requirement
for every package transitively imported by the main module).
Note that this does *not* prevent users with earlier go versions from
successfully building packages from this module.
For golang/go#36460
Change-Id: I64ddb83af34fa634b1631743429c0f975dead83a
Reviewed-on: https://go-review.googlesource.com/c/exp/+/315451
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This enables the narrower "all" pattern described in
https://tip.golang.org/doc/go1.16#all-pattern,
eliminating some otherwise-unnecessary checksums.
For golang/go#36460
Change-Id: I6baee4c9d9f6dedca116ca9da14dd468e0d04b5d
Reviewed-on: https://go-review.googlesource.com/c/exp/+/315450
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Change-Id: I6be505fcd597266ef817ffa5a2894b0bd21645e0
Reviewed-on: https://go-review.googlesource.com/c/exp/+/311109
Trust: Ian Cottrell <iancottrell@google.com>
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Fixesgolang/go#37562
Change-Id: Ie02cfaa9efc8c8375481540e551ae38f19c3a2e8
Reviewed-on: https://go-review.googlesource.com/c/exp/+/288032
Trust: Jean de Klerk <deklerk@google.com>
Run-TryBot: Jean de Klerk <deklerk@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Remove build constraints for Intel architectures on macOS,
they're not needed. This fixes the build on M1 Macs.
Update to a newer version of the gl package with support
for darwin/arm64 that was added in CL 278779.
Fixesgolang/go#43237.
Change-Id: I813d6ec9656463caafcd2daa08986c1bee62433f
Reviewed-on: https://go-review.googlesource.com/c/exp/+/278761
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
The Objective-C BOOL type is defined as a signed char on on Intel-based
Mac computers, but on Apple silicon, it is defined as as a native bool.¹
This makes it hard to write portable Cgo code across darwin/amd64 and
darwin/arm64 ports. So, stop relying on it, and use the bool type from
<stdbool.h> instead.
Update to a newer version of the mtl package with a similar change.
¹ https://developer.apple.com/documentation/apple_silicon/addressing_architectural_differences_in_your_macos_code#3616879Fixesgolang/go#43221.
Change-Id: I63334dc646a8f9b74cd6a969eadf133cdbc84fb7
Reviewed-on: https://go-review.googlesource.com/c/exp/+/279293
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
This allows -base to be something like "latest" or "master".
Fixesgolang/go#37410Fixesgolang/go#37412
Change-Id: I1bdf26e6524518079298a977c7de702db11ed286
Reviewed-on: https://go-review.googlesource.com/c/exp/+/236598
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
If the -base flag is not set on the command line, it is now inferred
from the -version flag and available versions. If the -version flag is
given, the base version will be the highest available release version
lower than -version. Otherwise, the base version will be the highest
release version. Pre-release versions are not considered.
If there are no appropriate versions, and the release version is
unspecified or appears to be the first release (e.g., v0.1.0, v2.0.0),
the inferred base version will be "none" (meaning no comparison will
be made). Otherwise, an error will be shown.
Updates golang/go#26420
Change-Id: Iee45a4183f3e4a219c02a69b5d16a3cc5478644c
Reviewed-on: https://go-review.googlesource.com/c/exp/+/216078
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Update to a newer v3.3/glfw pseudo-version, which uses GLFW 3.3.2.
GLFW 3.3.2 includes a fix for glfw/glfw#1543 (go-gl/glfw#262),
which makes it possible to remove the workaround for it from mtldriver.
However, there is a new regression glfw/glfw#1649 (go-gl/glfw#272).
Fortunately, it's a smaller issue. Add a temporary workaround for it.
Also update comment in two internal packages. The upstream names were
modified in 11308bd612
to match the names used here.
Change-Id: I3199f16890efd539d62d8914b92260f8a614449a
Reviewed-on: https://go-review.googlesource.com/c/exp/+/220639
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
gorelease is an experimental tool that helps module authors avoid
common problems before releasing a new version of a module.
gorelease is intended to eventually be merged into the go command as
"go release".
Updates golang/go#26420
Change-Id: I23fbab171b2cb9f4598fa525ecef5dcf006dc7c4
Reviewed-on: https://go-review.googlesource.com/c/exp/+/197299
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
I've been working on a design doc for a lazy module loading algorithm,
and I want to be able to present examples as txtar archives (because
that's what the eventual integration tests will be anyway).
But I also want to be able to run the 'go' command interactively in
those archives (to figure out what the behavior today is and how it
would change), and if I decide that I need to change the example it
becomes tedious to edit it locally and then repackage it.
This change adds a minimal binary for constructing and unpacking
archives. The comment section (which is usually relevant to the test)
and the archive itself are passed on stdin and stdout, and files are
read or written relative to the working directory of the command. A
list of files and/or directories can be passed explicitly at creation
time (to bypass extraneous files such as Git metadata).
Since the cmd/go tests in many cases use paths relative to the $WORK
or $GOPATH variables, this binary expands shell variables during both
creation and extraction.
A similar set of utility programs can be found in
github.com/rogpeppe/go-internal/cmd. While those programs are useful,
they are somewhat more flag-intensive, do not support shell-escaped
paths or explicit file lists, and do not extract or accept comment
text on stdio and stdout.
Change-Id: Ibfd2f7b308151b5588bba14c9d66c59453fbdbe0
Reviewed-on: https://go-review.googlesource.com/c/exp/+/218498
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
GLFW v3.2 was old and started generating some warnings on macOS 10.15
Catalina (and warnings get upgraded to errors on builders). Update to
GLFW v3.3 that was recently released to resolve the problem.
There is a small regression affecting the newer version of GLFW that is
being tracked in issues https://github.com/glfw/glfw/issues/1543 and
https://github.com/go-gl/glfw/issues/262. It causes the application to
crash when glfwWaitEvents is called before the first window is opened:
$ go run -tags='example metal' .../shiny/example/basic
2019-11-25 22:19:24.715 basic[9412:69556] *** Assertion failure in -[NSApplication run], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1894.10.126/AppKit.subproj/NSApplication.m:3313
2019-11-25 22:19:24.715 basic[9412:69556] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSApp with wrong _running count'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff30503f53 __exceptionPreprocess + 250
1 libobjc.A.dylib 0x00007fff665c9835 objc_exception_throw + 48
2 CoreFoundation 0x00007fff3051f810 +[NSException raise:format:arguments:] + 88
3 Foundation 0x00007fff32bff5d1 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
4 AppKit 0x00007fff2d657ed3 -[NSApplication run] + 1007
5 basic 0x00000000040d473d _glfwPlatformCreateWindow + 77
6 basic 0x00000000040cd945 glfwCreateWindow + 485
7 basic 0x00000000040da71b _cgo_78603e0816ec_Cfunc_glfwCreateWindow + 43
8 basic 0x0000000004058430 runtime.asmcgocall + 112
)
libc++abi.dylib: terminating with uncaught exception of type NSException
SIGABRT: abort
PC=0x7fff67a7b49a m=0 sigcode=0
signal arrived during cgo execution
[...]
Work around it by waiting for the first window open request before
entering the main loop. That way, glfwWaitEvents is not called
before a window has been created, and the crash does not occur.
This temporary workaround can be removed after the bug is fixed.
Fixesgolang/go#35766
Updates go-gl/glfw#256
Updates glfw/glfw#1543
Updates go-gl/glfw#262
Change-Id: Ie9b15ab6632af39871d94993a3e3097ea798a7e2
Reviewed-on: https://go-review.googlesource.com/c/exp/+/208877
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
BREAKING CHANGE: If you have old files saved with -w, they will
no longer work.
When writing export data for a package, save the path of the package.
The export data format doesn't store this information. Previously
it didn't matter, because gcexportdata.Reader.Read would return
the package that was written. But since golang.org/cl/198742, that
is no longer true.
This was apidiff's bug, not gcexportdata's: for the path argument of
Read I was passing garbage (the filename) rather than the import path.
Read's doc doesn't specify what happens if you do that.
Also, update golang.org/x/tools to latest.
Fixesgolang/go#34849.
Change-Id: I9d590270a9c2bb1fcc6c9071d4a2ca82c85d84d6
Reviewed-on: https://go-review.googlesource.com/c/exp/+/200997
Reviewed-by: Jay Conrod <jayconrod@google.com>
This pulls in support for the latest cmd/compile export data format,
which is required for apidiff tests to pass when testing the latest
cmd/compile.
Change-Id: I6210f1a4a3d80c03c86c83405c68299ea10105ac
Reviewed-on: https://go-review.googlesource.com/c/exp/+/197800
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
We copied golang.org/x/exp/apidiff to x/tools a few months ago in
anticipation of developing gorelease in x/tools, which would depend on
apidiff.
We've decided to develop gorelease here in x/exp instead, which means
the copy in x/tools is no longer needed. This CL copies changes made
to the copy in x/tools since it was made. Another CL will delete the
copy in x/tools.
Change-Id: Ied79138616c2f3b2f49a0ee5ca95ff3179351354
Reviewed-on: https://go-review.googlesource.com/c/exp/+/197298
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
The OpenGL API has been deprecated on macOS as of version 10.14.¹
The replacement for OpenGL on macOS is the Metal API.² This change adds
the start of a Metal API-based shiny driver. It can be activated by
specifying the -tags=metal build tag on macOS 10.13+. For example:
go run -tags='example metal' golang.org/x/exp/shiny/example/icongallery
The goal of this CL has been to create an MVP. As a result, the focus is
on simplicity and correctness. Performance optimizations can come later.
The Metal API is currently used only to present the final pixels to
the screen. All rendering is performed on the CPU via the image/draw
algorithms (see https://blog.golang.org/go-imagedraw-package).
Future work is to use mtl.Buffer, mtl.Texture, etc., to do more of
the rendering work on the GPU.
From what I've observed so far, the Metal API is looking to be a great
fit for implementing the screen.Screen interface. But we'll learn more
when it's used to a greater extent of its full performance potential.
GLFW v3.2.1 is used for window creation, receiving input events, etc.
Package dmitri.shuralyov.com/gpu/mtl is used for Metal API access.
Helper packages for Apple's Core Animation and AppKit APIs are copied.
References:
¹ https://developer.apple.com/documentation/macos_release_notes/macos_mojave_10_14_release_notes?language=objc#3035786
² https://developer.apple.com/metal/
Change-Id: I0e02d660b776820ca499bfe7d67e47a9866d530c
Reviewed-on: https://go-review.googlesource.com/c/exp/+/171025
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Green nodes are those picked by MVS, whilst gray nodes are those not picked.
Example output on the tools repo: https://user-images.githubusercontent.com/3584893/61019393-45338f80-a357-11e9-8d28-b06c41357c0f.png
This CL includes a refactor of the input into a graph: this is one part for
organization, and another part in preparation for cycle detection.
Change-Id: I2ff717642480270659640f098cdf509d479d3ca3
Reviewed-on: https://go-review.googlesource.com/c/exp/+/185657
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>