summaryrefslogtreecommitdiff
path: root/src/cmd/pack
Commit message (Collapse)AuthorAgeFilesLines
* all: use testing.GoToolPath instead of "go"Keith Randall2016-08-301-7/+9
| | | | | | | | | | | | | | This change makes sure that tests are run with the correct version of the go tool. The correct version is the one that we invoked with "go test", not the one that is first in our path. Fixes #16577 Change-Id: If22c8f8c3ec9e7c35d094362873819f2fbb8559b Reviewed-on: https://go-review.googlesource.com/28089 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: use SeekStart, SeekCurrent, SeekEndJoe Tsai2016-05-061-2/+2
| | | | | | | | | | | | | | CL/19862 (f79b50b8d5bc159561c1dcf7c17e2a0db96a9a11) recently introduced the constants SeekStart, SeekCurrent, and SeekEnd to the io package. We should use these constants consistently throughout the code base. Updates #15269 Change-Id: If7fcaca7676e4a51f588528f5ced28220d9639a2 Reviewed-on: https://go-review.googlesource.com/22097 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Joe Tsai <joetsai@digital-static.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/pack,vet: use `go doc` instead of `godoc` in docHyang-Ah Hana Kim2016-03-171-1/+1
| | | | | | Change-Id: Ic5f62a7d0a5c090da69213d1d0187af0ea48e358 Reviewed-on: https://go-review.googlesource.com/20820 Reviewed-by: Rob Pike <r@golang.org>
* all: extract "can I exec?" check from tests into internal/testenvRuss Cox2015-06-161-19/+3
| | | | | | | | Change-Id: I7b54be9d8b50b39e01c6be21f310ae9a10404e9d Reviewed-on: https://go-review.googlesource.com/10753 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* all: retire architecture letter in file names, public APIRuss Cox2015-05-211-22/+3
| | | | | | | | | | | | | | | | | This CL removes the remaining visible uses of the "architecture letter" concept. (They are no longer in tool names nor in source directory names.) Because the architecture letter concept is now gone, delete GOCHAR from "go env" output, and change go/build.ArchChar to return an error always. The architecture letter is still used in the compiler and linker sources as a clumsy architecture enumeration, but that use is not visible to Go users and can be cleaned up separately. Change-Id: I4d97a38f372003fb610c9c5241bea440d9dbeb8d Reviewed-on: https://go-review.googlesource.com/10289 Reviewed-by: Rob Pike <r@golang.org>
* all: build and use go tool compile, go tool linkRuss Cox2015-05-211-5/+5
| | | | | | | | | | | | | | | This CL fixes the build to use the newly created go tool compile and go tool link in place of go tool 5g, go tool 5l, and so on. See golang-dev thread titled "go tool compile, etc" for background. Although it was not a primary motivation, this conversion does reduce the wall clock time and cpu time required for make.bash by about 10%. Change-Id: I79cbbdb676cab029db8aeefb99a53178ff55f98d Reviewed-on: https://go-review.googlesource.com/10288 Reviewed-by: Rob Pike <r@golang.org>
* cmd/pack: skip fork test on darwin/arm64David Crawshaw2015-04-131-4/+6
| | | | | | | | Just like darwin/arm. Change-Id: I5ed26975670d4189a46b585a56c66c199905d168 Reviewed-on: https://go-review.googlesource.com/8823 Reviewed-by: Minux Ma <minux@golang.org>
* cmd/pack: skip fork test on darwin/armDavid Crawshaw2015-03-011-0/+8
| | | | | | Change-Id: I65b50d2501fe822bc9044a851ac0b3467feadd9f Reviewed-on: https://go-review.googlesource.com/6330 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/pack: simplify the testing logic slightlyRob Pike2015-02-051-8/+1
| | | | | | | | | | | Followup to https://go-review.googlesource.com/3910 We only need 1000 iteratinons. Change-Id: Ib63ae53105176abec77bad9609d638aeda7bcd61 Reviewed-on: https://go-review.googlesource.com/3901 Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* cmd/pack: make a test less disk-intensive in short modeBrad Fitzpatrick2015-01-301-1/+8
| | | | | | | | Fixes #9656 Change-Id: I1158636683492ef12eeafb12e257d205026adc3f Reviewed-on: https://go-review.googlesource.com/3175 Reviewed-by: Minux Ma <minux@golang.org>
* cmd/pack: address go vet reportsEmil Hessman2014-12-281-2/+2
| | | | | | | | Use log.Fatalf for formatting directives instead of log.Fatal Change-Id: Ia207b320f5795c63cdfa71f92c19ca6d05cc833f Reviewed-on: https://go-review.googlesource.com/2160 Reviewed-by: Minux Ma <minux@golang.org>
* cmd/pack: fix c command for existing fileRob Pike2014-09-233-20/+57
| | | | | | | | | | | | | | | | There were at least two bugs: 1) It would overwrite a non-archive. 2) It would truncate a non-archive and then fail. In general the file handling was too clever to be correct. Make it more straightforward, doing the creation separately from archive management. Fixes #8369. LGTM=adg, iant R=golang-codereviews, adg, iant CC=golang-codereviews https://golang.org/cl/147010046
* cmd/pack: skip test on android (no Go tool)David Crawshaw2014-07-081-4/+6
| | | | | | | LGTM=minux R=golang-codereviews, minux CC=golang-codereviews https://golang.org/cl/107600043
* build: make nacl passRuss Cox2014-05-201-0/+9
| | | | | | | | | | | | | | | | Add nacl.bash, the NaCl version of all.bash. It's a separate script because it builds a variant of package syscall with a large zip file embedded in it, containing all the input files needed for tests. Disable various tests new since the last round, mostly the ones using os/exec. Fixes #7945. LGTM=dave R=golang-codereviews, remyoudompheng, dave, bradfitz CC=golang-codereviews https://golang.org/cl/100590044
* cmd/pack: buffer writes in TestLargeDefsAnthony Martin2014-05-151-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | TestLargeDefs was issuing over one million small writes to create a 7MB file (large.go). This is quite slow on Plan 9 since our disk file systems aren't very fast and they're usually accessed over the network. Buffering the writes makes the test about six times faster. Even on Linux, it's about 1.5 times faster. Here are the results on a slow Plan 9 machine: Before: % ./pack.test -test.v -test.run TestLargeDefs === RUN TestLargeDefs --- PASS: TestLargeDefs (125.11 seconds) PASS After: % ./pack.test -test.v -test.run TestLargeDefs === RUN TestLargeDefs --- PASS: TestLargeDefs (20.835 seconds) PASS LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/95040044
* src: fix issues found by go vet stdRobert Hencke2014-04-261-2/+2
| | | | | | | LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/96850043
* cmd/pack: avoid ./ import in test (fix Windows build)Russ Cox2014-04-171-3/+3
| | | | | | | | | | | | | It is possible to use ./ imports on Windows but it requires some extra command-line work ('go build' does this automatically, but we can't use 'go build' here). Instead, use an ordinary import and -I/-L, which are easier to use. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/89040043
* cmd/pack: handle very long lines in pkgdefIan Lance Taylor2014-04-172-24/+98
| | | | | | | LGTM=rsc, bradfitz R=golang-codereviews, rsc, bradfitz CC=golang-codereviews https://golang.org/cl/88170049
* cmd/pack: print error along with usageRuss Cox2014-04-151-0/+4
| | | | | | | | | | | My cmd/go got in a weird state where it started invoking pack grcP. Change pack to print a 1-line explanation of the usage problem before the generic usage message. LGTM=r R=r CC=golang-codereviews https://golang.org/cl/87770047
* os/exec: always try appropriate command extensions during Cmd.Start on windowsAlex Brainman2014-04-041-1/+1
| | | | | | | | | | | Update #7362 Fixes #7377 Fixes #7570 LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://golang.org/cl/83020043
* cmd/pack: fix format string error in log messageDave Cheney2014-04-031-1/+1
| | | | | | | | | | | Fixes #7693. pack.go:347: possible formatting directive in Fatal call LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/83310045
* cmd/pack: fix matchRuss Cox2014-02-202-6/+24
| | | | | | | | | | | | | | | | | | | | Match used len(ar.files) == 0 to mean "match everything" but it also deleted matched things from the list, so once you had matched everything you asked for, match returned true for whatever was left in the archive too. Concretely, if you have an archive containing f1, f2, then pack t foo.a f1 would match f1 and then, because len(ar.files) == 0 after deleting f1 from the match list, also match f2. Avoid the problem by recording explicitly whether match matches everything. LGTM=r, dsymonds R=r, dsymonds CC=golang-codereviews https://golang.org/cl/65630046
* cmd/pack: provide executable name in TestHelloAlex Brainman2014-02-201-1/+1
| | | | | | | | | | | otherwise go build command adds .exe suffix Fixes #7362 LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/66250043
* cmd/pack: another attempt to fix the build for TestHelloRob Pike2014-02-191-1/+1
| | | | | | | | | Plan 9 uses single quotes, not double quotes. I should have known. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://golang.org/cl/66240043
* cmd/pack: don't look for " in output from go envRob Pike2014-02-191-4/+8
| | | | | | | | | | Windows at least doesn't emit one. Maybe fix Windows build. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://golang.org/cl/66120046
* cmd/pack: dump output of command of "go env" command in testRob Pike2014-02-191-1/+1
| | | | | | | | | | | | | | Get more information to help understand build failure on Plan 9. Also Windows. (TestHello is failing because GOCHAR does not appear in output. What does?) Update #7362 LGTM=bradfitz R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/66070044
* cmd/pack: add 'c' command to create archiveRuss Cox2014-02-193-10/+135
| | | | | | | | | | | | | When Go 1.3 is released, this will keep existing Go 1.2 build scripts that use 'go tool pack grc' working. For efficiency, such scripts should be changed to use 6g -pack instead, but keeping the old behavior available enables a more graceful transition. LGTM=r R=r CC=golang-codereviews https://golang.org/cl/66130043
* cmd/pack: use log.SetPrefix to make log calls more compact and consistentRob Pike2014-02-191-17/+18
| | | | | | | | | Taking my own advice from a review of addr2line. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/65950044
* cmd/pack: rewrite in GoRob Pike2014-01-155-1610/+672
| | | | | | | | | | | | | | | | Replace the pack command, a C program, with a clean reimplementation in Go. It does not need to reproduce the full feature set and it is no longer used by the build chain, but has a role in looking inside archives created by the build chain directly. Since it's not in C, it is no longer build by dist, so remove it from cmd/dist and make it a "tool" in cmd/go terminology. Fixes #2705 R=rsc, dave, minux.ma, josharian CC=golang-codereviews https://golang.org/cl/52310044
* libmach: remove old object file readersRuss Cox2013-12-201-103/+4
| | | | | | | | | | | These no longer work; removing them makes other refactoring easier. The code for pack P being deleted in this CL does not work either. I created issue 6989 to track restoring this functionality (probably not until pack is written in Go). R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/44300043
* cmd/pack: stop parsing object files to generate __.SYMDEFRuss Cox2013-12-091-53/+14
| | | | | | | | Nothing looks at __.SYMDEF, and the object file format is changing. R=golang-dev, r CC=golang-dev https://golang.org/cl/39580044
* build: remove various uses of C undefined behaviorRuss Cox2013-09-091-10/+1
| | | | | | | | | | | | | | | | | | If you thought gcc -ansi -pedantic was pedantic, just wait until you meet clang -fsanitize=undefined. I think this addresses all the reported "errors", but we'll need another run to be sure. all.bash still passes. Update #5764 Dave, can you please try again? R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/13334049
* libbio, all cmd: consistently use BGETC/BPUTC instead of Bgetc/BputcDmitriy Vyukov2013-08-301-14/+11
| | | | | | | | | | | | | | | | | | | Also introduce BGET2/4, BPUT2/4 as they are widely used. Slightly improve BGETC/BPUTC implementation. This gives ~5% CPU time improvement on go install -a -p1 std. Before: real user sys 0m23.561s 0m16.625s 0m5.848s 0m23.766s 0m16.624s 0m5.846s 0m23.742s 0m16.621s 0m5.868s after: 0m22.999s 0m15.841s 0m5.889s 0m22.845s 0m15.808s 0m5.850s 0m22.889s 0m15.832s 0m5.848s R=golang-dev, r CC=golang-dev https://golang.org/cl/12745047
* cmd/pack: support removing of leading file prefix on windowsAlex Brainman2013-07-261-3/+25
| | | | | | | | Fixes #5550 R=golang-dev, r CC=golang-dev https://golang.org/cl/11904043
* cmd/godoc: use go/build to determine package and example filesRobert Griesemer2013-02-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Also: - faster code for example extraction - simplify handling of command documentation: all "main" packages are treated as commands - various minor cleanups along the way For commands written in Go, any doc.go file containing documentation must now be part of package main (rather then package documentation), otherwise the documentation won't show up in godoc (it will still build, though). For commands written in C, documentation may still be in doc.go files defining package documentation, but the recommended way is to explicitly ignore those files with a +build ignore constraint to define package main. Fixes #4806. R=adg, rsc, dave, bradfitz CC=golang-dev https://golang.org/cl/7333046
* cmd/pack: rename __.SYMDEF to __.GOSYMDEFRuss Cox2012-09-131-1/+1
| | | | | | | | | | | | | | | | This fixes a problem with ELF tools thinking they know the format of the symbol table, as we do not use any of the standard formats for that table. This change will probably annoy the Plan 9 users, but I believe there are other incompatibilities already that mean they have to use a Go-specific nm. Fixes #3473. R=golang-dev, iant CC=golang-dev https://golang.org/cl/6500117
* cmd/pack: remove unused paging logicDave Cheney2012-07-121-58/+7
| | | | | | | | | | This is the remainder of https://golang.org/cl/4601051. Partially addresses issue 2705. R=golang-dev, r, bradfitz, minux.ma CC=golang-dev https://golang.org/cl/6354066
* cmd/pack: also recognize '\\' as path separator in filenamesShenghou Ma2012-03-171-3/+6
| | | | | | R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5841051
* cmd: update formatting of usage messagesAndrew Gerrand2012-03-051-1/+2
| | | | | | R=golang-dev, r, minux.ma CC=golang-dev https://golang.org/cl/5738045
* build: delete make paraphernaliaRuss Cox2012-02-061-9/+2
| | | | | | | | | | As a convenience to people working on the tools, leave Makefiles that invoke the go dist tool appropriately. They are not used during the build. R=golang-dev, bradfitz, n13m3y3r, gustavo CC=golang-dev https://golang.org/cl/5636050
* cmd/pack: change gopack to pack in error messagesRob Pike2012-01-301-35/+34
| | | | | | R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5598051
* gopack: rename pack, move to go-tool directoryRob Pike2012-01-303-0/+1804
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5598045