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

1454 Commits

Author SHA1 Message Date
Andrew Gerrand
491eb08564 go.tools/dashboard/watcher: commit watcher rewrite
LGTM=bradfitz
R=bradfitz, alex.brainman, dvyukov
CC=golang-codereviews
https://golang.org/cl/155730043
2014-10-06 16:32:41 +11:00
Andrew Gerrand
fcf4a08452 go.tools/dashboard/app: return specific error string on commit not found
TBR=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/153070043
2014-10-06 16:28:27 +11:00
Andrew Gerrand
51be54e32f go.tools/dashboard/app: show main repo commits with no build results
The UI template iterates over ResultGoHashes to display the Commit
rows. This was done for the sub-repository build view, where it
only makes sense to show a row when there's build data for it.

However, in the main page UI we do want to see if a commit has hit
the dashboard but has not yet been built.

This change causes the dashboard to show the commit row even if
there are no build results for it yet.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/153010043
2014-10-04 14:18:41 +10:00
Andrew Gerrand
4fb5eee0bd go.tools/dashboard/builder: fix build
TBR=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/151370044
2014-10-04 08:43:04 +10:00
Andrew Gerrand
fce07d6ae8 go.tools/dashboard/app: fix integration tests
They had been broken after a few recent changes.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/152150043
2014-10-04 08:33:52 +10:00
Andrew Gerrand
d322540ca7 go.tools/dashboard/builder: make old commit watcher opt-in and exclusive
Only gccgo should be using this now, and hopefully not for too long.
Turn it off by default, and make it the only thing that happens
when it's switched on.

LGTM=bradfitz, cmang
R=bradfitz, cmang
CC=golang-codereviews
https://golang.org/cl/153940043
2014-10-04 08:26:17 +10:00
Andrew Gerrand
8f69c6b2df go.tools/dashboard/app: require version=2 for commit updates
This will prevent older, buggy builders from posting commits.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/153930043
2014-10-04 08:25:32 +10:00
Dmitri Shuralyov
cccd43354a cmd/vet: fix bug where incorrect exit code was returned
Fixes golang/go#8792.

This is a simple change that fixes the issue. It may be desireable
to opt for a larger code change that makes this problem less likely
to be inadvertedly reintroduced in the future. For instance, a vetMain()
func can be used similar to gofmtMain(), or the os.Exit call can be
deferred.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/150850043
2014-10-02 10:33:35 -07:00
Chris Manghane
59d8afa26b dashboard/env: install necessary headers for linux-386-clang
LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/147420044
2014-10-01 16:40:04 -07:00
Chris Manghane
bcbfc883f4 dashboard: add linux-amd64-clang builder.
Fixes golang/go#8805.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/152790043
2014-10-01 11:57:02 -07:00
Robert Griesemer
a7f9d5d4f8 go/types: use file not parse order for init order computation
The type-checker depended on (token.Pos) position information of
the presented files to determine source order. That information
is determined by the parse order of the files rather than the
order in which the files are presented to the type-checker.

Introduced an order number strictly determined by the file
order as presented to the type-checker and the AST structure
of each file; thus providing source order information even in
the absence of (token.Pos) position information.

Added test case (provided by adonovan).

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/151160043
2014-10-01 09:56:28 -07:00
Alan Donovan
4fd305d5dc go/types: remove surplus (obsolete) lines from test expectation.
Also add assertion that there are no surplus lines.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/151890043
2014-09-30 12:12:40 -04:00
Chris Manghane
0e613cdb27 dashboard/env: optimize linux docker image size for gccgo
LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/141320043
2014-09-29 12:47:01 -07:00
Josh Bleecher Snyder
b6c30b58fc go.tools/imports: recognize exports in cgo files
Fixes golang/go#8815.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/143660044
2014-09-29 12:46:11 -07:00
Josh Bleecher Snyder
e62e5f9885 go.tools/cmd/vet: remove duplicate test file
In CL 145360043, I hg cp'd copylock.go to copylock_func.go instead of hg mv. Oops.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/143660043
2014-09-26 15:09:18 -07:00
Brad Fitzpatrick
51805171bd dashboard: add Debian sid builder
Update golang/go#8382

LGTM=rsc
R=adg, rsc
CC=golang-codereviews
https://golang.org/cl/150090044
2014-09-26 15:02:51 -07:00
Brad Fitzpatrick
aca3a63806 dashboard/coordinator: restore buildroot to /
So the optimization to avoid hg clone works again.  The
builder looks at buildroot+"goroot" for an hg clone repo. If
it finds it, it can just "hg pull" instead of a slow "hg
clone".

LGTM=cmang
R=cmang, proppy
CC=golang-codereviews
https://golang.org/cl/147960044
2014-09-26 12:21:08 -07:00
Robert Griesemer
6f764e19fa go/types: don't permit declarations in post statements
Plus better names for some internal objects.

Fixes golang/go#8804.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/149080043
2014-09-25 21:36:45 -07:00
Brad Fitzpatrick
29d9ef959c dashboard: more robust commit handler, and allow modifications
LGTM=rsc, adg
R=golang-codereviews, rsc, adg
CC=dvyukov, golang-codereviews
https://golang.org/cl/136540044
2014-09-25 18:06:17 -07:00
Alan Donovan
c80e5833f9 go/ssa/interp: fix fallout from recent runtime refactoring.
(It's not clear at what point a more robust solution would be worthwhile.)

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/142700043
2014-09-25 17:14:39 -04:00
Robert Griesemer
315249fc55 cmd/vet: provide access to externally defined types
Preliminaries for fixing issue 6212.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/145370043
2014-09-24 13:54:50 -07:00
Alan Donovan
3fc6159fa3 refactor/rename: attempt to fix windows test, 2nd attempt.
Windows doesn't regard "/go/src" as an absolute path,
so we must explicitly define the virtual IsAbsPath method.

LGTM=gri
R=gri, sameer
CC=golang-codereviews
https://golang.org/cl/147100043
2014-09-24 16:38:46 -04:00
Alan Donovan
a69ece7231 refactor/rename: attempt to fix windows build...
...by using buildutil.ContainingPackage instead of guessImportPath.
The former should be more portable.

(I meant to do this earlier, so this is also a nice cleanup.)

LGTM=gri
R=gri, sameer
CC=golang-codereviews
https://golang.org/cl/148050043
2014-09-24 16:18:58 -04:00
Brad Fitzpatrick
717118b6c8 dashboard: add builder with optimizations and inlining disabled
LGTM=josharian
R=josharian
CC=golang-codereviews
https://golang.org/cl/148060043
2014-09-24 12:54:59 -07:00
Josh Bleecher Snyder
2cd071c190 go.tools/cmd/vet: warn about copying locks in range statements
Fixes golang/go#8356.

LGTM=r
R=r, dsymonds
CC=golang-codereviews
https://golang.org/cl/145360043
2014-09-24 12:35:15 -07:00
Robert Griesemer
37dd89e3af go.tools/go/types: reduce spurious errors after missing identifiers
Fixes golang/go#8799.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/143560043
2014-09-24 11:09:05 -07:00
Alex Brainman
9cde9bdbd1 go.tools/dashboard/builder: try to recreate workpath if already exists
Fixes golang/go#8714.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/148010043
2014-09-24 12:59:42 +10:00
Brad Fitzpatrick
e06c202657 dashboard: use correct hg template for parents
The 'parents' field is documented to be blank if there's only one
simple parent. We want 'p1node', which is the hex commit of the
first parent.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/142530043
2014-09-23 14:56:02 -07:00
Alan Donovan
e94ae77171 refactor: minor no-op fixes
- fix typos and mistakes in docstrings, usage message and comments.
- remove 'backup' parameter to rewriteFile

LGTM=sameer
R=sameer
CC=golang-codereviews
https://golang.org/cl/147980043
2014-09-23 15:17:49 -04:00
Brad Fitzpatrick
f123f00fbc dashboard: add commit-only mode
Also add a added=true addition that I seemed to think was
previously missing.

Breaking this out of previous big CL.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/146080043
2014-09-23 11:22:54 -07:00
Alan Donovan
74021b4175 cmd/gorename: a precise, type-aware renaming tool for Go identifiers.
See the usage message in main.go for orientation.

To the best of my knowledge, the tool implements all required
soundness checks, except:
- the dynamic behaviour of reflection is obviously undecidable.
- it rejects method renamings that change the "implements" relation.
  It should probably be more aggressive.
- actually it only checks the part of the "implements" relation
  needed for compilation.  Understanding the dynamic behaviour
  of interfaces is obviously undecidable.
- a couple of minor gaps are indicated by TODO comments.

Also:
- Emacs integration.
- tests of all safety checks and (some) successful rewrites.

LGTM=dominik.honnef, sameer
R=gri, sameer, dominik.honnef
CC=golang-codereviews
https://golang.org/cl/139150044
2014-09-23 10:23:04 -04:00
Alan Donovan
aba8625c37 go.tools/go/buildutil: more utilities.
- ParseFile (core of go/loader's parseFiles(); also used by refactor/rename)
- ContainingPackage (core of Oracle's guessImportPath; also used by refactor/rename)
- Accessors for effective "methods" of build.Context:
  FileExists, OpenFile, IsAbsPath, JoinPath.

LGTM=sameer
R=dave, sameer
CC=golang-codereviews, gri
https://golang.org/cl/146120043
2014-09-23 10:20:48 -04:00
Alan Donovan
c90cb9e042 refactor/satisfy: enumerate interface satisfaction constraints induced by Go syntax.
The type checker does not currently report the set of pairs of
types that are tested for assignability (though gri and I
agree that it should).  This information is useful for many
applications.  For example, refactoring tool needs to know the
minimal set of interface satisfaction constraints that must be
preserved during a refactoring.

This package is a stopgap measure to deduce the same
information using another pass.  Unlike go/types, it is not
robust against inputs containing type errors.

LGTM=sameer
R=gri, sameer
CC=golang-codereviews
https://golang.org/cl/136470043
2014-09-22 16:19:29 -04:00
Alan Donovan
897f6677ae refactor/lexical: understand the structure of the lexical environment.
The Uses, Defs and Scope information provided by go/types is
inadequate for answering "what if?" queries about the
structure of the lexical environment.

In this code, for example,

        var x int

        func f() {
                print(x)
                x := ""
                print(x)
        }

the two referring Idents x appear at the same lexical depth,
inside the function f's Scope object, yet they resolve to
different objects.

This package associates a lexical.Environment instance with
every reference to capture these differences.  Each
environment is a linked list of enclosing Blocks, and for each
block, a number indicating what prefix of its bindings are
visible.  (Zero for the first 'x' reference above, 1 for the
second.)

+ Smoke test over stdlib.

This functionality could be integrated with the type checker
in lieu of the not-so-useful types.Info.Scopes data, at little
extra cost in code or in running time/space.  We should talk
about that.

LGTM=sameer
R=gri, sameer
CC=golang-codereviews
https://golang.org/cl/143790043
2014-09-19 13:11:01 -04:00
Alan Donovan
fec4d1f60d refactor/importgraph: add test of cycles
Nodes in a strongly connected component (which includes most
stdlib packages) appear in results of both "forward" and
"reverse" searches from any other node in the same SCC.

LGTM=sameer
R=sameer
CC=golang-codereviews, gri
https://golang.org/cl/136470044
2014-09-18 10:05:26 -04:00
Andrew Gerrand
520acf2e17 go.tools/dashboard/app: don't ignore field mismatch errors
This was a hold-over from when we removed install counts years ago.
All the Package entities are well-formed these days.

LGTM=dsymonds
R=dsymonds
CC=golang-codereviews
https://golang.org/cl/138620043
2014-09-18 18:07:02 +10:00
Alan Donovan
15e89a9a8c godoc/analysis: log one error per error package.
Previously type errors were reported via the web interface but
not logged, but this led to confusion as to why SSA
construction and/or pointer analysis were not attempted.

LGTM=gri
R=gri, bradfitz
CC=golang-codereviews
https://golang.org/cl/136660043
2014-09-16 16:24:52 -04:00
Robert Griesemer
9dcf670d50 go.tools/go/types: documentation follow-up
Added documentation per request in
https://golang.org/cl/108230044 .

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/137620044
2014-09-15 11:32:39 -07:00
Alan Donovan
f13b4c029c go.tools/go/ssa: fix a race condition in needMethodsOf.
Now all calls are serialized with a mutex.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/140600043
2014-09-15 14:01:54 -04:00
Alan Donovan
b94e29089b godoc: run bake.sh again.
CL 141540043 was half-baked.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/142130043
2014-09-15 13:13:07 -04:00
Alan Donovan
ebc87c5c5e godoc: fix bug in "internal call graph" tree widget.
Today I learned that getElementByClass returns an
HTMLContainer, not an array, so the for loop was iterating its
properties, which include:
- the methods of the type, which were filtered out by the condition;
- the array-like integer indices of the elements, which we want;
- the ids of the same elements (!), which we weren't expecting.
The net result is that various functions were called twice,
causing the tree to be double-populated and clicks to cause
and expand+collapse.

It's a miracle to me that any JS program even approximately works.

Fixes golang/go#8237

LGTM=bradfitz
R=gri, bradfitz
CC=golang-codereviews
https://golang.org/cl/141540043
2014-09-15 13:00:40 -04:00
Alan Donovan
1bd4ccf210 go/loader: clarify the nocgo check.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/144910043
2014-09-15 12:03:05 -04:00
Robert Griesemer
ab25303a78 go.tools/go/loader: disable test case to fix build
TBR=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/139650043
2014-09-12 20:29:27 -07:00
Robert Griesemer
f04d2c5c34 go.tools/go/importer: fix importer test for 32bit platforms
(The previous fix attempt didn't address all uses uses of
types.Config.Check.)

Fixes golang/go#8366.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/141430044
2014-09-12 08:17:14 -07:00
Andrew Gerrand
37340ffc2f go.tools/dashboard: use shorter notification template for cl updates
LGTM=dvyukov
R=dvyukov
CC=golang-codereviews
https://golang.org/cl/139320043
2014-09-12 11:14:03 +10:00
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