1
0
mirror of https://github.com/golang/go synced 2024-10-01 01:38:33 -06:00
Commit Graph

1362 Commits

Author SHA1 Message Date
Alan Donovan
47f2109c64 go/ssa: slight simplification to setCallFunc
Change-Id: I6b8cc35f779910ebab3db9994bb17456a6df4b94
Reviewed-on: https://go-review.googlesource.com/2742
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-01-13 17:32:58 +00:00
Peter Collingbourne
d3e7567302 go/loader: introduce PackageCreated hook
PackageCreated is a hook called when a types.Package
is created but before it has been populated.

The package's import Path() and Scope() are defined,
but not its Name() since no package declaration has
been seen yet.

Clients may use this to insert synthetic items into
the package scope, for example.

Change-Id: I210a0c4c766f03f715f03f26d5cd765f15f56e04
Reviewed-on: https://go-review.googlesource.com/2138
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-01-13 15:48:33 +00:00
Peter Collingbourne
4f8578d2c0 astutil: move to go/ast/astutil
Change-Id: I9a45bfc07613eb2210081d306d71f0a4d152eda5
Reviewed-on: https://go-review.googlesource.com/2592
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-01-13 15:47:47 +00:00
Tw
230eaff9cf cmd/benchcmp: close file when parse done
prevent file descriptor leak

Signed-off-by: Tw <tw19881113@gmail.com>

Change-Id: Ia1cacb3a287477b1f9b50fae248b5c34156c9557
Reviewed-on: https://go-review.googlesource.com/2740
Reviewed-by: Rob Pike <r@golang.org>
2015-01-13 09:03:36 +00:00
Brad Fitzpatrick
996ff9bec3 dashboard/env: update Linux builders to contain Go 1.4 for GOROOT_BOOTSTRAP
Change-Id: I256168d1bbe542ae78e4c1e7c4879d2b62b74c7e
Reviewed-on: https://go-review.googlesource.com/2690
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-13 01:43:41 +00:00
Rob Pike
682ca03389 vet: improve validation of struct tags
Actually parse the strings to check them more accurately.
The particular problem it missed was that it didn't check
for control characters in the key. The only valid separator
is a space.

More tests.

Fixes #9500

Change-Id: Ib547e11c7e8d47d81eb8b1e8f1ab9c26174933df
Reviewed-on: https://go-review.googlesource.com/2685
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-12 23:15:16 +00:00
Alan Donovan
86040b7505 go/types: close scope for each "select" case after its body
Classic Go pitfall: "defer" in a loop does not do what you might expect.

+ test case

Fixes issue 9570
Fixes issue 9569

Change-Id: Iec05420872ef71190083a7192f76c92f54f4a2a1
Reviewed-on: https://go-review.googlesource.com/2655
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-01-12 18:04:11 +00:00
Andrew Gerrand
4ed956ea27 cmd/tipgodoc: kill old process as we switch over
Change-Id: I0d311b479441d1a359f953466e4ff93f3397c52d
Reviewed-on: https://go-review.googlesource.com/2630
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-12 02:54:00 +00:00
Brad Fitzpatrick
d79e0375a0 dashboard/builder: pass GOROOT_BOOTSTRAP to child processes
Part of https://golang.org/s/go15bootstrap

This is one step in a series of CLs to make the dev.cc branch build
after https://golang.org/cl/2470 (which converted cmd/dist from C to
Go)

TBR to adg because subsequent changes to Dockerfiles depend on knowing
the commit hash of this one.

Change-Id: I26122e2446c345446bbbca0df601f50ea9383adb
Reviewed-on: https://go-review.googlesource.com/2651
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-11 18:38:01 +00:00
Dmitri Shuralyov
c10e262955 go/vcs: fix bug in remote package discovery
The parser was assuming it would find <body> or </head>.
If the entire response is just <meta> tags, it finds EOF and
treats that as an error. It's not.

This is the same change as in https://golang.org/cl/68520044.

Fixes #9556.

Change-Id: If51ed36e7364c15788311039caf8323eb5fe9a6c
Reviewed-on: https://go-review.googlesource.com/2650
Reviewed-by: Minux Ma <minux@golang.org>
2015-01-10 08:10:09 +00:00
Brad Fitzpatrick
9468e480c8 dashboard/buildlet: add NetBSD-amd64 to Makefile
Update golang/go#8643

Change-Id: Ie60b87c447180a2a7f2411fcf8fece8035ddfa9d
Reviewed-on: https://go-review.googlesource.com/2602
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-09 18:12:52 +00:00
Brad Fitzpatrick
e083199384 dashboard/coordinator: notify dashboard when we're building
Fixes golang/go#9494

Change-Id: Ib9451d41b2dd02d30d2efddbc0ec410a34bdb42c
Reviewed-on: https://go-review.googlesource.com/2583
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-09 02:18:25 +00:00
Brad Fitzpatrick
5f779d76c1 dashboard/app: support for showing links to build-in-progress status
Update golang/go#9494

Change-Id: I849d9f8ed423d29daede167193704dbda26785b1
Reviewed-on: https://go-review.googlesource.com/2590
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-09 02:12:21 +00:00
Brad Fitzpatrick
968c2a1d60 dashboard/coordinator: rename plan9 builder to plan9-386-gcepartial
... because it's not running all the tests.

Updates golang/go#9491

Change-Id: I2f3e8d1c2cba1b014d59cd3adfe5e04bd5f74dae
Reviewed-on: https://go-review.googlesource.com/2524
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-09 02:12:04 +00:00
Brad Fitzpatrick
727ecd5ac4 dashboard/buildlet: set GOTESTONLY=std on plan9
This resulted in our first "ok" on the dashboard for Plan 9 with the
buildlet, in 19 minutes. It only runs the std tests, and nothing else
after that.

Update golang/go#9491

Change-Id: Iad77a594f83bfd3fa72596bcc3057645d9c9bb4c
Reviewed-on: https://go-review.googlesource.com/2523
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-09 02:11:53 +00:00
Andrew Gerrand
75337c43b3 cmd/tipgodoc: fix some nits
Change-Id: I54a98340ec2e5d54c2ca27b869c7f38b7cbfe2d7
Reviewed-on: https://go-review.googlesource.com/2536
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-09 00:28:10 +00:00
Andrew Gerrand
0e66a62615 cmd/tipgodoc: simplify Dockerfile and fix deployment
Change-Id: Ib2fd1346255467cb790a9e4c37d25f8e8ca136f5
Reviewed-on: https://go-review.googlesource.com/2534
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-09 00:21:14 +00:00
Jongmin Kim
dc0000626d cmd/present: fix unclosed section element
Change-Id: I974ec7a2caccfca3aff18836d6495597e17664e7
Reviewed-on: https://go-review.googlesource.com/2533
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-08 23:27:10 +00:00
Robert Griesemer
4fbaee50fd go/types: revert gofmt -s change to permit building with 1.3
Per request from dsymonds.

Change-Id: I1f034859880df0d8313d67da90457ac56459ed76
Reviewed-on: https://go-review.googlesource.com/2562
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Symonds <dsymonds@golang.org>
2015-01-08 20:27:41 +00:00
Josh Bleecher Snyder
962c79ce9f tools/astutil: clean up AddNamedImport token positions
Fixes golang/go#8729
Fixes golang/go#6884 (again)

Change-Id: Ic90319d9af7e2da9f3fda036f7e111725fc0572a
Reviewed-on: https://go-review.googlesource.com/2050
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-01-08 19:51:38 +00:00
Robert Griesemer
44ee65f545 go/types: don't allow f()... if f() is multi-valued
Also: Better position for error messages related to wrong use of ... .

Fixes #9473.

Change-Id: I90565f51a42897b7292f651a84a23611a5d8f359
Reviewed-on: https://go-review.googlesource.com/2390
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-01-08 18:10:12 +00:00
Robert Griesemer
4ad370efaa go/types: avoid follow-up error if composite literal type is unknown
Fixes #9182.

Change-Id: I7090e600e9981131db7f323e7ce6419017e95458
Reviewed-on: https://go-review.googlesource.com/2481
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-01-08 17:00:29 +00:00
David du Colombier
8ab2c33bea dashboard/env: add script to create Plan 9 386 GCE image
Update golang/go#9491

Change-Id: I219e2e071c0f58bf8c2b69c57b96a9114773c7b7
Reviewed-on: https://go-review.googlesource.com/2251
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-08 04:59:06 +00:00
Brad Fitzpatrick
d77725735e dashboard/coordinator: clean up trailer handling
This got lost before in my git stash stack.

Change-Id: Id73cdb89e73ab83c26971c6c1c4e0fc74d91018f
Reviewed-on: https://go-review.googlesource.com/2521
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-08 04:26:17 +00:00
Brad Fitzpatrick
47646d42a2 dashboard/buildlet: darwin support
Update golang/go#9495

Change-Id: I732cfdee952ad3bf0b3411d0ce45723900acedb4
Reviewed-on: https://go-review.googlesource.com/2472
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-08 04:26:01 +00:00
Péter Surányi
bd69d2dd34 cmd/godoc: mention examples feature in godoc
Godoc documentation did not mention the feature for showing example code
runnable by the testing package. Add a link to the testing package.

Update golang/go#9471

Change-Id: Ic15794c59732e9b0b42c5b16c60be0a47c41afa5
Reviewed-on: https://go-review.googlesource.com/2490
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-08 02:02:02 +00:00
Brad Fitzpatrick
2cd6e42cb2 dashboard/coordinator: clean up VMs more, fix watchVM bug, tweak plan 9 settings
Change-Id: I30609505cd3790f9e9505a4f020215de7b0ab74b
Reviewed-on: https://go-review.googlesource.com/2474
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-08 01:12:47 +00:00
Andrew Gerrand
af7d92a90f cmd/tipgodoc: record and report errors
Change-Id: I76c04c745367427cd3b474949d213e105f6b47c1
Reviewed-on: https://go-review.googlesource.com/2413
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-07 05:30:47 +00:00
Andrew Gerrand
57335a8a8f cover: accept inaccurate block endings
When cover is used with cgo packages, the coverage profile is produced
from the cgo-generated Go source files, so the profile will reference
line and column numbers from that generated source, even though it names
the original file.
This is okay in general because the cgo-generated Go source files are
very similar to the original, with one significant exception:
the original source may refer to C identifiers such as C.foo(), but the
cgo tool generates source that rewrites these mentions to something like
_Cfunc_foo.
This means that column numbers in coverage profiles might be higher than
they should be, so be lenient when interpreting them.

Update golang/go#9479

Change-Id: Ic3abef07471614101ce0c686d35b85e7e5e6a777
Reviewed-on: https://go-review.googlesource.com/2410
Reviewed-by: Rob Pike <r@golang.org>
2015-01-07 02:00:16 +00:00
Andrew Gerrand
c836fe615a cmd/godoc: add golang.org/x/playground custom import path
Change-Id: Ic399dbf8a77e7c61ba8be263515b13a6b488b4e9
Reviewed-on: https://go-review.googlesource.com/2309
Reviewed-by: Rob Pike <r@golang.org>
2015-01-06 02:12:10 +00:00
Dominik Honnef
0ff6678340 benchmark/parse, cmd/benchcmp: new package for parsing benchmarks
Move the parser for benchmark output from cmd/benchcmp into its own
package, benchmark/parse.

The majority of the change is just moving code around. Instead of
implementing the '-best' flag in ParseBenchSet, it is now implemented in
its own function 'selectBest' in cmd/benchcmp.

Bench.Ord (the ordinal position of a Bench within a BenchSet) has been
exported.

Change-Id: Id27032a220f9ff2596117b58b86243998695a804
Reviewed-on: https://go-review.googlesource.com/2102
Reviewed-by: Rob Pike <r@golang.org>
2015-01-06 01:34:08 +00:00
Brad Fitzpatrick
ac848a9536 dashboard/coordinator: use new dashboard JSON interface to find work
This uses the new JSON interface to the build dashboard (from
golang.org/cl/2290) to find all work, and re-enables the OpenBSD
builder[*], and can do multiple things at a time. Andrew and I just
watched it fire up 8 OpenBSD VMs at once to catch up.

[*] The OpenBSD builder was disabled because it would only report
results for the main repo, not subrepos, and the old
build.golang.org/todo interface didn't understand that was
possible. Now the steps are considered separate.

Update golang/go#8642 (OpenBSD)
Update golang/go#9492 (builds in VMs)

Change-Id: Ic6c2f73ee3da218dd54ef1a33f3afc97046ea3cc
Reviewed-on: https://go-review.googlesource.com/2282
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-05 22:24:23 +00:00
Brad Fitzpatrick
58c8b8a738 dashboard/coordinator: use VMs to run non-Linux builders
Currently this is running an OpenBSD amd64 builder, but other operating
systems are now easy.

Updates golang/go#8642
Updates golang/go#9492

Change-Id: I4e1026c49ee4d253dfcf78c7606767294784f02e
Reviewed-on: https://go-review.googlesource.com/2264
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-05 04:48:47 +00:00
Brad Fitzpatrick
026c0f4d1d dashboard/app: add a JSON output mode for the data on the front page
Fixes golang/go#9493

Change-Id: I4891abf530901c620c2923e9f2d3e3227dd7ced9
Reviewed-on: https://go-review.googlesource.com/2290
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-05 03:57:40 +00:00
Brad Fitzpatrick
dd517c42bc dashboard/buildlet: add Makefiles, and add Windows stage0 bootstrap binary
Change-Id: I69938af38fb5c45c01598e9171e851a1c29790bc
Reviewed-on: https://go-review.googlesource.com/2268
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-05 01:32:49 +00:00
Brad Fitzpatrick
e1019ed0e1 dashboard/env/windows: instructions for setting up a buildlet
Updates golang/go#8640

Change-Id: I3f0b10c237f437137ed46415d7cc443d4c6a419b
Reviewed-on: https://go-review.googlesource.com/2269
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-05 01:23:09 +00:00
Brad Fitzpatrick
938dd670d2 env/openbsd-amd64: install git, improve README
Updates golang/go#8642

Change-Id: Ia11faeafb96a325ff62dcf95fedb5a6489e41bd4
Reviewed-on: https://go-review.googlesource.com/2263
Reviewed-by: Minux Ma <minux@golang.org>
2015-01-03 03:00:18 +00:00
Brad Fitzpatrick
0a8eb31860 dashboard/coordinator: refactor status handling in prep for VM builders
Currently the coordinator only handles Docker container builders. An
upcoming change will add VM builders, running VMs on GCE for OpenBSD,
Plan 9, Windows, etc.

This change refactors the handling of the coordinator's build status
in prep for VM builders. Notably, it doesn't call "docker logs"
directly to get logs. It now keeps them in memory instead. Because
they're then in memory, we might as well make it keep the details of
the last N builds too, which we kept wanting earlier.

Updates #9492

Change-Id: I6bae4a5854e7efa3f8a6186ec3670a43c98c4df2
Reviewed-on: https://go-review.googlesource.com/2262
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-02 23:16:00 +00:00
Brad Fitzpatrick
005d2be0ba dashboard/coordinator: periodically clean stale VMs
This isn't used yet, but will be for the new-style builders (VMs on
GCE running the buildlet, started by the coordinator).

From the code's comments:

cleanUpOldVMs periodically enumerates virtual machines and deletes
any which have a "delete-at" attribute having a unix timestamp
before the current time. These VMs are created to run a single
build and should be shut down by a controlling process. Due to
various types of failures, they might get stranded. To prevent them
from getting stranded and wasting resources forever, we instead set
the "delete-at" metadata attribute on them when created to some
time that's well beyond their expected lifetime, and then this is
the backup mechanism to delete them if they get away.

Update golang/go#8639
Update golang/go#8640
Update golang/go#8642

Change-Id: I489e97926e7ab56487571c2bf0bd255cdf49570d
Reviewed-on: https://go-review.googlesource.com/2199
Reviewed-by: Burcu Dogan <jbd@google.com>
2015-01-02 18:48:53 +00:00
Emil Hessman
faf0ad1ad3 dashboard: update wiki links
The Go wiki has moved to GitHub. Update links to use a golang.org/wiki/... target.

Change-Id: Iff7e1b2add469318f5e467aed5d1f3e67155b283
Reviewed-on: https://go-review.googlesource.com/2250
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-02 15:43:28 +00:00
Peter Collingbourne
bcd5efa0ef go/types: make import check optional via a flag in types.Config
It is sometimes useful for API clients to be able to disable the unused
import check, although for good reason this should not be exposed as part of
a user-facing interface. There are at least two use cases that I am aware of:

1) It allows for automated test case reduction tools such as delta or C-Reduce
   to be more easily applied to type checker input. Disabling the check
   makes it possible for the tool to identify and remove code that depends
   on imported packages without any specific knowledge of Go, as the import
   need not be removed simultaneously with the code.

2) Interactive tools (such as REPLs) that may have previously received a
   list of imports and subsequently receive a line of code that may use any
   number of these imports. It is simpler for such tools to import all the
   packages in its list than to try to identify the correct set of imports.

Change-Id: I00091a4e5c8e1bd664efd82a636f255eaaa5a2db
Reviewed-on: https://go-review.googlesource.com/2136
Reviewed-by: Robert Griesemer <gri@golang.org>
2014-12-31 00:06:02 +00:00
Peter Collingbourne
6370cd3a8e go/types: modify Eval, EvalNode to return a TypeAndValue
The new interface makes the functions more useful by allowing clients to
check the various properties that TypeAndValue provides.

Change-Id: I8b41a27316081bea24a18ffe6fa1812e809d6f67
Reviewed-on: https://go-review.googlesource.com/2134
Reviewed-by: Robert Griesemer <gri@golang.org>
2014-12-30 17:21:45 +00:00
Alan Donovan
c1ef9c75bf cmd/gorename: make Usage documentation sensible in godoc
Fixes golang/go#9469

Change-Id: I74e19e3d095e4c2ab62f755a408f58fd5e7ac2f2
Reviewed-on: https://go-review.googlesource.com/2176
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2014-12-30 16:36:43 +00:00
Brad Fitzpatrick
d7ed24f138 dashboard/env/openbsd-amd64: typo and wording change
Review comments from Joel in https://golang.org/cl/2156

Change-Id: Ic3679d5c103b85f249f0ddcaceb29e50313f3a4f
Reviewed-on: https://go-review.googlesource.com/2190
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Joel Sing <jsing@google.com>
2014-12-30 04:59:37 +00:00
Brad Fitzpatrick
721bf87b5b dashboard/buildlet: make exec handler return process state in HTTP trailer
Requires Go tip to function, but compiles with old versions of Go, but
without returning the trailer, which we'll be able to detect in the
coordinator to make sure nobody used an old Go to cross-compile a
buildlet.

Change-Id: Ie5f71c0a4477563dea5f1526af10a49aa41536d6
Reviewed-on: https://go-review.googlesource.com/2159
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-30 04:59:04 +00:00
Brad Fitzpatrick
9c946b9540 dashboard/buildlet: start of the buildlet
This is the basics: untar a tar.gz file to a directory, and execute a
command.

Update golang/go#8639
Update golang/go#8640
Update golang/go#8642

Change-Id: I5917ed8bd0e4c2fdb4b3fab34ca929caca95cc8a
Reviewed-on: https://go-review.googlesource.com/2180
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-30 00:39:57 +00:00
Brad Fitzpatrick
b2523aab47 dashboard/env: add script to create OpenBSD GCE image
This is almost entirely the work of @mdempsky; I just ran
it a bunch and reported bugs or tweaked things until it worked
and booted the buildlet on GCE.

Update #8642

Change-Id: If5d50bcdf90bc6aa648472cc951ed1c53b46eef3
Reviewed-on: https://go-review.googlesource.com/2156
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-29 23:20:32 +00:00
Alan Donovan
538acf1c92 go/ssa: add position info to all Load/Store instructions
Was originally https://codereview.appspot.com/92880043/ by Richard Musiol.

Change-Id: If0b22cf962b94ef44edbac28a5e5af4acb950991
Reviewed-on: https://go-review.googlesource.com/2174
Reviewed-by: Robert Griesemer <gri@golang.org>
2014-12-29 23:03:32 +00:00
Alan Donovan
4f13714aca astutil: add Unparen utility, eliminating 7 copies.
Change-Id: I824328c275bd6198a57edd64bf72cb2cf0490a68
Reviewed-on: https://go-review.googlesource.com/2172
Reviewed-by: Chris Manghane <cmang@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2014-12-29 22:24:57 +00:00
Alan Donovan
43a6897047 go/ssa: simplify make([]T, len, k) to new([k]T)[:len] for constant k
+ test.

Change-Id: I0255e38a0f95af95a32dc1d9cf18b26db85af36f
Reviewed-on: https://go-review.googlesource.com/1519
Reviewed-by: Robert Griesemer <gri@golang.org>
2014-12-29 21:06:17 +00:00