1
0
mirror of https://github.com/golang/go synced 2024-11-18 20:14:43 -07:00
Commit Graph

1141 Commits

Author SHA1 Message Date
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
Robert Griesemer
776a9335ce go.tools/go/types: fix typo in comment
TBR=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/135960043
2014-08-28 14:57:53 -07:00
Robert Griesemer
289e96cc26 go.tools/go/types: no errors for x.(T) where T is an interface
Also: Added Config.Strict flag to enable type checker tests
      beyond the Go 1 specification.

Fixes golang/go#8561.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/134050043
2014-08-28 14:03:10 -07:00
Alan Donovan
cd5b7ff318 go/ssa/interp: add intrinsic for runtime.environ, recently added.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/135120043
2014-08-28 16:56:49 -04:00
Chris Manghane
86df324d65 dashboard: quote metacharacters when searching for gcc commits
LGTM=adg
R=adg
CC=golang-codereviews, iant
https://golang.org/cl/131420043
2014-08-28 13:50:29 -07:00
Robert Griesemer
5dca7d8bd1 go.tools/go/types: LookupFieldOrMethod checks method set
LookupFieldOrMethod now also decides whether a found
method is actually in the method set. Simplifies call
sites. Added corresponding API tests.

TODO (separate CL): Decide what the correct value for
the indirect result should be (as required for code
generation). For now, the result value for indirect
is unchanged from before if a field/method is found.

Fixes golang/go#8584.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/132260043
2014-08-28 13:03:13 -07:00
Robert Griesemer
87b4cd993d go.tools/go/types: don't crash dealing with unknown constants
Also: Better tracing for top-level declarations.

Fixes golang/go#8518.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/132310043
2014-08-28 12:17:30 -07:00
Andrew Gerrand
61ce470a5e go.tools/dashboard/app: fix column order for -temp builders
LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/138760044
2014-08-28 10:57:52 +10:00
Brad Fitzpatrick
f34e673079 dashboard/env: add nacl-386 and nacl-amd64p32 builders
LGTM=adg
R=adg, dave
CC=golang-codereviews
https://golang.org/cl/136830043
2014-08-27 00:10:16 -07:00
Oling Cat
5a1d3be754 go.tools/godoc/static/package.html: remove extra tag; indent with tabs.
LGTM=gri
R=golang-codereviews, gobot, rsc, gri
CC=golang-codereviews
https://golang.org/cl/120380044
2014-08-26 13:22:54 -07:00
Oling Cat
e14fb0e1ee go.tools/godoc/static: indent with tabs.
LGTM=gri
R=golang-codereviews, gobot, gri
CC=golang-codereviews
https://golang.org/cl/120390043
2014-08-26 13:21:29 -07:00
Alan Donovan
4abc8436bc cmd/eg: add -beforeedit flag, which specifies a command to run before editing a file.
e.g. chmod +w, checkout.

Also: add a TIPS section to the documentation.

LGTM=crawshaw
R=crawshaw, gri
CC=golang-codereviews
https://golang.org/cl/136780044
2014-08-26 15:52:40 -04:00
Robert Griesemer
7486f5904a go.tools/go/types: added TODO re: misleading error message
Fix not urgent.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/135810043
2014-08-26 10:56:22 -07:00
Alan Donovan
4aaa1f6f6c go/ssa/interp: fix intrinsics for (*runtime.Func) methods.
They changed when they were ported to Go in CL
https://golang.org/cl/124300044.

LGTM=crawshaw
R=gri, crawshaw
CC=golang-codereviews
https://golang.org/cl/136780043
2014-08-26 11:48:15 -04:00
Alan Donovan
067a2992ee go/pointer: fix runtime.startTimer intrinsic.
The test broke because the actual behaviour of time.startTimer changed in
https://golang.org/cl/129480043.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/131280043
2014-08-26 11:08:45 -04:00
Brad Fitzpatrick
cd6dcd8cb5 dashboard/env: fix 32-bit builds
(Fix from adg)

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/136760043
2014-08-26 00:41:41 -07:00
Andrew Gerrand
cb487641b8 go.tools/dashboard: fix integration test
LGTM=dvyukov
R=dvyukov
CC=golang-codereviews
https://golang.org/cl/126700043
2014-08-26 17:34:24 +10:00
Brad Fitzpatrick
eb8b4b0d41 dashboard: start of Dockeritization of Linux builders
Good checkpoint. Can now do builds by hand.

Next step is coordinator server in front of this, and things
to fire up beefy GCE instances running CoreOS and each build
in its own Docker container. See README for how to do a single
build.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/134870043
2014-08-26 00:33:19 -07:00
Andrew Gerrand
51353854a4 go.tools/dashboard: display "-temp" builders last
LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/133000043
2014-08-26 14:49:16 +10:00