Commit graph

12573 commits

Author SHA1 Message Date
Shenghou Ma 0359621241 build: update Makefile to track source code dependencies better
Also update .hgignore to ignore y.output.

R=rsc
CC=golang-dev
https://golang.org/cl/5797061
2012-03-13 03:31:11 +08:00
Shenghou Ma d3191f5c2b gc: correct comment in runtime.go
R=rsc, iant
CC=golang-dev
https://golang.org/cl/5777057
2012-03-13 03:24:13 +08:00
Ingo Oeser d13b24598f cmd/go: allow ssh tunnelled bzr, git and svn
This is often used in private hosting and collaborating environments.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5753063
2012-03-12 14:41:01 -04:00
Russ Cox bd71072eee codereview: fix for Mercurial 2.1
Mercurial: the Python of version control systems.
Python: the Mercurial of programming languages.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5777066
2012-03-12 14:39:44 -04:00
Russ Cox 4084f08401 html/template: doc nit
Execute's data is untrusted regardless of package.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5797062
2012-03-12 14:26:10 -04:00
Russ Cox b23b001bd2 A+C: add Ingo Oeser (individual CLA)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5794061
2012-03-12 14:25:52 -04:00
Brad Fitzpatrick e8deb3f828 net/http: return appropriate errors from ReadRequest
Fixes #3298

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5783080
2012-03-12 10:42:25 -07:00
Russ Cox da8efae9fe cmd/godoc: fix directory read
Undo CL 5783076 and apply correct fix.

The /doc hack is wrong.  The code to handle this case was
already there and just needs a simple fix:

 	// We didn't find any directories containing Go files.
 	// If some directory returned successfully, use that.
-	if len(all) == 0 && first != nil {
+	if !haveGo {
 		for _, d := range first {
 			haveName[d.Name()] = true
 			all = append(all, d)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5783079
2012-03-12 13:10:37 -04:00
Russ Cox 376fc748f6 cmd/go: stop using $GOROOT and $GOBIN in script output
They were necessary to produce a canonical script
when we checked in build scripts, but now they're just
getting in the way.

Fixes #3279.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5796068
2012-03-12 12:39:31 -04:00
David Symonds d75abb7ca3 archive/tar: catch short writes.
Also make error messages consistent throughout.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5777064
2012-03-12 17:33:35 +11:00
Brad Fitzpatrick ac0789c63e misc/dist: use archive/tar to generate tarballs
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
2012-03-11 23:07:38 -07:00
Andrew Gerrand 92d4af301e cmd/godoc: always include /doc files in union filesystems
Makes Path rewrites work, as the metadata was never being scanned.

Fixes #3282.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5783076
2012-03-12 15:55:39 +11:00
Brad Fitzpatrick 2ae8605859 misc/dist: use archive/zip, seek out windows deps, add --upload flag
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
2012-03-11 21:02:40 -07:00
Robert Hencke 663a7716a1 crypto/tls, fmt: print fixes
R=golang-dev, bradfitz, minux.ma, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5787069
2012-03-12 12:04:45 +09:00
David Symonds 2e1bc9e867 cmd/vet: little tweak to tagged literal script to get it closer to drop-in format.
This is a minor change that made it easier for me; if you hate it I can drop it.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5798060
2012-03-12 13:50:25 +11:00
Shenghou Ma 0c74d867c5 misc/dist: minimum target requirement is 10.6 for Darwin
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
2012-03-12 13:20:25 +11:00
Brad Fitzpatrick e31fa68a43 cmd/api: work on Windows again, and make gccgo files work a bit more
handle string and []byte conversions.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5754082
2012-03-11 17:55:15 -07:00
David Symonds 764880e2b2 cmd/api: set compiler for all build contexts.
The generated syscall files for Windows are still breaking "go tool api"
(unknown function []byte); I'll look at fixing that separately.

Fixes #3285.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5777062
2012-03-12 11:25:38 +11:00
Russ Cox cd7ae05d52 cmd/go: local import fixes
1) The -D argument should always be a pseudo-import path,
like _/Users/rsc/foo/bar, never a standard import path,
because we want local imports to always resolve to pseudo-paths.

2) Disallow local imports in non-local packages.  Otherwise
everything works but you get two copies of a package
(the real one and the "local" one) in your binary.

R=golang-dev, bradfitz, yiyu.jgl
CC=golang-dev
https://golang.org/cl/5787055
2012-03-11 15:53:42 -04:00
Gwenael Treguier c3954dd5da database/sql: ensure Stmts are correctly closed.
To make sure that there is no resource leak,
I suggest to fix the 'fakedb' driver such as it fails when any
Stmt is not closed.
First, add a check in fakeConn.Close().
Then, fix all missing Stmt.Close()/Rows.Close().
I am not sure that the strategy choose in fakeConn.Prepare/prepare* is ok.
The weak point in this patch is the change in Tx.Query:
  - Tests pass without this change,
  - I found it by manually analyzing the code,
  - I just try to make Tx.Query look like DB.Query.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5759050
2012-03-10 15:21:44 -08:00
Jeremy Jackins 959d0c7ac0 doc: fix typo in contribute.html
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5795050
2012-03-10 15:13:34 -08:00
Brad Fitzpatrick 3492f32b83 A+C: Add Gwenael Treguier (Individual CLA)
R=golang-dev, wcn
CC=golang-dev
https://golang.org/cl/5777052
2012-03-10 14:48:00 -08:00
Brad Fitzpatrick 3297fc63d6 database/sql: fix double connection free on Stmt.Query error
In a transaction, on a Stmt.Query error, it was possible for a
connection to be added to a db's freelist twice. Should use
the local releaseConn function instead.

Thanks to Gwenael Treguier for the failing test.

Also in this CL: propagate driver errors through releaseConn
into *DB.putConn, which conditionally ignores the freelist
addition if the driver signaled ErrBadConn, introduced in a
previous CL.

R=golang-dev, gary.burd
CC=golang-dev
https://golang.org/cl/5798049
2012-03-10 10:00:02 -08:00
David Symonds 81a38fbb77 net/mail: close minor TODO that was waiting on a 6g bug fix.
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5796050
2012-03-10 19:02:52 +11:00
Brad Fitzpatrick b2e9f425b9 net/http: fix crash with Transport.CloseIdleConnections
Thanks Michael Lore for the bug report!

Fixes #3266

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5754068
2012-03-09 16:27:32 -08:00
Brad Fitzpatrick 98cfe6770d archive/zip: verify CRC32s in non-streamed files
We should check the CRC32s of files on EOF, even if there's no
data descriptor (in streamed files), as long as there's a non-zero
CRC32 in the file header / TOC.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5794045
2012-03-09 14:45:40 -08:00
Alex Brainman 9fffe45c65 crypto/x509: do not forget to free cert context
R=golang-dev, krautz, rsc
CC=golang-dev
https://golang.org/cl/5783059
2012-03-10 09:35:56 +11:00
Brad Fitzpatrick 3cea4131df archive/zip: write data descriptor signature for OS X; fix bugs reading it
We now always write the "optional" streaming data descriptor
signature, which turns out to be required for OS X.

Also, handle reading the data descriptor with or without the
signature, per the spec's recommendation. Fix data descriptor
reading bugs found in the process.

Fixes #3252

R=golang-dev, alex.brainman, nigeltao, rsc
CC=golang-dev
https://golang.org/cl/5787062
2012-03-09 14:12:02 -08:00
Robert Griesemer ece0d0e7d2 go/printer: example for Fprint
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5785057
2012-03-09 13:53:25 -08:00
Shenghou Ma 29199aa4e4 cmd/gc: import path cannot start with slash on Windows
For CL 5756065.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5784065
2012-03-10 05:11:51 +08:00
Shenghou Ma 6d4da06d36 cmd/dist, cmd/go: move CGO_ENABLED from 'go tool dist env' to 'go env'
So that we don't duplicate knowledge about which OS/ARCH combination
        supports cgo.
        Also updated src/run.bash and src/sudo.bash to use 'go env'.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5792055
2012-03-10 03:42:23 +08:00
Jeremy Jackins 1e374502f4 cmd/vet: fix typo in documentation
familiy -> family

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5783061
2012-03-09 11:21:01 -08:00
Robert Griesemer 0d92614c73 C+A: added Jeremy Jackins (Individual CLA)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5783063
2012-03-09 11:19:10 -08:00
Robert Griesemer 49d2d98697 go/printer, gofmt: nicer formatting of multi-line returns
This affects corner (test) cases only; gofmt -w src misc
doesn't cause any changes.

- added additional test cases
- removed doIndent parameter from printer.valueSpec
  (was always false)
- gofmt -w src misc causes no changes

Fixes #1207.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5786060
2012-03-09 11:05:50 -08:00
Russ Cox c9e5600f7d runtime: move runtime.write back to C
It may have to switch stacks, since we are calling
a DLL instead of a system call.

badcallback says where it is, because it is being called
on a Windows stack already.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5782060
2012-03-09 00:10:34 -05:00
Mikio Hara 26fa1c8248 net: fix typo
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5782063
2012-03-09 11:50:38 +09:00
Andrew Gerrand 08a5d73940 misc/dist: produce a zip file under windows
Updates #3254.

R=golang-dev, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/5783058
2012-03-09 12:57:38 +11:00
Russ Cox 6a19ae74d4 go/build: add NoGoError
R=dsymonds
CC=golang-dev
https://golang.org/cl/5781063
2012-03-08 17:30:45 -05:00
Russ Cox 8a1b3d5a57 runtime: fix windows build
Implement runtime·write, like on the other systems,
and also runtime·badcallback, in assembly to reduce
stack footprint.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5785055
2012-03-08 15:53:11 -05:00
Brad Fitzpatrick 312ff5b58e cmd/go: document import path meta tag discovery in go help remote
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5787059
2012-03-08 11:31:52 -08:00
Russ Cox 2c46569f57 cmd/go: add env command, use to fix misc/cgo/testso
Fixes 386 build on 64-bit machines.

R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/5785053
2012-03-08 14:28:44 -05:00
Russ Cox 36aa7d4d14 runtime: inline calls to notok
When a very low-level system call that should never fail
does fail, we call notok, which crashes the program.
Often, we are then left with only the program counter as
information about the crash, and it is in notok.
Instead, inline calls to notok (it is just one instruction
on most systems) so that the program counter will
tell us which system call is unhappy.

R=golang-dev, gri, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/5792048
2012-03-08 14:03:56 -05:00
Russ Cox c978a5a3a9 test: skip . files in directory
Xcode generates ._foo.go files.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5786055
2012-03-08 14:03:40 -05:00
Robert Griesemer 56cae1c230 all: gofmt -w -s src misc
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5781058
2012-03-08 10:48:51 -08:00
Brad Fitzpatrick 9fb68a9a0a database/sql{,driver}: add ErrBadConn
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5785043
2012-03-08 10:09:52 -08:00
Francisco Souza b492bbe0d6 hgignore: ignoring misc/cgo/testso/main instead of /misc/cgo/testso/testso
test.bash does not remove main if the test fails, so it is good to keep main in .hgignore.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5784057
2012-03-08 12:49:23 -05:00
Shenghou Ma 736ff448de doc: various update to command documents
1. consistent usage section (go tool xxx)
        2. reformat cmd/ld document with minor correction
           document which -H flags are valid on which ld
           document -d flag can't be used on Windows.
           document -Hwindowsgui

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5782043
2012-03-09 01:31:09 +08:00
Francisco Souza dc57ed8caf misc/cgo: re-enable testso
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
2012-03-08 12:13:41 -05:00
Russ Cox 9b73238daa cgo, runtime: diagnose callback on non-Go thread
Before:
$ go run x.go
signal 11 (core dumped)
$

After:
$ go run x.go
runtime: cgo callback on thread not created by Go.
signal 11 (core dumped)
$

For issue 3068.
Not a fix, but as much of a fix as we can do before Go 1.

R=golang-dev, rogpeppe, gri
CC=golang-dev
https://golang.org/cl/5781047
2012-03-08 12:12:40 -05:00
Robert Griesemer 9b7b574edc go/parser: use test harness for short tests
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5782044
2012-03-08 08:53:31 -08:00