Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3532)

Issue 5011046: code review 5011046: build: add build comments to core packages (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 2 months ago by rsc
Modified:
13 years, 2 months ago
Reviewers:
CC:
golang-dev, r, gri, r2, gustavo_niemeyer.net
Visibility:
Public.

Description

build: add build comments to core packages The go/build package already recognizes system-specific file names like mycode_darwin.go mycode_darwin_386.go mycode_386.s However, it is also common to write files that apply to multiple architectures, so a recent CL added to go/build the ability to process comments listing a set of conditions for building. For example: // +build darwin freebsd openbsd/386 says that this file should be compiled only on OS X, FreeBSD, or 32-bit x86 OpenBSD systems. These conventions are not yet documented (hence this long CL description). This CL adds build comments to the multi-system files in the core library, a step toward making it possible to use go/build to build them. With this change go/build can handle crypto/rand, exec, net, path/filepath, os/user, and time. os and syscall need additional adjustments.

Patch Set 1 #

Patch Set 2 : diff -r db14453eda18 https://go.googlecode.com/hg #

Patch Set 3 : diff -r e292d4870573 https://go.googlecode.com/hg #

Patch Set 4 : diff -r f2a60b866526 https://go.googlecode.com/hg #

Patch Set 5 : diff -r a12d99eb48bb https://go.googlecode.com/hg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -3 lines) Patch
M src/pkg/crypto/rand/rand_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/exec/lp_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/cgo_bsd.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/cgo_stub.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/cgo_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/dnsclient_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/dnsconfig.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/fd.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/file.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/interface_bsd.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/interface_stub.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/iprawsock_posix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/ipsock_posix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/lookup_unix.go View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M src/pkg/net/newpollserver.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/port.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/sendfile_stub.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/sock.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/sock_bsd.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/tcpsock_posix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/udpsock_posix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/unixsock_posix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/dir_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/env_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/error_posix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/exec_posix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/exec_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/file_posix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/file_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/path_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/str.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/sys_bsd.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/user/lookup_stubs.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/os/user/lookup_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/path/Makefile View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/pkg/path/filepath/path_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/syscall/bpf_bsd.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/syscall/exec_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/syscall/route_bsd.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/syscall/sockcmsg_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/syscall/syscall_bsd.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/syscall/syscall_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/time/sys_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/time/zoneinfo_posix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/time/zoneinfo_unix.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 17
rsc
Hello golang-dev (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg
13 years, 2 months ago (2011-09-15 16:26:05 UTC) #1
r
do they have to be //build as opposed to // build ?
13 years, 2 months ago (2011-09-15 17:04:21 UTC) #2
gri
it does match the //line comments we already have (though I wish it were // ...
13 years, 2 months ago (2011-09-15 17:08:08 UTC) #3
rsc
On Thu, Sep 15, 2011 at 13:04, <r@golang.org> wrote: > do they have to be ...
13 years, 2 months ago (2011-09-15 17:09:05 UTC) #4
r2
On Sep 15, 2011, at 10:07 AM, Robert Griesemer wrote: > it does match the ...
13 years, 2 months ago (2011-09-15 17:15:58 UTC) #5
rsc
there's always // pragma line
13 years, 2 months ago (2011-09-15 17:16:41 UTC) #6
r2
On Sep 15, 2011, at 10:09 AM, Russ Cox wrote: > On Thu, Sep 15, ...
13 years, 2 months ago (2011-09-15 17:16:59 UTC) #7
r2
there's also the way the tests do it, where the first line is the magic ...
13 years, 2 months ago (2011-09-15 17:19:42 UTC) #8
rsc
On Thu, Sep 15, 2011 at 13:19, Rob 'Commander' Pike <r@google.com> wrote: > there's also ...
13 years, 2 months ago (2011-09-15 17:21:56 UTC) #9
r2
On Sep 15, 2011, at 10:21 AM, Russ Cox wrote: > On Thu, Sep 15, ...
13 years, 2 months ago (2011-09-15 17:31:42 UTC) #10
gustavo_niemeyer.net
> a precedent for a completely unrelated concept, so not really a precedent at all. ...
13 years, 2 months ago (2011-09-15 17:39:01 UTC) #11
rsc
On Thu, Sep 15, 2011 at 13:38, Gustavo Niemeyer <gustavo@niemeyer.net> wrote: > In terms of ...
13 years, 2 months ago (2011-09-15 17:40:29 UTC) #12
rsc
giving line 1 special meaning doesn't help when the second thing like this comes along. ...
13 years, 2 months ago (2011-09-15 18:15:18 UTC) #13
r2
ok, you've convinced me. but please allow for a little more free-formness, which means not ...
13 years, 2 months ago (2011-09-15 18:24:28 UTC) #14
rsc
Hello golang-dev@googlegroups.com, r@golang.org, gri@golang.org, r@google.com, gustavo@niemeyer.net (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 2 months ago (2011-09-15 18:58:05 UTC) #15
r
LGTM
13 years, 2 months ago (2011-09-15 19:29:33 UTC) #16
rsc
13 years, 2 months ago (2011-09-15 20:49:00 UTC) #17
*** Submitted as http://code.google.com/p/go/source/detail?r=6444b585d1ef ***

build: add build comments to core packages

The go/build package already recognizes
system-specific file names like

        mycode_darwin.go
        mycode_darwin_386.go
        mycode_386.s

However, it is also common to write files that
apply to multiple architectures, so a recent CL added
to go/build the ability to process comments
listing a set of conditions for building.  For example:

        // +build darwin freebsd openbsd/386

says that this file should be compiled only on
OS X, FreeBSD, or 32-bit x86 OpenBSD systems.

These conventions are not yet documented
(hence this long CL description).

This CL adds build comments to the multi-system
files in the core library, a step toward making it
possible to use go/build to build them.

With this change go/build can handle crypto/rand,
exec, net, path/filepath, os/user, and time.

os and syscall need additional adjustments.

R=golang-dev, r, gri, r, gustavo
CC=golang-dev
http://codereview.appspot.com/5011046
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b