This weekly snapshot includes a re-organization of the Go tools.
Only the go, godoc, and gofmt tools are installed to $GOROOT/bin (or $GOBIN).
The remainder are installed to $GOROOT/bin/tool.
This puts the lesser-used tools (6g, cgo, govet, etc.) outside the user PATH.
Instead these tools may be called through the go tool with 'go tool command'.
For example, to vet hello.go you would type 'go tool vet hello.go'.
Type 'go tool' see the list of available tools.
With the move, some tools were given simpler names:
6cov -> cov
6nm -> nm
goapi -> api
gofix -> fix
gopack -> pack
gopprof -> pprof
govet -> vet
goyacc -> yacc
The os/signal package has been moved to exp/signal.
A new tool named 'dist' has been introduced to handle building the gc tool
chain and to bootstrap the go tool. The old build scripts and make files
have been removed.
Other changes:
* 5a, 6a, 8a, cc: check in y.tab.[ch].
* 5l, 6l, 8l, ld: remove memory leaks (thanks Shenghou Ma).
* 5l, 6l, 8l: implement -X flag.
* 5l: make -v option output less nonessential clutter (thanks Shenghou Ma),
optimize the common case in patch() (thanks Shenghou Ma).
* 8a, 8l: implement support for RDTSC instruction (thanks Shenghou Ma).
* 8g: use uintptr for local pc.
* archive/zip: support full range of FileMode flags (thanks Gustavo Niemeyer).
* bufio: remove special error type, update docs.
* build: move the "-c" flag into HOST_CFLAGS (thanks Anthony Martin),
remove unnecessary pragmas (thanks Anthony Martin).
* builder: drop recover blocks.
* bytes: API tweaks.
* cgo: accept null pointers in gccgo flavour of C.GoString (thanks
Rémy Oudompheng),
print line numbers in fatal errors when relevant (thanks Rémy
Oudompheng).
* cmd/dist: add GOBIN to env's output (thanks Gustavo Niemeyer),
fix bug in bsubst (thanks Alex Brainman),
fix build on openbsd (thanks Mikio Hara),
generate files for package runtime,
ignore file names beginning with . or _,
prevent race on VERSION creation (thanks Gustavo Niemeyer).
* cmd/gc: another special (%hhS) case for method names,
describe debugging flags (thanks Anthony Martin),
diagnose \ in import path,
disallow switch _ := v.(type),
don't print implicit type on struct literal in export,
fix codegen reordering for expressions involving && and ||,
use octal escapes in mkopnames (thanks Anthony Martin).
use original constant expression in error messages (thanks Rémy
Oudompheng).
* cmd/go: add support for release tags via git branches (thanks
Gustavo Niemeyer),
build: print import errors when invoked on files (thanks Kyle Lemons),
clean test directories as they complete,
fix error message on non-existing tools (thanks Rémy Oudompheng),
fix handling of gccgo standard library (thanks Rémy Oudompheng),
fixed panic on `go clean -n` and `go clean -x` (thanks Sanjay Menakuru),
introduce support for "go build" with gccgo (thanks Rémy Oudompheng),
make vcs command actually gather output (thanks Roger Peppe),
pass env CGO_CFLAGS to cgo (thanks Jeff Hodges),
record location of failed imports for error reporting (thanks
Rémy Oudompheng).
* cmd/goapi: expand embedded interfaces.
* cmd/goinstall: remove now that 'go get' works (thanks Gustavo Niemeyer).
* cmd/ld: fix gdbscript (thanks Wei Guangjing).
* cmd/pack: change gopack to pack in error messages.
* codereview: miscellaneous fixes and improvements.
* crypto/elliptic: p224Contract could produce a non-minimal representation.
* crypto/tls: better error message when connecting to SSLv3 servers.
* crypto/x509: use case-insensitive hostname matching.
* dashboard: support for sub-repositories, update to go1beta.
* database/sql: permit scanning into interface{}.
* doc: update go1.html for recent changes.
* encoding/base32: add DecodeString and EncodeToString helper methods,
ignore new line characters during decode.
* encoding/base64: ignore new line characters during decode.
* encoding/gob: document CommonType.
* encoding/hex: canonicalize error type names.
* encoding/json: call (*T).MarshalJSON for addressable T values.
* encoding/xml: fix decoding of xml.Name with sub-elements (thanks
Gustavo Niemeyer),
fix documentation for Decoder.Skip.
* exp/norm: Added some benchmarks for form-specific performance measurements,
a few minor changes in prepration for a table format change.
* expvar: revise API.
* fix: add image/{bmp,tiff} to go1pkgrename.
* flag: allow a FlagSet to not write to os.Stderr,
describe valid input for Duration flags.
* fmt: add test of NaN map keys,
fix caching bug in Scan.
* go/build: put a space between 'generated by make' and package statement,
update syslist.go package comment.
* go/doc: fix URL linking in ToHTML (thanks Gary Burd),
added error, rune to list of predeclared types,
don't lose factory functions of non-exported types,
don't show methods of exported anonymous fields,
enable AllMethods flag (and fix logic).
* go/printer: don't print incorrect programs.
* go/scanner: idiomatic receiver names.
* go/spec: update language on map types.
* go/token: remove dependency on encoding/gob.
* gob: fuzz testing, plus a fix for very large type names.
* gobuilder: use go tool to build and test sub-repositories.
* godoc: add URL mode m=methods,
diagnostic for empty FS tree,
fix identifier search,
fix redirect loop for URL "/",
provide link to subdirectories, if any,
sort list of "other packages",
update metadata in appinit.go.
* gophertool: fix link to the build status dashboard (thanks Jongmin Kim).
* hgignore: add VERSION.cache (thanks Gustavo Niemeyer),
delete dregs, ignore tmpltohtml.
* html: add package doc.
* image: add package docs, rename s/UnknownFormatError/ErrFormat/ and,
delete the image.Repeated type,
remove image/bmp and image/tiff from std.
* io/ioutil: document EOF behavior in ReadFile and ReadAll.
* io: API tweaks.
* libmach: add stubs for Plan 9 (thanks Anthony Martin).
* make.bash: don't remove hgpatch.
* math/big: add raw access to Int bits,
API and documentation cleanup.
* misc/goplay: use go tool "run" (thanks Olivier Duperray).
* misc/osx: don't set GOROOT or modify profile files,
update for dist tool, drop image.bash, update readme.
* net, syscall: add IPv4 multicast helpers for windows (thanks Mikio Hara).
* net/http/httputil: fix race in DumpRequestOut,
preserve query params in reverse proxy.
* net/http: don't set Content-Type header for HEAD requests by default
(thanks Patrick Mylund Nielsen),
fix nil pointer dereference in error case (thanks Volker Dobler),
close client fd sooner on response read error,
set cookies in client jar on POST requests (thanks Volker Dobler).
* net/rpc: fix data race on Call.Error.
* net: ListenMulticastUDP to listen concurrently across multiple
listeners (thanks Mikio Hara),
disable normal multicast testing on linux/arm (thanks Mikio Hara),
fix Plan 9 build (thanks Anthony Martin),
fix windows build (thanks Alex Brainman),
move DNSConfigError to a portable file,
remove types InvalidConnError and UnknownSocketError,
replace error variable name e, errno with err (thanks Mikio Hara),
run TestDialTimeout on windows (thanks Alex Brainman),
update comments to remove redundant "net" prefix (thanks Mikio Hara).
* os/exec: TestExtraFiles - close any leaked file descriptors,
make sure file is not closed early in leaked fd test.
* os/signal: move to exp/signal.
* os/user: windows implementation (thanks Alex Brainman).
* os: Process.handle use syscall.Handle (thanks Wei Guangjing),
file windows use syscall.InvalidHandle instead of -1 (thanks
Wei Guangjing),
remove SIGXXX signals variables,
turn FileStat.Sys into a method on FileInfo (thanks Gustavo Niemeyer).
* path/filepath: repair and simplify the symlink test.
* reflect: add comment about Type.Field allocation,
test that PtrTo returns types that match program types.
* runtime: add runtime.cputicks() and seed fastrand with it (thanks
Damian Gryski),
delete UpdateMemStats, replace with ReadMemStats(&stats) (thanks Rémy
Oudompheng),
fix float64 hash,
use GOTRACEBACK to decide whether to show runtime frames,
use per-map hash seeds (thanks Damian Gryski).
* spec: add number to the fibonacci sequence.
* std: add struct field tags to untagged literals.
* strings: add Fields example.
* syscall: add Timeval.Nano, Timespec.Nano, for conversion to Duration,
cache environment variables on Plan 9 (thanks Anthony Martin),
fix // +build comments in types_*.go,
fix build directive in types_linux.go,
update bootstrap scripts to sync with new go command (thanks Mikio Hara).
* test: add import test that caused an incorrect gccgo error,
add test for receiver named _,
add test of NaN in map,
add test which crashed gccgo compiler,
don't use package main for files without a main function,
fix bug headers,
float to integer test case,
make map nan timing test more robust,
match gccgo error messages,
test append with two different named types with same element type,
test method expressions with parameters, and with import,
test slice beyond len,
test that x := <-c accepts a general expression.
* testing: capture panics, present them, and mark the test as a failure.
* unicode: document large var blocks and the SpecialCase vars.
* vet: add a check for untagged struct literals.
Apologies if we missed anyone in the list above. We appreciate all your help.
To see a full list of changes between this and the previous weekly,
after updating, run:
hg log -r weekly.2012-01-27:weekly.2012-02-07
Enjoy.
Andrew
Sammi-Songs-MacBook-Pro:model songyunhui2008$ make
Makefile:1: /Users/songyunhui2008/go/src/Make.inc: No such file or directory
Makefile:10: /Users/songyunhui2008/go/src/Make.pkg: No such file or directory
make: *** No rule to make target `/Users/songyunhui2008/go/src/Make.pkg'. Stop.
Can you say what happens?
It is supposed to work.
Russ
It seems Makefile stop working.Sammi-Songs-MacBook-Pro:model songyunhui2008$ make
Makefile:1: /Users/songyunhui2008/go/src/Make.inc: No such file or directory
Makefile:10: /Users/songyunhui2008/go/src/Make.pkg: No such file or directory
make: *** No rule to make target `/Users/songyunhui2008/go/src/Make.pkg'. Stop.How can I build my package then?
> Where is the package "encoding/git85" ?
Read the previous weekly notes:
http://weekly.golang.org/doc/devel/weekly.html#2012-01-27
Dave.
Worked for me (Linux, FC14, AMD64).
Chris
(for values of "worked" which mean "command took noticable time,
did not generate any reports, and a ./pkg/code.google.com/p/go.codereview/git85
directory materialised.)
--
Chris "allusive" Dollin
It seems that if I set GOBIN to $GOROOT/bin_Linux_x86_64 the tools still
go into $GOROOT/bin/tool. This means it is impossible to have multiple
platforms use the same source tree.
Unless I have just done the build wrong.
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel...@ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@russel.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
We've just tagged a new Go weekly, weekly.2012-02-07.
Please see the mail I posted to golang-nuts yesterday about
the go command. $GOPATH needs to be set to the root of
your work tree, not to the directory containing one specific package.
Russ
Yes, it's a bug. See issue 2234.
Russ
It looks like you have stale files in your src/pkg/runtime directory.
The easiest fix is probably
cd $GOROOT/src/pkg/runtime
rm *
hg revert .
Russ
Is this happening during 'go test'?
The old testing framework may have run tests with
standard input connected to your terminal, but the
new 'go test' runs tests with standard input connected
to /dev/null. Your tcgetattr is failing because it is
querying standard input as if it were a terminal,
but it is not. This is a bug in your code: it should
not insist that standard input be a terminal.
Russ
You're absolutely right. I've created issue 2920.
Russ
Yes, it's a bug. See issue 2234.
Russ
> When GOPATH is not set "make" throws a "can't load package: client:
> package could not be found locally" error.
This would happen because if $GOPATH is not set, it looks in
$GOROOT/src/pkg/client (which I assume does not exist) and
then gives up.
> If I export GOPATH="" make runs just fine.
This sounds like a bug, like go it is treating GOPATH="" like GOPATH=.
However, I cannot reproduce this. Can you reproduce this behavior
outside of make? If so, can you compare the output of 'go list -e -json client'
in the working case against the shouldn't-be-working-but-is case?
Thanks.
Russ
I tried installing & building Go weekly from fresh on Mac OS 10.5.4
32-bit and it failed:
------------------------------------------------------------
$ hg clone -u weekly https://go.googlecode.com/hg/ go
requesting all changes
adding changesets
adding manifests
adding file changes
added 11777 changesets with 44953 changes to 6234 files (+4 heads)
updating to branch default
3211 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd go/src/
$ ./all.bash
# Building C bootstrap tool.
# Building compilers and Go bootstrap tool.
lib9
libbio
libmach
cmd/cov
ld warning: in /Users/mark/opt/go/pkg/obj/cmd/cov/main.o, file is not of required architecture
ld warning: in /Users/mark/opt/go/pkg/obj/cmd/cov/tree.o, file is not of required architecture
ld warning: in /Users/mark/opt/go/pkg/obj/libmach.a, file is not of required architecture
ld warning: in /Users/mark/opt/go/pkg/obj/libbio.a, file is not of required architecture
ld warning: in /Users/mark/opt/go/pkg/obj/lib9.a, file is not of required architecture
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
go tool dist: FAILED: gcc -o /Users/mark/opt/go/bin/tool/cov /Users/mark/opt/go/pkg/obj/cmd/cov/main.o /Users/mark/opt/go/pkg/obj/cmd/cov/tree.o /Users/mark/opt/go/pkg/obj/libmach.a /Users/mark/opt/go/pkg/obj/libbio.a /Users/mark/opt/go/pkg/obj/lib9.a -lm
------------------------------------------------------------
Any suggestions?
Thanks!
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"Advanced Qt Programming" - ISBN 0321635906
http://www.qtrac.eu/aqpbook.html
> /home/santucco/go/src/pkg/runtime/zruntime_defs_linux_amd64.go:7: lock
> redeclared in this block
> previous declaration at
> /home/santucco/go/src/pkg/runtime/runtime_defs.go:9
The file src/pkg/runtime/runtime_defs.go was removed from the master
repository over a year ago. Delete it from your copy.
Ian
On Wed, 08 Feb 2012 13:01:07 +0300, Dave Cheney <da...@cheney.net> wrote:
> Hello,
>
> Make sure that you don't have any left over dregs from previous
> weeklies in your $GOROOT, try hg status $GOROOT and remove any entries
> with a ?
>
> Cheers
>
> Dave
--
Best regards,
Alexander Sychev
Senior Developer
Kaspersky Lab
10/1, 1st Volokolamsky Proezd
Moscow 123060
Russia
Alexande...@kaspersky.com
T/F: +7 495 797 87 00
D: +7 495 797 87 00 x1371
M: +7 916 967 63 93
I forgot to mention that it builds perfectly with weekly-2012-01-27.
[snip]
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"Programming in Python 3" - ISBN 0321680561
http://www.qtrac.eu/py3book.html
Thanks.
Russ
machdep.cpu.extfeatures: XD EM64T
/Users/mark/opt/go/pkg/obj/cmd/cov/main.o: Mach-O 64-bit object x86_64
BTW My Mac is 10.5.8 (not 10.5.4). And I don't actually know if it is
32-bit or 64-bit (I only bought it for cross-platform testing; don't
actually use it).
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
Sorry about this: we are passing different arguments to the compiler
and linker during the bootstrap phase, and it only seems to matter
on older Macs that are 64-bit but default to 32-bit compilation.
http://codereview.appspot.com/5646053 will fix this.
Russ
It works fine for cgo programs. Package net is a cgo program.
It doesn't work fine for programs that require standard input
to be connected to something other than /dev/null.
Russ
What error are you seeing when you try to run the test?
You showed us a snippet of a Makefile that you can't
possibly be using anymore, but nothing about what is
actually going wrong.
Russ
go test runs with /dev/null on standard input. /dev/null is not a terminal.
--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog
-- I'm not absolutely sure of anything.
Delete the line that says
panic("terminal settings could not be got: " + err.Error())
No problem: just to confirm---I did hg pull && hg update tip && cd src
&& ./all.bash and it built fine:-)
Thanks!
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
Regards,
Brian Ketelsen
I run 6g from the command line every day. There's nothing wrong with that.
Russ