In a few places, the existing cgo tests assume that a
Go int is the same as a C int. Making int 64 bits wide
on 64-bit platforms violates this assumption.
Change that code to assume that Go int32 and C int
are the same instead. That's still not great, but it's better,
and I am unaware of any systems we run on where it is not true.
Update #2188.
R=iant, r
CC=golang-dev
https://golang.org/cl/6552064
Always process the DWARF info, even when the const value is determined
using the debug data block. This ensures that the injected enum is
removed and future loads of the same constant do not trigger
inconsistent definitions.
Add tests for issues 2470 and 4054.
Fixes#4054.
R=golang-dev, fullung, dave, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6501101
Previously, an import block such as
import (
"net"
"stack"
)
would not permit ":Drop stack" to work because we were aborting
the scan early, which is only correct when Import is in operation.
R=golang-dev, franciscossouza
CC=golang-dev
https://golang.org/cl/6532053
use a function to get stdout and stderr, instead of depending
on a specific libc implementation.
also make test/run.go replace \r\n by \n before comparing
output.
Fixes#2121.
Part of issue 1741.
R=alex.brainman, rsc, r, remyoudompheng
CC=golang-dev
https://golang.org/cl/5847068
I thought this was redundant since the behavior of 'go get -d' had
changed. I was wrong. Should have tested more thoroughly.
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6500136
We have some tests (misc/cgo/test) that are disabled only because
they will fail to run on go builder - see issue 3358 for details.
This change will allow us to enable these tests.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6493118
Fixes#4008.
Run a background goroutine that wastes CPU to trick the
power management into raising the CPU frequency which,
by side effect, makes sleep more accurate on arm.
=== RUN TestParallelSleep
--- PASS: TestParallelSleep (1.30 seconds)
_cgo_gotypes.go:772: sleep(1) slept for 1.000458s
R=minux.ma, r
CC=golang-dev
https://golang.org/cl/6498060
Vim autocompletion respects the $GOPATH variable and does not
ignore dashes ('-'), dots ('.') and underscores ('_') like found
in many remote packages.
Environment variable $GOROOT is determined by calling
'go env GOROOT' instead of relying on the user's environment
variables.
Fixes#3876Fixes#3882
R=golang-dev, franciscossouza, dsymonds, minux.ma
CC=golang-dev
https://golang.org/cl/6443151
- pprof is a perl script, so go command should invoke
perl instead of trying to run pprof directly;
- pprof should use "go tool nm" unconditionally on windows,
no one else can extract symbols from Go program;
- pprof should use "go tool nm" instead of "6nm".
Fixes#3879.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6445082
This CL adds a step to the build procedure for cgo programs. It uses 'ld -r'
to combine all gcc compiled object file and generate a relocatable object file
for our ld. Additionally, this linking step will combine some static linking
gcc library into the relocatable object file, so that we can use libgcc,
libmingwex and libmingw32 without problem.
Fixes#3261.
Fixes#1741.
Added a testcase for linking in libgcc.
TODO:
1. still need to fix the INDIRECT_SYMBOL_LOCAL problem on Darwin/386.
2. still need to enable the libgcc test on Linux/ARM, because 5l can't deal
with thumb libgcc.
Tested on Darwin/amd64, Darwin/386, FreeBSD/amd64, FreeBSD/386, Linux/amd64,
Linux/386, Linux/ARM, Windows/amd64, Windows/386
R=iant, rsc, bradfitz, coldredlemur
CC=golang-dev
https://golang.org/cl/5822049
Enhances test/run.go to support testing other directories
Will enable stdio tests on Windows in a follow-up CL.
R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/6220049
This line helps me to tell whether the CL is waiting for me or I'm waiting for the author.
Also:
- vertical-align table cells so buttons are always aligned with CL headers.
- add email= to show front page for someone else.
Demo at http://rsc.gocodereview.appspot.com/.
Until this is deployed for real, some recently changed CLs may be
missing the 'first line of last message' part.
R=dsymonds
CC=golang-dev
https://golang.org/cl/6446065
To be filled in by a later CL. I deployed a test version to
App Engine to work on setting the values, so there are
a few records that have this field set already.
That field is breaking the live version, so I have pushed
a new copy with this 1-line change to the live version
I assumed that appengine/datastore was like every other
marshaling and unmarshaling package we have in Go
(for example, encoding/gob, encoding/json, encoding/xml,
and protobuf) and that if it loaded an unknown field it would
just ignore it. Apparently not. Sorry.
R=dsymonds
TBR=dsymonds
CC=golang-dev
https://golang.org/cl/6454064
This is the state when the CL has been submitted by someone other than
the CL author, but before the CL author has synched their client.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6458044
A "NOT LGTM" overrules a previous "LGTM" by the same person, and vice versa.
"NOT LGTM"s are shown in the same location as LGTMs, colored red.
R=rsc
CC=golang-dev
https://golang.org/cl/6453062
If a factored import group has a blank line, assume it is dividing
separate groups of imports (e.g. standard library vs. site-specific).
import (
"bytes"
"io"
"mycorp/package"
)
The most common case is inserting new standard library imports,
which are usually (stylistically) the first group, so we should drop
"net" in the above example immediately after "io".
Since this logic is getting non-trivial, add a test.
R=golang-dev, minux.ma, franciscossouza
CC=golang-dev
https://golang.org/cl/6445043
The previous code assumed the gofmt output referred to /tmp but
that's not true if TMPDIR points somewhere else (like on Macs).
Fixes#3782.
R=sameer
CC=golang-dev
https://golang.org/cl/6346050
Use code to be used in lisp programs as suggested in the doc strings for
replace-{string|regexp}. Bonus: This code works for XEmacs.
R=golang-dev, sameer, jmeurin
CC=golang-dev
https://golang.org/cl/6296073
Patching the buffer with the output from gofmt -d only works if
the file already exists. If it doesn't, replace the content with
the output of gofmt.
R=sameer
CC=golang-dev
https://golang.org/cl/6302063
The datastore.Query methods once mutated the Query value, but now they return
a derivative query, so the Hash= and ParentHash= filters were not being
applied.
R=golang-dev, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/6300058
Split stdout/stderr into a separate file so that can be handled
differently on some platforms. Both NetBSD and OpenBSD have defines
for stdout/stderr that require some coercion in order for cgo to
handle them correctly.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6247062
specifically, adds a go-test element to compilation-error-regexp-alist[-alist].
Fixes#3629.
R=golang-dev, rsc, sameer
CC=golang-dev, jba
https://golang.org/cl/6197091
The previous heap profile format did not include buckets with
zero used bytes. Also add several missing MemStats fields in
debug mode.
R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6249068
This uses the patch output of gofmt (-d option) and applies each
chunk to the buffer, instead of replacing the whole buffer. The
main advantage is that the undo history is kept across gofmt'ings,
so it can really be used as a before-save-hook.
R=sameer, sameer
CC=golang-dev
https://golang.org/cl/6198047
Two fixes for indentation problems:
1. Properly recognize multi-line strings. These start with `, not ".
2. Don't indent a line if the beginning of the line is the end of a multi-line string. This happened for instance when inserting a closing bracket after a multi-line string.
R=sameer
CC=golang-dev
https://golang.org/cl/6157044
As our CL number could be as small as 152046, changed CL number's lower bound
to 150000. Hopefully our issue count won't reach 150000 any time soon.
Chrome on Mac OS X has very strange behavior regarding the focus, although we
force the focus to the input box on load, the page still come up with focus on
"issue". Set the tabindex of the input box as a workaround.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6212055
This adds restoring the window position so that the buffer doesn't jump around after the erase/copy.
R=sameer
CC=golang-dev
https://golang.org/cl/5981055
1. In CL 5989057, I made a mistake in the last minute change.
"MOVW.W R4, -4(SP)" should really be "MOVW.W R4, -4(R13)",
as 5l will rewrite offset for SP.
2. misc/cgo/test/issue1560.go tests for parallel sleep of 1s,
but on ARM, the deadline is frequently missed, so change sleep
time to 2s on ARM.
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6202043
If we delay the mail sending, we can't send as the current user.
If we don't fill in the time.Time fields, datastore.Put will fail
because the zero time.Time value is out of its range.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6136053
This changes the misc/dist program to generate OS X
packages using pkgbuild and productbuild.
The productbuild utility makes it easy to generate
packages with a custom Distribution file. This allows
us to add an installcheck script that presents a
friendly message to users who are running on an old
version of Mac OS X.
The change also fixes a few issues with the
postinstall script:
- In-repo version of the script has been made
executable. Installers generated using the new
tools couldn't execute it otherwise.
- It now uses -d for checking for the existence
of the Xcode specs directory.
- The call to sudo.bash has been dropped since cov
and prof aren't bundled with the binary
distributions.
Fixes#3455.
Tested on 10.5.8, 10.6.0, 10.6.8 and 10.7.3.
R=adg, golang-dev
CC=golang-dev
https://golang.org/cl/5987044
adg removed some now-unwanted fields in Package a while ago,
but there are still datastore entities with those fields,
so we must explicitly check for ErrFieldMismatch and ignore it.
R=golang-dev, rsc
CC=adg, golang-dev
https://golang.org/cl/6007043
Doesn't fix any known issue. This bit me in some unrelated
code and I thought of this tool.
R=golang-dev, krautz, mikkel
CC=golang-dev
https://golang.org/cl/5976067
- flag * and / as comment characters
- mark newline as a comment-ender
- include newline in go-mode-whitespace-p
Thanks Jonathan Amsterdam and Steve Yegge for the patch!
R=golang-dev, rsc
CC=golang-dev, jba, stevey
https://golang.org/cl/5938056
Fixes#3313
go-mode-backward-skip-comments is probably due for a more ambitious refactoring --- it repeats guard conditions after every nearly every movement of point.
R=sameer, r
CC=golang-dev
https://golang.org/cl/5844063
1. make the program go buildable
2. update os.EINVAL and runtime.Cgocalls()
3. wrap mpz_div_2exp() and mpz_mul_2exp to support both
pre-5.0 and post-5.0 gmp (we really have no reason to
restrict ourselves to gmp 5.0+)
R=golang-dev, remyoudompheng, iant
CC=golang-dev
https://golang.org/cl/5847061
Currently, ftdetect/gofiletype.vim set fileencodings to open the file as
utf-8 encoding event if the file does not contain multibyte characters.
But fileencodings is global option.
$ vim foo.txt
:set fileencodings
utf-8,ucs-bom,cp932
$ vim foo.go
:set fileencodings
utf-8
This change restore fileencodings before opening the file.
Also added specify fileformats=unix.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5718045
This should live in archive/tar later (CL 5796073) but we
can always do that after Go 1 and stick it here for now.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5754096
For people untarring with -p or as root, preserving file permissions.
This way we don't make tars owned by adg/eng or adg/staff or whatever
machine Andrew was on. Instead, we always build tarballs owned by predictable
users.
Except archive/tar doesn't seem to work.
Updates #3209.
R=golang-dev, adg
CC=dsymonds, golang-dev
https://golang.org/cl/5796064
Use archive/zip instead of 7z on Windows.
Look for all Windows deps before starting build, and include looking
for them in their common locations instead of making users update
their PATHs.
Add an --upload flag that, if set to false, doesn't require credential
files.
R=golang-dev, alex.brainman, adg
CC=golang-dev
https://golang.org/cl/5794046
As we've dropped support for Mac OS X 10.5, I think the generated .pkg
should reflect that decision.
But this CL make it impossible to generate pkg on Mac OS X 10.6, at least
for me.
R=adg, bradfitz
CC=golang-dev
https://golang.org/cl/5798051
The test.bash file generates .so file using gcc, builds the executable
using the go tool and then run it with the $LD_LIBRARY_PATH variable
pointing to the directory where the .so file lives.
Fixes#2982.
R=rsc, remyoudompheng
CC=golang-dev
https://golang.org/cl/5788043
We decided not to record installs, for now at least.
««« original CL description
misc/dashboard: record install counts for external packages
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5699082
»»»
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5790044
Does not actually test so files.
««« original CL description
misc/cgo: re-enable testso
Also enabled it for darwin.
R=rsc
CC=golang-dev
https://golang.org/cl/5754063
»»»
R=golang-dev, minux.ma, r, f
CC=golang-dev
https://golang.org/cl/5756075
The last CL forgot the all-important 'backdoor' package.
Cgo-using packages compile .c files with gcc, but we want
to compile this one with 6c, so put it in a non-cgo package.
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5758063
go.xclangspec is identical to the one in misc/xcode/3/, except for the heading.
Partial workaround for issue 2401.
R=gri
CC=golang-dev
https://golang.org/cl/5732051
Work around profiling kernel bug with signal masks.
Still broken on 64-bit Snow Leopard kernel,
but I think we can ignore that one and let people
upgrade to Lion.
Add new trivial tools addr2line and objdump to take
the place of the GNU tools of the same name, since
those are not installed on OS X.
Adapt pprof to invoke 'go tool addr2line' and
'go tool objdump' if the system tools do not exist.
Clean up disassembly of base register on amd64.
Fixes#2008.
R=golang-dev, bradfitz, mikioh.mikioh, r, iant
CC=golang-dev
https://golang.org/cl/5697066
This covers most of the tool's functionality. At some point,
support should probably be added for testflags and the various go
tools.
R=golang-dev, bradfitz, kyle, minux.ma
CC=golang-dev
https://golang.org/cl/5646066
fix, and shrink, the gopher icon, txt extensions
for license and readme files, minor format changes
in the wxs file
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5683054
Embedded Go images in the installer dialog and
banner boxes, Go tree cloning uses version info
from the Go tool (readme updated), the installer
allows up/down-grading and reparing of the version
that's installed, added two registry values.
R=golang-dev, bradfitz, bradfitz
CC=golang-dev
https://golang.org/cl/5683048
Added the (properly formatted) license file back,
the installer adds go\bin to the system PATH now,
the output package names are in line with the linux
and darwin versions, dist.bat extracts GOARCH in a
sane way, readme cleanup.
Tested on Windows 7 only. It would be helpful if
someone else could give it a try. See the readme
for details.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5673099
files moved from misc/windows, bash packager file replaced with Windows batch file
R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5677074
Also: Simplified handling of selector expressions. As a result, complicated
multi-line expressions containing selectors and calls/indices with arguments
broken accross lines don't get indented the same way as before, but the change
is minimal (see tests) and there's no such code in the std library. It seems
a worthwhile compromise given the much simpler code.
Applied gofmt -w $GOROOT/src $GOROOT/misc .
Fixes#1847.
R=rsc
CC=golang-dev
https://golang.org/cl/5675062
Not causing problems yet, but no need to
keep using cygwin paths now that we're off cygwin.
R=alex.brainman
CC=golang-dev
https://golang.org/cl/5656053
This is for filling a column with "fail", like I just did for
Windows, when the builder would get stuck running that
build. (We have safeguards against the tests getting stuck
but this was the bootstrap build getting stuck.)
I usually use -cmd=/bin/false, but this avoids the Mercurial
checkouts, which means it runs instantly instead of requiring
~1 minute per "fail".
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5649049
Do not rewrite commands if they have .bash extnsion.
Use path/filepath to manipulate file paths everywhere.
Use all.bat on windows, not all.bash.
Use HOMEDRIVE/HOMEPATH to find .gobuildkey on windows.
R=rsc
CC=golang-dev
https://golang.org/cl/5630062
There's no reason to set GOROOT as the tools will have the path baked
into it with GOROOT_FINAL.
R=bradfitz, bytbox, gustavo, rsc
CC=golang-dev
https://golang.org/cl/5576064
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
Clean up an error message and error exit too.
Insert blank line after "DO NOT EDIT" comment
to keep it from being a doc comment.
Fixes#1213.
Fixes#1222.
R=r
CC=golang-dev
https://golang.org/cl/3608042
* Add documentation about array arguments. Fixes issue 1125.
* Do not interpret x, y := z, w as special errno form. Fixes issue 952.
* Fix nested Go calls (brainman). Fixes issue 907.
R=r
CC=golang-dev
https://golang.org/cl/2214044
- fix release upload
- add -rev= flag to build specific revision and exit
- added support for all-$GOARCH.bash
R=rsc
CC=golang-dev
https://golang.org/cl/2247044