Consequently, remove many package Makefiles,
and shorten the few that remain.
gomake becomes 'go tool make'.
Turn off test phases of run.bash that do not work,
flagged with $BROKEN. Future CLs will restore these,
but this seemed like a big enough CL already.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5601057
Also delete gotest, since it's messy to fix and slated for deletion anyway.
A couple of things outside src can't be tested any more. "go test" will be
fixed and these tests will be re-enabled. They're noisy for now.
Fixes#284.
R=rsc
CC=golang-dev
https://golang.org/cl/5598049
The one time they recovered from anything they obscured a useful stack
trace. We're better off just crashing hard.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5577073
Includes gofix module. The only case not covered should be
xml.Unmarshal, since it remains with a similar interface, and
would require introspecting the type of its first argument
better.
Fixes#2626.
R=golang-dev, rsc, gustavo
CC=golang-dev
https://golang.org/cl/5574053
- use proper Win64 gcc calling convention when
calling initcgo on amd64
- increase g0 stack size to 64K on amd64 to make
it the same as 386
- implement C.sleep
- do not use C.stat, since it is renamed to C._stat by mingw
- use fopen to implement TestErrno, since C.strtol
always succeeds on windows
- skip TestSetEnv on windows, because os.Setenv
sets windows process environment, while C.getenv
inspects internal C runtime variable instead
R=golang-dev, vcc.163, rsc
CC=golang-dev
https://golang.org/cl/5500094
- the main changes are removing the Doc suffix
from the exported types, so instead of
doc.TypeDoc one will have doc.Type, etc.
- All exported types now have a Name (or Names) field.
For Values, the Names field lists all declared variables
or constants.
- Methods have additional information about where they are
coming from.
- There's a mode field instead of a bool to
control the package's operation, which makes
it easier to extend w/o API changes.
Except for the partially implemented new Method type,
this is based on existing code. A clean rewrite is in
progress based on this new API.
R=rsc, kevlar
CC=golang-dev
https://golang.org/cl/5528060
The domain returned by appengine.DefaultVersionHostname
isn't the one we want.
This change has been uploaded to build.golang.org
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5539043
Instead of syntax-tables, an extended go-mode-cs is used for
from a font-lock callback.
Cache invalidation must happen in a before-change-function
because font-lock runs in an after-change-function, potentially
before the cache invalidation takes place.
Performance is reasonable, even with src/pkg/html/entity.go
and test/fixedbugs/bug257.go.
Fixes#2330.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5529045
The go command lists all packages that were built.
A recent breakage notification included this text:
$ tail -100 < log
ok errors
ok exp/ebnf
? exp/ebnflint [no test files]
ok exp/gotype
ok exp/norm
ok exp/spdy
If the breakage occurred before this point it would
not be visible in the output.
R=golang-dev, gri, kevlar
CC=golang-dev
https://golang.org/cl/5504109
The two heading rows were previously a little hard to pick out,
because they were alternately shaded like the commit rows.
R=adg
CC=golang-dev
https://golang.org/cl/5500074
* group builders in to columns by OS
* drop builder suffix (moved to hover title)
* cut all domain names from email (full name+email in hover title)
* make ok smaller
This should easily give us room for netbsd and plan9,
even on small laptop screens.
Running at http://build-rsc.golang.org/.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5501064
This change doesn't pay attention to structs
so they still cannot be exported, see Issue 2552.
Fixes#2462.
R=dvyukov, rsc, iant
CC=golang-dev
https://golang.org/cl/5487058
The filetype needs to be set during BufRead in order for the did_filetype() check to prevent the file being detected as a conf file. One example where this can occur is if a cgo file has a #include at the top of the file. The # is detected in vim's generic configuration (conf file) toward the bottom of filetype.vim
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5496066
All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.
No attempt is made to use the new Append functions
even though there are definitely opportunities.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5447069
The installer now: allows a user to select an alternative
install directory, it now adds a Go folder to the Programs
Menu, and it places two shortcuts on the user's desktop.
The Program Menu folder contains shortcuts to the uninstaller
and two batch files, go.bat and godoc.bat. The desktop
shortcuts also point to go.bat and godoc.bat.
go.bat sets the Go environment, including Path, and spawns a
Window's shell. godoc.bat starts the godoc server at
localhost:6060 then spawns a browser window pointing to the
document server.
Setting the environment temporarily and spawning a shell, via
go.bat, should be safer than messing with the system's environment
and it makes the user experience a bit more streamlined.
The packager does work in its current state but it still needs
some polishing. And yes, the plan is to add a dialogue to allow
the user to decline the desktop shortcuts.
R=rsc, alex.brainman, tjyang2001
CC=golang-dev
https://golang.org/cl/5399042
I've been using this since April and posted it on the
mailing list, but it seems worth having in the repository.
Not sure about the location.
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5371100
Requesting suggestions for the comment and description strings in installer.wxs.
Fixes#2394.
R=rsc, alex.brainman, tjyang2001
CC=golang-dev
https://golang.org/cl/5339046
Fixes crash when cgo consumes more than 8K
of stack and makes a callback.
Fixes#1328.
R=golang-dev, rogpeppe, rsc
CC=golang-dev, mpimenov
https://golang.org/cl/5371042
If a frame has multiple windows then the windows must all be restored
after gofmt has finished and the old windows must be restored.
Before this fix, only the Go code edit window would be left.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5280050
There may be more fine-tuning down the line,
but this CL fixes the most pressing issue at
hand.
Also: gofmt -w src misc
Fixes#1524.
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4975053
Also standardize on 'utf8' as encoding name.
Apparently either is acceptable.
The user, because it is a StringProperty,
must be of type unicode in order to handle
Unicode correctly. It must *not* have type string.
The desc, because it is a BlobProperty, must
be of type string in order to handle Unicode correctly.
It must *not* have type unicode.
Yay encoding type pedantry without static typing.
R=adg, mattn.jp
CC=golang-dev
https://golang.org/cl/4973045
It's a balance between fetching too much
and falling far enough behind that you can't
catch up. We missed 20 commits in a row
when the builders were down for a few days.
This gives us a little more leeway.
R=adg
CC=golang-dev
https://golang.org/cl/4936047
Allocate Defer on stack during cgo calls, as suggested
by dvyukov. Also includes some comment corrections.
benchmark old,ns/op new,ns/op
BenchmarkCgoCall 669 330
(Intel Xeon CPU 1.80GHz * 4, Linux 386)
R=dvyukov, rsc
CC=golang-dev
https://golang.org/cl/4910041
It's already in old/template; make that build.
Update a couple of references to point to the old template.
They can be updated later.
Update goplay to use exp/template.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4902046
This is just moving the URL code from package http into its own package,
which has been planned for a while.
Besides clarity, this also breaks a nascent dependency cycle the new template
package was about to introduce.
Add a gofix module, url, and use it to generate changes outside http and url.
Sadness about the churn, gladness about some of the naming improvements.
R=dsymonds, bradfitz, rsc, gustavo, r
CC=golang-dev
https://golang.org/cl/4893043
When the C API being used includes multiple names for the same
underlying symbol (e.g. multiple #define's for the same variable), then
cgo will generate the same placeholder variables for each name. This
then prevents the code from compiling due to multiple declarations of
the same variable - so change cgo to only create one instance of the
variable for the underlying symbol.
R=rsc
CC=golang-dev
https://golang.org/cl/4826055
This permits full URLs to be shown on the dashboard,
not just the repository roots.
This has been tested.
R=rsc, mattn.jp
CC=golang-dev
https://golang.org/cl/4627081
Change the signature of Split to have no count,
assuming a full split, and rename the existing
Split with a count to SplitN.
Do the same to package bytes.
Add a gofix module.
R=adg, dsymonds, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/4661051
This replaces most the map[string][]string usage with
a new Values type name, with the usual methods.
It also changes client.PostForm to take a Values, rather
than a map[string]string, closing a TODO in the code.
R=rsc
CC=golang-dev
https://golang.org/cl/4532123
1) runLog to return err==nil if program runs, but returns exitcode!=0;
2) runLog to return err!=nil when fails to create log file;
3) print failed program name, not just "all.bash".
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4532117
This removes exec.Run and replaces exec.Cmd with a
new implementation. The new exec.Cmd represents
both a currently-running command and also a command
being prepared. It has a good zero value.
You can Start + Wait on a Cmd, or simply Run it.
Start (and Run) deal with copying stdout, stdin,
and stderr between the Cmd's io.Readers and
io.Writers.
There are convenience methods to capture a command's
stdout and/or stderr.
R=r, n13m3y3r, rsc, gustavo, alex.brainman, dsymonds, r, adg, duzy.chan, mike.rosset, kevlar
CC=golang-dev
https://golang.org/cl/4552052
Contains common links & a smart text box that recognizes various
identifiers and jumps to one of:
* issue URL,
* codereview URL,
* commit URL,
* package docs
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4553058
This appears to have been a long-standing formatting bug.
The test cases has misformatted golden files.
Applied gofmt -w src misc .
Fixes#1839.
R=iant
CC=golang-dev
https://golang.org/cl/4515113
This uses a fully custom function for indenting Go code in Vim.
It provides a lot more flexibility than a cindent-based approach,
so this version gets the := operator correct, as well as switch
labels and jump labels.
One outstanding TODO is to handle lines immediately after jump labels.
R=adg, n13m3y3r, jnwhiteh, dchest, rsc, rlight2
CC=golang-dev, rivercheng
https://golang.org/cl/4534047
This CL:
-- removes Response.RequestMethod string
-- adds Response.Request *Request
-- removes the finalURL result parameter from client.Get()
-- adds a gofix rule for callers of http.Get which assign
the final url to the blank identifier; warning otherwise
Caller who did:
res, finalURL, err := http.Get(...)
now need to do:
res, err := http.Get(...)
if err != nil {
...
}
finalURL := res.Request.URL.String()
R=rsc
CC=golang-dev
https://golang.org/cl/4535056
In the new world, one builder runs
gobuilder -commit
which uploads information about commits to the dashboard,
which then hands the work out to the builders by hash.
There is no assumption anymore that the commit numbers
are consistent across builders.
New builders will need to be deployed. For now darwin-amd64
is running the new builder to test the code.
The new JSON-based protocol for handing out work via /todo
should be easy to extend if we want to add support for sending
trial CLs to the builders.
This code is already running on godashboard.appspot.com.
R=adg, dave
CC=golang-dev
https://golang.org/cl/4519047
The new gotest ignores Test functions outside *_test.go files
(the old shell script allowed them), so replace one clumsy hack
with another.
The root problem is that the package makefiles only know
how to run cgo for source files in the package proper, not
for test files. Making it work for test files is probably more
trouble than it's worth.
R=bradfitz
CC=golang-dev
https://golang.org/cl/4452060
Will fill dashboard down the screen instead of up
when builders get stuck and resume. Already live.
Also delete dead benchmark code.
I think it is safe to say that if/when we bring
benchmarks back, we will use a different
data model.
Fixes#1228.
R=adg
CC=golang-dev
https://golang.org/cl/4449059
Fmt command filters the current Go buffer through gofmt.
It tries to preserve cursor position and avoids replacing
the buffer with stderr output.
R=golang-dev, dsymonds, niemeyer
CC=golang-dev
https://golang.org/cl/4382053
The changes were not tested for real in an App Engine environment,
so extra care should be taken. That said, some static testing
was done with pyflakes, and a few existent problems were fixed on
the way.
R=adg
CC=golang-dev
https://golang.org/cl/4378053
We replace the current Open with:
OpenFile(name, flag, perm) // same as old Open
Open(name) // same as old Open(name, O_RDONLY, 0)
Create(name) // same as old Open(name, O_RDWR|O_TRUNC|O_CREAT, 0666)
This CL includes a gofix module and full code updates: all.bash passes.
(There may be a few comments I missed.)
The interesting packages are:
gofix
os
Everything else is automatically generated except for hand tweaks to:
src/pkg/io/ioutil/ioutil.go
src/pkg/io/ioutil/tempfile.go
src/pkg/crypto/tls/generate_cert.go
src/cmd/goyacc/goyacc.go
src/cmd/goyacc/units.y
R=golang-dev, bradfitzwork, rsc, r2
CC=golang-dev
https://golang.org/cl/4357052
Change M-x gofmt to display errors in a new buffer instead of
clobbering the current buffer.
Add gofmt-before-save, which runs gofmt when in go-mode. This
can be used with before-save-hook. Add to your .emacs:
(add-hook 'before-save-hook 'gofmt-before-save)
R=rsc, aclements, amdragon
CC=golang-dev
https://golang.org/cl/4276059
* Change use of m->g0 stack (aka scheduler stack).
* Provide runtime.mcall(f) to invoke f() on m->g0 stack.
* Replace scheduler loop entry with runtime.mcall(schedule).
Runtime.mcall eliminates the need for fake scheduler states that
exist just to run a bit of code on the m->g0 stack
(Grecovery, Gstackalloc).
The elimination of the scheduler as a loop that stops and
starts using gosave and gogo fixes a bad interaction with the
way cgo uses the m->g0 stack. Cgo runs external (gcc-compiled)
C functions on that stack, and then when calling back into Go,
it sets m->g0->sched.sp below the added call frames, so that
other uses of m->g0's stack will not interfere with those frames.
Unfortunately, gogo (longjmp) back to the scheduler loop at
this point would end up running scheduler with the lower
sp, which no longer points at a valid stack frame for
a call to scheduler. If scheduler then wrote any function call
arguments or local variables to where it expected the stack
frame to be, it would overwrite other data on the stack.
I realized this possibility while debugging a problem with
calling complex Go code in a Go -> C -> Go cgo callback.
This wasn't the bug I was looking for, it turns out, but I believe
it is a real bug nonetheless. Switching to runtime.mcall, which
only adds new frames to the stack and never jumps into
functions running in existing ones, fixes this bug.
* Move cgo-related code out of proc.c into cgocall.c.
* Add very large comment describing cgo call sequences.
* Simpilify, regularize cgo function implementations and names.
* Add test suite as misc/cgo/test.
Now the Go -> C path calls cgocall, which calls asmcgocall,
and the C -> Go path calls cgocallback, which calls cgocallbackg.
The shuffling, which affects mainly the callback case, moves
most of the callback implementation to cgocallback running
on the m->curg stack (not the m->g0 scheduler stack) and
only while accounted for with $GOMAXPROCS (between calls
to exitsyscall and entersyscall).
The previous callback code did not block in startcgocallback's
approximation to exitsyscall, so if, say, the garbage collector
were running, it would still barge in and start doing things
like call malloc. Similarly endcgocallback's approximation of
entersyscall did not call matchmg to kick off new OS threads
when necessary, which caused the bug in issue 1560.
Fixes#1560.
R=iant
CC=golang-dev
https://golang.org/cl/4253054
In line with other functions such as Fprintf, put the
thing to be written first.
Apologies for the breakages this is sure to cause.
R=rsc, gri, adg, eds, r2, aam
CC=golang-dev
https://golang.org/cl/4169042
This aligns the naming scheme with the testing package and
also lets govet work on more logging calls.
R=rsc
CC=golang-dev
https://golang.org/cl/4001048
This change fixes the import plugin so that the
defined commands are available when opening a new
Go buffer from within Vim itself.
R=adg, rsc
CC=golang-dev
https://golang.org/cl/3998053
Forcing the synchronization of 500 lines is both slower and
less precise than searching for a known sync point.
Unfortunately, though, the way to synchronize correctly is
using the grouphere instruction, which has a bug.
I've already proposed the fix to Vim, so future releases
should have this working. We can continue using the 500 lines
syncing for now.
This change just documents the proper way to sync.
R=adg, dsymonds
CC=golang-dev
https://golang.org/cl/4029047
New ftplugin adds Import and Drop commands for Go buffers
in Vim. These commands ensure that the provided package is
imported (or not imported) in the current Go buffer, using
proper style and ordering, without moving the cursor.
E.g.
:Import strings
:ImportAs . strings
:Drop strings
Two mappings are also introduced to help with the fmt package:
\f => :Import fmt
\F => :Drop fmt
R=adg
CC=golang-dev
https://golang.org/cl/4009043
#pragma dynexport is no longer needed for
this use of cgo, since the gcc and gc code are
now linked together into the same binary.
It may still be necessary later.
On the Mac, you cannot use the GOT to resolve
symbols that exist in the current binary, so 6l and 8l
translate the GOT-loading mov instructions into lea
instructions.
On ELF systems, we could use the GOT for those
symbols, but for consistency 6l and 8l apply the
same translation.
The translation is sketchy in the extreme
(depending on the relocation being in a mov
instruction) but it verifies that the instruction
is a mov before rewriting it to lea.
Also makes typedefs global across files.
Fixes#1335.
Fixes#1345.
R=iant, r
CC=golang-dev
https://golang.org/cl/3650042