summaryrefslogtreecommitdiff
path: root/src/cmd/go
Commit message (Collapse)AuthorAgeFilesLines
* runtime: generate windows callback list with go generateRuss Cox2014-12-051-1/+2
| | | | | | | | | | | | | | | | | | This is the last system-dependent file written by cmd/dist. They are all now written by go generate. cmd/dist is not needed to start building package runtime for a different system anymore. Now all the generated files can be assumed generated, so delete the clumsy hacks in cmd/api. Re-enable api check in run.bash. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://codereview.appspot.com/185040044
* [dev.cc] all: merge default (8d42099cdc23) into dev.ccdev.ccRuss Cox2014-12-053-26/+79
|\ | | | | | | | | | | TBR=austin CC=golang-codereviews https://codereview.appspot.com/178700044
| * cmd/go: fix buildRob Pike2014-12-052-2/+2
| | | | | | | | | | | | | | | | | | | | The new semantics of split require the newline be present. The test was stale. LGTM=adg R=golang-codereviews, adg CC=golang-codereviews https://codereview.appspot.com/182480043
| * cmd/go: avoid use of bufio.Scanner in generateRob Pike2014-12-052-22/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scanner can't handle stupid long lines and there are reports of stupid long lines in production. Note the issue isn't long "//go:generate" lines, but any long line in any Go source file. To be fair, if you're going to have a stupid long line it's not a bad bet you'll want to run it through go generate, because it's some embeddable asset that has been machine generated. (One could ask why that generation process didn't add a newline or two, but we should cope anyway.) Rewrite the file scanner in "go generate" so it can handle arbitrarily long lines, and only stores in memory those lines that start "//go:generate". Also: Adjust the documentation to make clear that it does not parse the file. Fixes issue 9143. Fixes issue 9196. LGTM=rsc, dominik.honnef R=rsc, cespare, minux, dominik.honnef CC=golang-codereviews https://codereview.appspot.com/182970043
| * cmd/go: regenerate doc.goDominik Honnef2014-12-032-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Move change from CL 170770043 to correct file and regenerate docs for changes from CL 164120043. LGTM=adg R=golang-codereviews, adg, bradfitz CC=golang-codereviews https://codereview.appspot.com/183000043 Committer: Andrew Gerrand <adg@golang.org>
* | [dev.cc] all: merge default (95f5614b4648) into dev.ccRuss Cox2014-11-231-11/+1
|\ \ | |/ | | | | | | | | TBR=austin CC=golang-codereviews https://codereview.appspot.com/177220044
| * cmd/go: fix running pprof on windows.Shenghou Ma2014-11-221-11/+1
| | | | | | | | | | | | | | | | | | | | | | Fixes issue 9149. LGTM=alex.brainman, rsc R=rsc, dave, alex.brainman CC=golang-codereviews https://codereview.appspot.com/176170043 Committer: Russ Cox <rsc@golang.org>
* | [dev.cc] cmd/go: adjust go, cgo builds & disable ccRuss Cox2014-11-111-32/+22
|/ | | | | | | | | | | | | | | | | | | [This CL is part of the removal of C code from package runtime. See golang.org/s/dev.cc for an overview.] Make gcToolchain.cc return an error (no C compiler!). Adjust expectations of cgo, now that cgo does not write any C files (no C compiler!). For packages with .s files, invoke Go compiler with -asmhdr go_asm.h so that assembly files can use it. This applies to all packages but is only needed today by package runtime. LGTM=r R=r CC=austin, golang-codereviews, iant, khr https://codereview.appspot.com/171470043
* cmd/pprof: install as go tool pprofRuss Cox2014-11-091-0/+1
| | | | | | | LGTM=bradfitz, r R=r, bradfitz CC=golang-codereviews https://codereview.appspot.com/168320043
* cmd/go: use golang.org/x/... import pathsAndrew Gerrand2014-11-105-18/+29
| | | | | | | LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/168170043
* cmd/go: disable warnings from cmd/cc when building for SWIGIan Lance Taylor2014-11-071-1/+9
| | | | | | | | | Fixes issue 9065. LGTM=rsc R=rsc, misch CC=golang-codereviews https://codereview.appspot.com/171270043
* cmd/go: fixed typo in doc and generatorGabriel Aszalos2014-10-312-2/+2
| | | | | | | | | LGTM=iant R=golang-codereviews, iant, bradfitz CC=golang-codereviews https://codereview.appspot.com/163690043 Committer: Ian Lance Taylor <iant@golang.org>
* cmd/go: fix minor typoNathan P Finch2014-10-301-1/+1
| | | | | | | | | LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/170770043 Committer: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/go: add get -f flagRuss Cox2014-10-282-2/+22
| | | | | | | | | | | | | | | | | | get -u now checks that remote repo paths match the ones predicted by the import paths: if you are get -u'ing rsc.io/pdf, it has to be checked out from the right location. This is important in case the rsc.io/pdf redirect changes. In some cases, people have good reasons to use non-standard remote repos. Add -f flag to allow that. The f can stand for force or fork, as you see fit. Fixes issue 8850. LGTM=r R=r CC=golang-codereviews https://codereview.appspot.com/164120043
* cmd/go: pass $CGO_LDFLAGS to linker with the "gccgo" toolchain.Peter Collingbourne2014-10-251-0/+1
| | | | | | | | | LGTM=iant R=iant, minux CC=golang-codereviews, golang-dev https://codereview.appspot.com/157460043 Committer: Ian Lance Taylor <iant@golang.org>
* cmd/go: add bzr support for vcs root checkingGustavo Niemeyer2014-10-242-5/+56
| | | | | | | | | Complements the logic introduced in CL 147170043. LGTM=rsc R=rsc, gustavo CC=golang-codereviews https://codereview.appspot.com/147240043
* cmd/go: set exit status for failing "go generate" run.Rob Pike2014-10-201-1/+3
| | | | | | | LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/154360048
* cmd/go: add '_go_' suffix to go files compiled by gccgo to avoid naming ↵Chris Manghane2014-10-151-1/+1
| | | | | | | | | | | conflicts Fixes issue 8828. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/154410043
* cmd/go: add ImportComment to Package structAndrew Gerrand2014-10-083-48/+52
| | | | | | | | | | It seems reasonable that people might want to look up the ImportComment with "go list". LGTM=r R=golang-codereviews, r CC=golang-codereviews https://codereview.appspot.com/143600043
* cmd/go: fix 'go vet' of package with external testsRuss Cox2014-10-064-5/+40
| | | | | | | | | | | | For example, fixes 'go vet syscall', which has source files in package syscall_test. Fixes issue 8511. LGTM=r R=golang-codereviews, r CC=golang-codereviews, iant https://codereview.appspot.com/152220044
* cmd/go: sometimes name tmp test binary test.test.exe on WindowsRuss Cox2014-09-301-0/+37
| | | | | | | | | | | | | | | | | | | | Right now it is always pkgname.test.exe, but if pkgname is patch or install or setup or update, Windows thinks that running it will install new software, so it pops up a dialog box asking for more permission. Renaming the binary avoids the Windows security check. This only applies to the binary that the Go command writes to its temporary work directory. If the user runs 'go test -c' or any of the other ways to generate a test binary, it will continue to use pkgname.test.exe. Fixes issue 8711. LGTM=bradfitz R=golang-codereviews, r CC=alex.brainman, bradfitz, golang-codereviews, iant https://codereview.appspot.com/146580043
* cmd/go: always build _test.go files and link into testRuss Cox2014-09-267-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | go test's handling of _test.go files when the entire package's set of files has no Test functions has varied over the past few releases. There are a few interesting cases (all contain no Test functions): (1) x_test.go has syntax errors (2) x_test.go has type errors (3) x_test.go has runtime errors (say, a func init that panics) In Go 1.1, tests with (1) or (2) failed; (3) passed. In Go 1.2, tests with (1) or (2) failed; (3) passed. In Go 1.3, tests with (1) failed; (2) or (3) passed. After this CL, tests with (1), (2), or (3) all fail. This is clearly a corner case, but it seems to me that the behavior of the test should not change if you add or remove a line like func TestAlwaysPasses(t *testing.T) {} That implies that the _test.go files must always be built and always be imported into the test binary. Doing so means that (1), (2), and (3) must all fail. Fixes issue 8337. LGTM=iant R=golang-codereviews, iant CC=adg, golang-codereviews, r https://codereview.appspot.com/150980043
* cmd/go: fix -aRuss Cox2014-09-261-1/+1
| | | | | | | | | | | The one line that you can't test easily was broken. This manifested as a failure of a pre-existing test in test.bash but I didn't notice it (there are a few other long-standing failures that need to be fixed). TBR=r CC=golang-codereviews https://codereview.appspot.com/146340044
* cmd/go: make build -a skip standard packages in Go releasesRuss Cox2014-09-265-2/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today, 'go build -a my/pkg' and 'go install -a my/pkg' recompile not just my/pkg and all its dependencies that you wrote but also the standard library packages. Recompiling the standard library is problematic on some systems because the installed copy is not writable. The -a behavior means that you can't use 'go install -a all' or 'go install -a my/...' to rebuild everything after a Go release - the rebuild stops early when it cannot overwrite the installed standard library. During development work, however, you do want install -a to rebuild everything, because anything might have changed. Resolve the conflict by making the behavior of -a depend on whether we are using a released copy of Go or a devel copy. In the release copies, -a no longer applies to the standard library. In the devel copies, it still does. This is the latest in a long line of refinements to the "do I build this or not" logic. It is surely not the last. Fixes issue 8290. LGTM=r R=golang-codereviews, r, tracey.brendan CC=adg, golang-codereviews, iant https://codereview.appspot.com/151730045
* cmd/go: handle paths like \x.go on windowsAlex Brainman2014-09-262-2/+62
| | | | | | | | | | | Fixes issue 8130. LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://codereview.appspot.com/143200043 Committer: Russ Cox <rsc@golang.org>
* cmd/go: document that testdata directories are ignoredRuss Cox2014-09-262-11/+21
| | | | | | | | | | | Also rebuild doc.go; was stale, so contains extra changes. Fixes issue 8677. LGTM=r R=golang-codereviews, r CC=golang-codereviews, iant https://codereview.appspot.com/148170043
* cmd/go: add test -o flag to control where test binary is writtenRuss Cox2014-09-263-20/+63
| | | | | | | | | | | While we are here, remove undocumented, meaningless test -file flag. Fixes issue 7724. LGTM=r R=golang-codereviews, r CC=golang-codereviews, iant https://codereview.appspot.com/149070043
* cmd/go: display program name when reporting crashRuss Cox2014-09-262-0/+19
| | | | | | | | | | | Fix by atom (from CL 89190044), comment and test by me. Fixes issue 6823. LGTM=crawshaw R=golang-codereviews, crawshaw CC=0xe2.0x9a.0x9b, adg, golang-codereviews, iant, r https://codereview.appspot.com/148180043
* cmd/go: make malformed import path message more preciseRuss Cox2014-09-261-2/+2
| | | | | | | | | | | | | | | | If you say 'go get -v' you get extra information when import paths are not of the expected form. If you say 'go get -v src/rsc.io/pdf' the message says that src/rsc.io/pdf does not contain a hostname, which is incorrect. The problem is that it does not begin with a hostname. Fixes issue 7432. LGTM=r R=golang-codereviews, r CC=bradfitz, golang-codereviews, iant https://codereview.appspot.com/144650043
* cmd/go: re-resolve and check vcs roots during go get -uRuss Cox2014-09-263-6/+135
| | | | | | | | | | | | | If you do 'go get -u rsc.io/pdf' and then rsc.io/pdf's redirect changes to point somewhere else, after this CL a later 'go get -u rsc.io/pdf' will tell you that. Fixes issue 8548. LGTM=iant R=golang-codereviews, iant CC=adg, golang-codereviews, n13m3y3r, r https://codereview.appspot.com/147170043
* cmd/go: fix 'go get vanity/repo/...' in clean GOPATHRuss Cox2014-09-262-1/+20
| | | | | | | | | | | | | The pattern was only working if the checkout had already been done, but the code was trying to make it work even the first time. Test and fix. Fixes issue 8335. LGTM=r R=golang-codereviews, r CC=golang-codereviews, iant https://codereview.appspot.com/146310043
* cmd/go: install dependencies for 'go build -i' on a commandRuss Cox2014-09-252-47/+78
| | | | | | | | | Fixes issue 8242. LGTM=r R=golang-codereviews, r CC=golang-codereviews, iant https://codereview.appspot.com/147150043
* cmd/go: fix bytes and net the right wayRuss Cox2014-09-241-1/+1
| | | | | | | | | | | | | | | | | | | Not sure why they used empty.s and all these other packages were special cased in cmd/go instead. Add them to the list. This avoids problems with net .s files being compiled with gcc in cgo mode and gcc not supporting // comments on ARM. Not a problem with bytes, but be consistent. The last change fixed the ARM build but broke the Windows build. Maybe *this* will make everyone happy. Sigh. TBR=iant CC=golang-codereviews https://codereview.appspot.com/144530046
* cmd/go: strip -fsanitize= flags when building cgo objectDmitriy Vyukov2014-09-251-0/+8
| | | | | | | | | Fixes issue 8788. LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/142470043
* cmd/go: prohibit C sources files unless using cgoRuss Cox2014-09-244-0/+26
| | | | | | | | | | | | | | Those C files would have been compiled with 6c. It's close to impossible to use C correctly anymore, and the C compilers are going away eventually. Make them unavailable now. go1.4.txt change in CL 145890046 LGTM=iant R=iant CC=golang-codereviews, r https://codereview.appspot.com/149720043
* cmd/go: fix typoSameer Ajmani2014-09-191-2/+2
| | | | | | | LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/138700043
* cmd/go, testing: add TestMain supportRuss Cox2014-09-191-2/+44
| | | | | | | | | Fixes issue 8202. LGTM=r, bradfitz R=r, josharian, bradfitz CC=golang-codereviews https://codereview.appspot.com/148770043
* cmd/go: use pkg-config include pathes in swig and don't double compile c++ ↵Ahmed Waheed Moanes2014-09-161-32/+61
| | | | | | | | | | | | | files. Fixes issue 8566. LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/126210045 Committer: Ian Lance Taylor <iant@golang.org>
* build: adjustments for move from src/pkg to srcRuss Cox2014-09-084-26/+14
| | | | | | | | | | | | | | | | | | | This CL adjusts code referring to src/pkg to refer to src. Immediately after submitting this CL, I will submit a change doing 'hg mv src/pkg/* src'. That change will be too large to review with Rietveld but will contain only the 'hg mv'. This CL will break the build. The followup 'hg mv' will fix it. For more about the move, see golang.org/s/go14nopkg. LGTM=r R=r CC=golang-codereviews https://codereview.appspot.com/134570043
* cmd/go: add missing doc for GOOS and GOARCHChaiShushan2014-08-251-0/+4
| | | | | | | | | LGTM=r R=golang-codereviews, r CC=golang-codereviews https://codereview.appspot.com/133900043 Committer: Rob Pike <r@golang.org>
* cmd/go: clean up a couple of inconsequential nits in generateRob Pike2014-08-252-2/+1
| | | | | | | | | Post-submit glitches caught by reviewers. LGTM=nightlyone, bradfitz R=golang-codereviews, nightlyone, bradfitz CC=golang-codereviews https://codereview.appspot.com/126660043
* cmd/go: add GOOS and GOARCH to generateRob Pike2014-08-252-1/+19
| | | | | | | | | Fixes test failure in build, probably a good idea anyway. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/131210043
* cmd/go: add simple test for generate's line parserRob Pike2014-08-251-0/+46
| | | | | | | LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/128710043
* cmd/go: add go generateRob Pike2014-08-247-2/+491
| | | | | | | | | | | | First cut. Works well enough to support yacc via http://codereview.appspot.com/125620044. LGTM=alex.brainman, rsc R=rsc, alex.brainman CC=golang-codereviews https://codereview.appspot.com/125580044
* cmd/go: fix a couple of errors found by "go vet"Rob Pike2014-08-152-2/+2
| | | | | | | LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/127410043
* all: copy cmd/ld/textflag.h into pkg/GOOS_GOARCHRob Pike2014-08-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | The file is used by assembly code to define symbols like NOSPLIT. Having it hidden inside the cmd directory makes it hard to access outside the standard repository. Solution: As with a couple of other files used by cgo, copy the file into the pkg directory and add a -I argument to the assembler to access it. Thus one can write just #include "textflag.h" in .s files. The names in runtime are not updated because in the boot sequence the file has not been copied yet when runtime is built. All other .s files in the repository are updated. Changes to doc/asm.html, src/cmd/dist/build.c, and src/cmd/go/build.go are hand-made. The rest are just the renaming done by a global substitution. (Yay sam). LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/128050043
* cmd/go: adjust import comment errorRuss Cox2014-08-122-2/+2
| | | | | | | | | Fixes issue 7453. LGTM=r R=r CC=golang-codereviews https://codereview.appspot.com/127210043
* cmd/go, go/build: implement import comment checkingRuss Cox2014-08-1212-1/+58
| | | | | | | | | | | | | | | See golang.org/s/go14customimport for design. Added case to deps_test to allow go/build to import regexp. Not a new dependency, because go/build already imports go/doc which imports regexp. Fixes issue 7453. LGTM=r R=r, josharian CC=golang-codereviews https://codereview.appspot.com/124940043
* cmd/go: fix build in airplane modeMikio Hara2014-08-081-0/+3
| | | | | | | LGTM=iant R=golang-codereviews, adg, iant CC=golang-codereviews https://codereview.appspot.com/122190043
* cmd/go: download test dependencies of all named packagesAndrew Gerrand2014-08-082-1/+14
| | | | | | | | | Fixes issue 8181. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/123870043