1
0
mirror of https://github.com/golang/go synced 2024-10-04 01:31:25 -06:00
Commit Graph

73 Commits

Author SHA1 Message Date
Rob Pike
33a4da89d3 exp/template: fix build
TBR=gri

R=gri
CC=golang-dev
https://golang.org/cl/4815070
2011-07-28 16:46:32 -07:00
Rob Pike
2fc962697a goinstall: generate makefiles using exp/template
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4809052
2011-07-26 14:45:36 -07:00
Andrew Gerrand
83305fecfe goinstall: abort and warn when using any url scheme, not just 'http://'
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4801053
2011-07-26 04:16:34 +10:00
Andrew Gerrand
fc2480da3c goinstall: write to goinstall.log in respective GOPATH
goinstall: report every newly installed package to the dashboard

This makes "goinstall -a" work on systems with GOROOTs that are
not user-writable, as is the case with Debian's Go packages.

This also makes goinstall.log the canonical list of installed
packages, in that only packages new to goinstall.log are reported to
the dashboard.

A side-effect is that writing to goinstall.log is now mandatory.
(A bug in the original implementation meant this was the case, anyway.)

The principal benefit of this change is that multiple packages from the
same repository can now be reported to the dashboard.  It is also less
likely for a user to report multiple installations of the same package
to the dashboard (they would need to remove the package from
goinstall.log first).

R=rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/4786041
2011-07-24 13:43:08 +10:00
Tarmigan Casebolt
a0d3be1689 goinstall, dashboard: Google Code now supports git
R=golang-dev, adg, rsc, tarmigan+golang
CC=golang-dev
https://golang.org/cl/4760055
2011-07-19 16:58:18 +10:00
Robert Griesemer
90564a9256 go/printer: changed max. number of newlines from 3 to 2
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go
(cd src/cmd/gofix/testdata; gofmt -w *.in *.out)
(cd src/pkg/go/printer; gotest -update)
gofmt -w misc src

runs all tests

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4715041
2011-07-14 14:39:40 -07:00
Andrew Gerrand
a342006207 goinstall: only report successfully-installed packages to the dashboard
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4657071
2011-07-04 16:05:11 +10:00
Andrew Gerrand
72a73198df goinstall: documentation for new remote repository behavior and tweaks
R=rsc, julian
CC=golang-dev
https://golang.org/cl/4642049
2011-07-02 14:05:43 +10:00
Yasuhiro Matsumoto
21efa147ba cmd/goinstall: try to access via https.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4667051
2011-07-01 10:11:33 -04:00
Julian Phillips
8ffbc4016a goinstall: Add support for generic hosts using special import form
This change extends goinstall to support "magic" package names of the
form:
        <host>/<repo>.<vcs>/<path>

Where <host> is the hostname, <repo> the path to the repository, <vcs>
the type of vcs (git, hg, bzr or svn), and <path> is the path inside the
repository that contains the source code for the package.

For example: "example.com/pub/foo.hg/src" means download the Mercurial
repository at either pub/foo.hg or pub/foo from example.com and then
build and install the source files from src inside the repository
checkout.

Repositories on the built-in hostings sites (github, bitbucket,
launchpad and googlecode) must still use the old form (i.e.
github.com/xxx/yyy.git/src will be rejected).

R=adg, rsc
CC=golang-dev
https://golang.org/cl/4626064
2011-06-30 18:54:53 +10:00
Rob Pike
ebb1566a46 strings.Split: make the default to split all.
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
2011-06-28 09:43:14 +10:00
Andrew Gerrand
b4bab6f8b3 goinstall: build with make by default, add -make flag
This is a temporary measure until go/build can build cgo packages.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4627056
2011-06-24 13:01:17 +10:00
Robert Griesemer
712fb6dcd3 os.Error API: don't export os.ErrorString, use os.NewError consistently
This is a core API change.

1) gofix misc src
2) Manual adjustments to the following files under src/pkg:
   gob/decode.go
   rpc/client.go
   os/error.go
   io/io.go
   bufio/bufio.go
   http/request.go
   websocket/client.go
as well as:
   src/cmd/gofix/testdata/*.go.in (reverted)
   test/fixedbugs/bug243.go
3) Implemented gofix patch (oserrorstring.go) and test case (oserrorstring_test.go)

Compiles and runs all tests.

R=r, rsc, gri
CC=golang-dev
https://golang.org/cl/4607052
2011-06-22 10:52:47 -07:00
Andrew Gerrand
f338d9f73b goinstall: undo 1ad616fb313d (always rebuild...)
CL 4627051 is a better way of doing the same thing.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4654045
2011-06-21 17:13:16 +10:00
Andrew Gerrand
ceae2c9301 goinstall: undo repo peeking code
Keeping the Julian's good refactoring work.

R=rsc
CC=golang-dev
https://golang.org/cl/4638049
2011-06-21 11:28:15 +10:00
Andrew Gerrand
f22e5cfc6d goinstall: update doc.go
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4645048
2011-06-20 16:39:16 +10:00
Andrew Gerrand
f3a7dad654 goinstall: s/vlogf/printf/
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4628050
2011-06-20 14:44:14 +10:00
Andrew Gerrand
e068b85bea goinstall: wait for all commands to finish instead of timeout
goinstall: make ".git" repo suffix optional

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/4643048
2011-06-20 14:12:23 +10:00
Julian Phillips
c319fb07bc goinstall: Add support for arbitary code repositories
Extend goinstall to support downloading from any hg/git/svn/bzr hosting
site, not just the standard ones.  The type of hosting is automatically
checked by trying all the tools, so the import statement looks like:

  import "example.com/mything"

Which will work for Mercurial (http), Subversion (http, svn), Git (http,
git) and Bazaar (http, bzr) hosting.

All the existing package imports will work through this new mechanism,
but the existing hard-coded host support is left in place to ensure
there is no change in behaviour.

R=golang-dev, bradfitz, fvbommel, go.peter.90, n13m3y3r, adg, duperray.olivier
CC=golang-dev
https://golang.org/cl/4650043
2011-06-20 13:00:43 +10:00
Andrew Gerrand
c967ba0210 goinstall: always rebuild a package after its dependencies are built
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4627047
2011-06-19 09:36:45 +10:00
Andrew Gerrand
4340b57d88 goinstall, go/build: support building cgo packages
Fixes #1962.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4636044
2011-06-17 11:15:54 +10:00
Andrew Gerrand
db5a4ffc2a goinstall: use go/make package to scan and build packages
R=rsc, n13m3y3r, kevlar
CC=golang-dev
https://golang.org/cl/4515180
2011-06-15 13:28:35 +10:00
Brad Fitzpatrick
f259f6ba0a exec: new API, replace Run with Command
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
2011-06-01 15:26:53 -07:00
Rob Pike
73d57642a4 filepath: remove string constants. They are unnecessary.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4527090
2011-06-01 13:06:04 +10:00
Andrew Gerrand
581bd378ec gobuilder: include file missing from change, fix build
R=golang-dev
CC=golang-dev
https://golang.org/cl/4539099
2011-06-01 11:56:46 +10:00
Andrew Gerrand
9f0cabfab9 goinstall: document GOPATH and support relative/absolute installs
goinstall: more verbose logging with -v

Fixes #1901.

R=rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/4524078
2011-06-01 10:48:15 +10:00
Russ Cox
2c6a2a9773 goinstall: skip standard packages
R=adg, n13m3y3r
CC=golang-dev
https://golang.org/cl/4526084
2011-05-30 18:23:16 -04:00
Alex Brainman
9107b530d8 goinstall: use bash to execute gomake
R=golang-dev, r, adg
CC=golang-dev
https://golang.org/cl/4551074
2011-05-30 16:15:08 +10:00
Andrew Gerrand
ca8a055f5c goinstall: support GOPATH; building and installing outside the Go tree
For example, with GOPATH set like so
        GOPATH=/home/adg/gocode
And after creating some subdirectories
        mkdir /home/adg/gocode/{bin,pkg,src}

I can use goinstall to install the github.com/nf/goto web server,
which depends on the github.com/nf/stat package, with
        goinstall github.com/nf/goto

This downloads and installs all dependencies (that aren't already
installed) like so
        /home/adg/gocode/bin/goto
        /home/adg/gocode/pkg/darwin_amd64/github.com/nf/stat.a
        /home/adg/gocode/src/github.com/nf/goto/...
        /home/adg/gocode/src/github.com/nf/stat/...

R=rsc, niemeyer
CC=golang-dev
https://golang.org/cl/4438043
2011-04-27 11:00:34 +10:00
Andrew Gerrand
aaa6ce2301 goinstall: support building executable commands
This CL gives goinstall the ability to build commands,
not just packages.

"goinstall foo.googlecode.com/hg/bar" will build the command named
"bar" and install it to GOBIN. "goinstall ." will use the name of the
local directory as the command name.

R=rsc, niemeyer
CC=golang-dev
https://golang.org/cl/4426045
2011-04-20 12:02:29 +10:00
Russ Cox
de3aac609c gofix: don't rewrite O_APPEND opens
R=r, rog
CC=golang-dev
https://golang.org/cl/4364041
2011-04-05 11:12:02 -04:00
Rob Pike
8a90fd3c72 os: New Open API.
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
2011-04-04 23:42:14 -07:00
Rob Pike
d406f8f650 testing: set up structure for faster testing using the new -test.short flag.
New make target "testshort" runs "gotest -test.short" and is invoked
by run.bash, which is invoked by all.bash.

Use -test.short to make one package (crypto ecdsa) run much faster.
More changes to come.

Once this is in, I will update the long-running tests to use the new flag.

R=rsc
CC=golang-dev
https://golang.org/cl/4317043
2011-03-25 14:50:44 -07:00
Andrew Gerrand
f91e677e12 goinstall: add -clean flag to docs
Fixes #1629.

R=rsc
CC=golang-dev
https://golang.org/cl/4291057
2011-03-21 14:18:12 +11:00
Gustavo Niemeyer
e08f0c18c9 goinstall: handle .c files with gc when cgo isn't used
As a data point, this enables goinstall to handle the standard
syscall package almost unchanged (there's one file with the _bsd
extension, and a .c file which isn't supposed to be compiled in).

R=rsc
CC=golang-dev
https://golang.org/cl/4259057
2011-03-07 12:53:39 -05:00
Gustavo Niemeyer
ff40deee62 goinstall: handle .s files with gc
As a data point, with this change goinstall is able to
fully build package big out of the box.

R=rsc
CC=golang-dev
https://golang.org/cl/4264049
2011-03-07 12:08:52 -05:00
Russ Cox
5946e46138 goinstall: fix build
func init runs *after* var declarations

TBR=niemeyer
CC=golang-dev
https://golang.org/cl/4260055
2011-03-07 11:33:26 -05:00
Gustavo Niemeyer
70f08b47a0 goinstall: handle $(GOOS) and $(GOARCH) in filenames
This enables goinstall to handle .go and .c files (for cgo)
which are named after the following patterns:

    name_$(GOOS).*
    name_$(GOARCH).*
    name_$(GOOS)_$(GOARCH).*

Files with those names are only included if the $(GOOS) and
$(GOARCH) match the current system.

R=rsc
CC=golang-dev
https://golang.org/cl/4172055
2011-03-07 10:54:53 -05:00
Gustavo Niemeyer
04ca4f8242 path/filepath: new OS-specific path support
The path package now contains only functions which
deal with slashed paths, sensible for any OS when dealing
with network paths or URLs.  OS-specific functionality
has been moved into the new path/filepath package.

This also includes fixes for godoc, goinstall and other
packages which were mixing slashed and OS-specific paths.

R=rsc, gri, mattn, brainman
CC=golang-dev
https://golang.org/cl/4252044
2011-03-06 17:33:23 -05:00
Roger Peppe
c1fdb6f156 goinstall: protect against malicious filenames.
It was possible to make package run arbitrary
commands when installing if its filenames contained
make metacharacters.

R=rsc, niemeyer
CC=golang-dev
https://golang.org/cl/4248041
2011-03-02 15:04:08 -05:00
Rob Pike
fb9e37cd9b template: reverse order of arguments to Execute
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
2011-02-09 14:23:01 -08:00
Gustavo Niemeyer
59a47732dd exec: use custom error for LookPath
Make the error message and the needed action more obvious
when a command isn't found to obtain the source code
of a project.  Users seem to strugle with the existing
wording in practice.

R=rsc
CC=golang-dev
https://golang.org/cl/4058047
2011-02-01 12:12:51 -05:00
Gustavo Niemeyer
6f6b7e3a33 goinstall: Fix template to use exported fields
It's currently broken due to f6d5bac536c5.

R=r, r2
CC=golang-dev
https://golang.org/cl/3967041
2011-01-12 10:45:24 -08:00
Gustavo Niemeyer
03b46849f2 goinstall: preliminary support for cgo packages
Can handle cgo packages now but only if they
do not need to set CGO_LDFLAGS and CGO_CFLAGS.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/3891042
2011-01-11 13:14:48 -05:00
Kyle Lemons
ddc2710d69 goinstall: add -clean flag
R=adg, rsc
CC=golang-dev
https://golang.org/cl/3821042
2011-01-05 14:34:59 -05:00
Gustavo Niemeyer
5530bf90cd goinstall: fix -u for bzr
Changeset 7012:65601d7cac9e broke goinstall -u for bzr
branches.  This will fix it.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/3852041
2011-01-04 14:22:18 +11:00
Caine Tighe
784788ba44 goinstall/download.go: Add checkout concept and helper functions to clean and fix implementation (Issue 1265)
R=rsc, niemeyer, adg
CC=golang-dev
https://golang.org/cl/3536041
2010-12-24 11:48:45 +11:00
Robert Griesemer
5a9ad8b9e3 go/ast: use token.Pos instead of token.Position; adjust all dependent code
Specifically:

	* lib/godoc:
	- provide file set (FSet) argument to formatters where needed

	* src/cmd:
	- cgo, ebnflint, godoc, gofmt, goinstall: provide file set (fset) where needed
	- godoc: remove local binary search with sort.Search (change by rsc),
	  extract file set for formatters

	* src/pkg:
	- exp/eval: remove embedded token.Position fields from nodes and replace
	  with named token.Pos fields; add corresponding Pos() accessor methods
	- go/token: added file.Line(), changed signature of File.Position()

	* test/fixedbugs/:
	- bug206.go: change test to not rely on token.Pos details

	* added various extra comments
	* Runs all.bash
	* gofmt formats all of src, misc w/o changes
	* godoc runs

	* performance:
	- The new version of godoc consumes about the same space after indexing
	  has completed, but indexing is half the speed. Significant space savings
	  are expected from smaller ASTs, but since they are thrown away after a
	  file has been indexed, this is not visible anymore. The slower indexing
	  time is due to the much more expensive computation of line information.
	  However, with the new compressed position information, indexing can be
	  rewritten and simplified. Furthermore, computing the line info can be
	  done more efficiently.

        New godoc, immediately after indexing completed (best of three runs):

	  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
	44381 godoc        0.0%  0:38.00   4    19    149  145M   184K   148M   176M

	2010/12/03 17:58:35 index updated (39.231s, 18505 unique words, 386387 spots)
	2010/12/03 17:58:35 bytes=90858456 footprint=199182584
	2010/12/03 17:58:36 bytes=47858568 footprint=167295224

	Old godoc, immediately after indexing completed (best of three runs):

	  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
	23167 godoc        0.0%  0:22.02   4    17    132  129M   184K   132M   173M

	2010/12/03 14:51:32 index updated (24.892s, 18765 unique words, 393830 spots)
	2010/12/03 14:51:32 bytes=66404528 footprint=163907832
	2010/12/03 14:51:32 bytes=46282224 footprint=163907832

	The different numbers for unique words/spots stem from the fact the the
	two workspaces are not exactly identical. The new godoc maintains a large
	file set data structure during indexing which (probably) is the reason
	for the larger heap (90858456 vs 66404528) before garbage collection.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3050041
2010-12-06 14:23:18 -08:00
Brad Fitzpatrick
b0afb931a8 Use strings.Contains in src/cmd/...
R=r
CC=golang-dev, r2, rsc
https://golang.org/cl/2819041
2010-11-01 15:21:35 -07:00
Andrew Gerrand
ec8f8149d2 goinstall: display helpful message when encountering a cgo package.
R=rsc
CC=golang-dev
https://golang.org/cl/2701042
2010-10-26 10:59:30 +11:00