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

1209 Commits

Author SHA1 Message Date
Robert Griesemer
83560bf6db go.tools/go/importer: fix test (src/pkg -> src)
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/142010043
2014-09-11 15:22:30 -07:00
Alan Donovan
85a9565822 go/ssa: fix bug causing (manual) go/pointer stdlib test to crash.
The needMethods cache logic was wrong: it would treat any
previous call as a cache hit, even if 'skip' was true for that
call.  As a result it could fail to generate methods for some
'skip' types, i.e. anonymous structs.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/144750043
2014-09-11 18:08:33 -04:00
Alan Donovan
66176e290c go/buildutil: rename AllPackages{,List} -> {ForEachPackage,AllPackages}.
This CL is the first refactoring automated by "gorename". :)
Though I had to update the comments and run 'hg gofmt'.   :(

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/142930043
2014-09-11 14:33:37 -04:00
Alan Donovan
78aabae27e go.tools: eliminate three copies of the allPackages utility.
The one in godoc/analysis will have to wait.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/142860043
2014-09-11 14:14:53 -04:00
Alan Donovan
7de4da029c go/ssa/interp: exclude "runtime" from the list of initial packages in the test
It now has a main() function, which was confusing the logic to find the entry point.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/142860044
2014-09-11 13:31:05 -04:00
Alan Donovan
6c93dbff3e go.tools/godoc: deal with fallout from $GOROOT/src/pkg -> $GOROOT/src renaming.
To avoid breaking URLs, we redirect /src/pkg/* to /src/*.

The URL /pkg is now the "directory" /src, which triggers the
"Packages" index.

All other references to "src/pkg" are now gone,
except a number in the namespace documentation which are
probably still illustrative.

Tested: go test cmd/godoc godoc
        Manual inspection of src and src/pkg pages.
        with GOROOT and GOPATH packages
        -analysis
        /AUTHORS file URL still works

LGTM=bradfitz, adg
R=bradfitz, adg
CC=golang-codereviews
https://golang.org/cl/141770044
2014-09-10 09:02:54 -04:00
Alan Donovan
3cded4a933 refactor/importgraph: a utility for computing the import graph.
Refactoring tools can use this to determine an upper bound on
the set of packages potentially affected by a refactoring.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/141310043
2014-09-09 18:39:26 -04:00
Alan Donovan
77b9ff6df3 go.tools/go/buildutil: AllPackages: enumerate all packages in a Go workspace.
This function has been copied at least 6 times throughout
go.tools.  This implementation is superior since it does
all I/O through the virtualized go/build file system, and it
is highly parallel (and much faster).

We expose two flavours, simple (for existing tests) and
parallel (for high-performance tools such as gorename).

This CL creates the go/buildutil package, which is intended for
utilities related to go/build.

+ test.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/137430043
2014-09-09 18:39:14 -04:00
Rob Pike
e548cb3dfe go.tools/cmd/stringer: fix docs: stringer is not a "go tool"
Documentation change only. The binary will not be installed
using the "go tool" mechanism.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/133710046
2014-09-09 13:29:38 -07:00
Chris Manghane
84c740c8b6 dashboard/env: install dejagnu for gccgo's testsuite
LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/141860043
2014-09-09 10:56:30 -07:00
Chris Manghane
bbfe5adf96 coordinator: add support for different build dashboards
LGTM=bradfitz
R=bradfitz
CC=adg, golang-codereviews
https://golang.org/cl/135520043
2014-09-09 10:54:11 -07:00
Johan Euphrosine
afc3bf64c0 dashboard: optimize linux docker image size
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/132590043
2014-09-08 15:35:40 -07:00
Alan Donovan
159879b336 go.tools/imports: src/pkg -> src
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/141260043
2014-09-08 14:20:12 -04:00
Robert Griesemer
476d41c67b go.tools/go/types: better error messages
- for unused packages where base(package path) != package name
- for conflicts between imported packages or dot-imported objects
  and local declarations

Per suggestions from adonovan, inspired by the gc error messages.

LGTM=adonovan
R=adonovan, bradfitz
CC=golang-codereviews
https://golang.org/cl/135550043
2014-09-08 10:29:00 -07:00
Alan Donovan
9872f0d268 go.tools/*: replace $GOROOT/src/pkg with $GOROOT/src where appropriate.
(godoc is excluded from this CL since it will continue to use
/src/pkg in its URL namespace, making the necessary cleanup
more subtle.)

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/141770043
2014-09-08 13:24:38 -04:00
Andrew Gerrand
850afc6bb5 go.tools/dashboard/app: update CL threads with perf notifications
LGTM=dvyukov
R=dvyukov
CC=golang-codereviews, rsc
https://golang.org/cl/135460043
2014-09-08 15:46:41 +10:00
Alex Brainman
d39af6c903 go.tools/cmd/stringer: add .exe suffix to executable name in TestEndToEnd
Fixes windows build

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/140360043
2014-09-08 13:55:05 +10:00
Andrew Gerrand
96adaa5618 go.tools/godoc: remove Google+ buttons
LGTM=bradfitz
R=golang-codereviews, bradfitz, dsymonds
CC=golang-codereviews
https://golang.org/cl/138180043
2014-09-08 10:05:20 +10:00
Rob Pike
d03e8a67df go.tools/cmd/stringer: delete needless subtraction of zero in generated code
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/136270043
2014-09-05 17:05:28 -07:00
Rob Pike
d0448f16e3 go.tools/cmd/stringer: add end-to-end test that compiles, runs, and verifies the generated method
In the process, fix a bug in one of the method generators.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/141130043
2014-09-05 15:42:23 -07:00
Brad Fitzpatrick
d30a33e346 dashboard/builder: finish the previous -report=false change
We weren't using the *report flag enough.

LGTM=proppy
R=proppy
CC=golang-codereviews
https://golang.org/cl/132650043
2014-09-05 14:48:12 -07:00
Brad Fitzpatrick
cb318644df dashboard/builder: add -report=false flag for testing Docker images
LGTM=proppy
R=proppy
CC=golang-codereviews
https://golang.org/cl/138140043
2014-09-05 13:00:51 -07:00
Russ Cox
27a49c973b goimports: print \n at end of errors
LGTM=r
R=r
CC=bradfitz, golang-codereviews
https://golang.org/cl/136230045
2014-09-05 14:13:44 -04:00
Chris Manghane
f0c7ec0ef3 dashboard/env: add gccgo amd64 builder
LGTM=bradfitz
R=bradfitz
CC=adg, golang-codereviews
https://golang.org/cl/139250043
2014-09-05 11:08:15 -07:00
Brad Fitzpatrick
89759c3d1a dashboard/coordinator: set USER for the -nocgo builder
... since it already caught a problem and was fixed in
hg rev 0b99c2137ccc.

I pushed this live already just so don't get a whole column of
fail that might hide other issues. Real users have USER set
anyway. (Perhaps we should set it for all our builders?)

LGTM=adg
R=golang-codereviews
CC=adg, dave, golang-codereviews, minux
https://golang.org/cl/137180043
2014-09-04 17:48:56 -07:00
Brad Fitzpatrick
8c30c1b367 dashboard/env: add a cgo-disabled Linux builder
I think this is all that's needed?

Fixes golang/go#4795

LGTM=adg, dave
R=adg, dave
CC=golang-codereviews
https://golang.org/cl/138090043
2014-09-04 16:58:49 -07:00
Rob Pike
75b67f833e go.tools/cmd/stringer: fix generated map code
Missed comment from previous code review.
Next up: execution tests so this won't happen again

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/134480043
2014-09-04 16:18:38 -07:00
Rob Pike
22ede605a7 go.tools/cmd/stringer: use const for names, slice for map strings
Improve the generated code by using a const instead of a var for the names string.
This requires some refactoring to get neat const() and var() blocks.
Also change the generate map code go use a single sliced string, to reduce the
size of the compiled representation (only one string value).

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/135450044
2014-09-04 16:06:51 -07:00
Brad Fitzpatrick
a4e9bdfb20 dashboard/builder: set correct path to gcc
Otherwise when running -386 and -amd64 on the same machine
with both copies of TDM-GCC installed (the installer wizard lets
you choose which one, and you can do both options in two
different install attemps), one previously got this error when
using the 64-bit gcc with a 386 build:

--- FAIL: TestStdcallAndCDeclCallbacks (0.12s)
panic: Failed to load C:\Users\WINDOW~1\AppData\Local\Temp\1\TestCDeclCallback960696761\test.dll: %1 is not a valid Win32 application. [recovered]
       panic: Failed to load C:\Users\WINDOW~1\AppData\Local\Temp\1\TestCDeclCallback960696761\test.dll: %1 is not a valid Win32 application.

goroutine 81490 [running]:
runtime.panic(0x5b8c00, 0x1390d4e0)
        c:/gobuilder/windows-386-gce-b24422c8828f/go/src/pkg/runtime/panic.c:130 +0xed fp=0x12d99f78 sp=0x12d99f24
testing.func·006()
        c:/go/src/pkg/testing/testing.go:421 +0x147 fp=0x12d99fd0 sp=0x12d99f78
----- stack segment boundary -----
runtime.panic(0x5b8c00, 0x1390d4e0)
        c:/gobuilder/windows-386-gce-b24422c8828f/go/src/pkg/runtime/panic.c:98 +0x17a fp=0x12155e98 sp=0x12155e44
syscall.MustLoadDLL(0x1390b7c0, 0x4a, 0x2)
        c:/go/src/pkg/syscall/dll_windows.go:62 +0x6c fp=0x12155eb8 sp=0x12155e98
runtime_test.(*cbTest).run(0x12155f24, 0x1213cc00, 0x1390b7c0, 0x4a)
        c:/gobuilder/windows-386-gce-b24422c8828f/go/src/pkg/runtime/syscall_windows_test.go:399 +0x36 fp=0x12155ef4 sp=0x12155eb8
runtime_test.TestStdcallAndCDeclCallbacks(0x1213cc00)
        c:/gobuilder/windows-386-gce-b24422c8828f/go/src/pkg/runtime/syscall_windows_test.go:448 +0x28e fp=0x12155fac sp=0x12155ef4

TBR=cmang
R=cmang
CC=adg, golang-codereviews
https://golang.org/cl/141070043
2014-09-04 14:52:34 -07:00
Rob Pike
9207f67279 go.tools/cmd/stringer: add tests
Refactor a little to make testing easier.
Add golden tests and a check fo splitIntoRuns, which is the subtlest piece.
Still to come: execution tests.

Also fix a few issues in the generated code.

LGTM=gri
R=gri
CC=golang-codereviews, josharian
https://golang.org/cl/134450044
2014-09-04 14:16:59 -07:00
Brad Fitzpatrick
196bd6741e dashboard/builder: fallback to finding build keys from GCE metadata
LGTM=cmang
R=cmang
CC=adg, golang-codereviews
https://golang.org/cl/133610043
2014-09-04 13:46:24 -07:00
Yasuhiro Matsumoto
0673c34537 go.tools/cmd/stringer: Fix build on 32bit OSs.
LGTM=r
R=golang-codereviews, gri, r
CC=golang-codereviews
https://golang.org/cl/138040043
2014-09-04 10:51:38 -07:00
Robert Griesemer
de5d818681 go.tools/go/types: simplify LookupFieldOrMethod
Remove a 2nd lookup in some cases.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/136190043
2014-09-04 10:13:49 -07:00
Brad Fitzpatrick
710872e5c8 dashboard/coordinator: support reusing VM disk between boots
Creating a new disk is the major latency cost of creating a
new instance.  If we reuse a previous disk image, the VM and
CoreOS boot much quicker and start building again.

So add a mode where we don't mark the disk as delete-on-death
when we create it, and we search for a suitably-named existing
one on creation and try to reuse it.

It's a cache, essentially. It's still stateless.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/135410043
2014-09-04 07:10:07 -07:00
Brad Fitzpatrick
1481828125 dashboard/env: restore the periods after docker build
They're required but adg wanted them removed and I listened :)

TBR=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/136200043
2014-09-04 07:09:54 -07:00
Brad Fitzpatrick
c0bc9ba88d dashboard: add Cloud Storage upload support to create.go
Then make the coordinator and linux environment Makefiles have
an upload target. Amusingly, this actually worked: the Docker
images now tar + compress + upload over HTTP all in a stream,
without even knowing how large the resulting tar.gz will be until
it's done uploading.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/140200043
2014-09-03 21:41:16 -07:00
Rob Pike
2c5c896732 go.tools/cmd/stringer: new tool
This tool creates String methods from constant definitions.
It's a time-saver designed to be used from go generate.
The methods generated are efficient, more so than one
is likely to create by hand.

Given

        package date

        type Day int

        const (
                Monday Day = iota
                Tuesday
                Wednesday
                Thursday
                Friday
                Saturday
                Sunday
        )

the command

        stringer -type Day

will create the file day_string.go containing

        package date

        import "fmt"

        var (
                _Day_indexes = []uint8{6, 13, 22, 30, 36, 44, 50}
                _Day_names   = "MondayTuesdayWednesdayThursdayFridaySaturdaySunday"
        )

        func (i Day) String() string {
                if i < 0 || i >= Day(len(_Day_indexes)) {
                        return fmt.Sprintf("Day(%d)", i)
                }
                hi := _Day_indexes[i]
                lo := uint8(0)
                if i > 0 {
                        lo = _Day_indexes[i-1]
                }
                return _Day_names[lo:hi]
        }

There are several strategies for the created method chosen according to
the structure of the sequence of constants.

Handles integer types only, both signed and unsigned. That's probably
all that is needed.

Tests to follow, but the test structure will be large so sending this out
separately. The code has been heavily hand-tested but there are
some bugs. Don't depend on this until the tests are installed.

LGTM=gri
R=gri, josharian
CC=golang-codereviews
https://golang.org/cl/136180043
2014-09-03 17:27:48 -07:00
Brad Fitzpatrick
9f2fca72f6 dashboard: find static IP automatically, update images
Remove subversion & use newer version of the builder which
makes -verbose direct all.bash output to stdout/stderr.

LGTM=cmang
R=adg, cmang
CC=golang-codereviews
https://golang.org/cl/140910044
2014-09-03 17:15:00 -07:00
Rob Pike
1e11d05bd8 cmd/vet: simplify file-reading code per gri
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/140960043
2014-09-03 16:49:14 -07:00
Brad Fitzpatrick
867f4b09ae coordinator: new binary to run on GCE and manage Docker builds
See http://golang.org/s/builderplan (WIP doc)

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/131490043
2014-09-03 10:26:52 -07:00
Andrew Gerrand
a455c4c58e go.tools/dashboard/app: drop green coloring from perf dashboard
Fixes golang/go#8624.

LGTM=dave, aram
R=dvyukov, dave, aram
CC=golang-codereviews
https://golang.org/cl/140840043
2014-09-03 12:54:38 +10:00
Robert Griesemer
d7f2ea810f go.tools/go/types: document Config.Error better
LGTM=adonovan
R=adonovan, dsymonds
CC=golang-codereviews
https://golang.org/cl/137960044
2014-09-02 15:53:24 -07:00
Alan Donovan
79df80a148 go/ssa/interp: add no-op intrinsic for runtime.init().
Recent changes in the runtime caused the interpreter to call 'getg',
and it should never have gotten that far.

Also, delete bodies of "runtime" functions, since they're too magical.
This makes missing intrinsics cause very obvious failures.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/135330043
2014-09-02 18:40:16 -04:00
Alan Donovan
95bd0c4fdf go.tools/go/types: add (*PkgName).ImportedPackage method.
It returns the value formerly returned by Pkg(), i.e. the imported package.
Pkg() now returns the package enclosing the import statement,
which is consistent with all other Objects.

Fixes golang/go#8628.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/136090043
2014-09-02 18:12:08 -04:00
Dmitriy Vyukov
297fd8229c dashboard/app: actually learn noise levels
LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/135190043
2014-09-01 12:51:14 +04:00
Matt Jibson
59c8647562 go.tools/cmd/vet: detect suspicious shifts
LGTM=josharian, dsymonds, r
R=golang-codereviews, josharian, minux, dsymonds, dave, axwalk, adg, r
CC=golang-codereviews
https://golang.org/cl/134780043
2014-08-29 11:17:01 -07:00
Robert Griesemer
a4d1505cfc go.tools/go/types: remove Strict mode from API
Also: factor out shared code assertableTo.

LGTM=adonovan
R=adonovan, gordon.klaus
CC=golang-codereviews
https://golang.org/cl/139880043
2014-08-29 09:15:36 -07:00
David Symonds
2b15aa63b7 go.tools/cmd/vet: don't panic on zero arg Log method calls.
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/134000043
2014-08-29 08:56:35 +10:00
Robert Griesemer
4c3c0f68c5 go.tools/go/importer: use platform-specific word size in tests
Hopefully
Fixes golang/go#8366.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/138810043
2014-08-28 15:19:30 -07:00
Brad Fitzpatrick
cd91e8d096 dashboard/builder: modernize ancient exec wrappers
They were from a time before we had the os/exec package, if
memory serves.

Also, make verbose also mean that the main build's stdout
and stderr go to the real stdout and stderr as well.
I'll want that for the Docker-based builder.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/135000043
2014-08-28 14:58:15 -07:00