Cleanup and friction reduction
For #65355.
Change-Id: Ia14c9dc584a529a35b97801dd3e95b9acc99a511
Reviewed-on: https://go-review.googlesource.com/c/go/+/600436
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Also switch internal/platform to commit the generated code instead of
regenerating it in cmd/dist. Nothing in the generated code depends on
the target configuration, and committing the source file makes it
more amenable to searching and indexing (particularly on
https://cs.opensource.google/go/go).
For #60939.
Change-Id: I9133dfd5129b3c4d7457267589dfac5e7ecbef65
Reviewed-on: https://go-review.googlesource.com/c/go/+/505175
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
During bootstrapping, cmd/dist writes a file indicating which
GOOS/GOARCH combinations are valid, and which support cgo-enabled
builds. That information previously went into the go/build package,
but today it fits in more naturally in the internal/platform package
(which already has a number of functions indicating feature support
for GOOS/GOARCH combinations).
Moreover, as of CL 450739 the cmd/go logic for determining whether to
use cgo is somewhat more nuanced than the go/build logic: cmd/go
checks for the presence of a C compiler, whereas go/build does not
(mostly because it determines its configuration at package-init time,
and checking $PATH for a C compiler is somewhat expensive).
To simplify this situation, this change:
- consolidates the “cgo supported” check in internal/platform
(alongside many other platform-support checks) instead of making
it a one-off in go/build,
- and updates a couple of tests to use testenv.HasCGO instead of
build.Default.CgoEnabled to decide whether to test a cgo-specific
behavior.
For #58884.
For #59500.
Change-Id: I0bb2502dba4545a3d98c9e915727382ce536a0f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/483695
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
We have a make.bash-time generation capability,
so use it to generate the embedded zip file for time/tzdata.
This is one less file to try to review in CLs like CL 455356.
For #22487.
Fixes#43350.
Change-Id: I2fcd0665fa0b1c830baec5fb4cd714483fea25a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/455357
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
The go/build package needs access to this configuration,
so move it into a new package available to the standard library.
Change-Id: I868a94148b52350c76116451f4ad9191246adcff
Reviewed-on: https://go-review.googlesource.com/c/go/+/310731
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
In case of a failed/cancelled build, src/cmd/dist/dist might be left in
place.
Change-Id: Id81b5d663476a880101a2eed54fa051c40b0b0bc
Reviewed-on: https://go-review.googlesource.com/74150
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Some IDEs (e.g. intellij IDE based ones) create the .idea folder
to store project specific settings. This is irrelevant to Go project
that does not assume any specific IDEs, but interferes with git.
Change-Id: I0c93d9a3f7edff095fbe0c7a53b06c92b391c970
Reviewed-on: https://go-review.googlesource.com/53770
Reviewed-by: Ian Lance Taylor <iant@golang.org>
zbootstrap.go was moved in 1e3570a. This updates .gitignore to match.
Change-Id: I7500e0abc8e60b6c36c6ae056b2f68b9d021fc6f
Reviewed-on: https://go-review.googlesource.com/40993
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.
This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.
The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.
For #18653.
Change-Id: I6ee5b053683034ea9462a9a0a4ea4f5ad24fa5a1
Reviewed-on: https://go-review.googlesource.com/36192
Reviewed-by: David Crawshaw <crawshaw@golang.org>
When I wrote the lines
bin/
pkg/
I was trying to match just the top-level bin and pkg directories, and I put the
final slash in because 'git help gitignore' says:
o If the pattern does not contain a slash /, Git treats it as a shell
glob pattern and checks for a match against the pathname relative
to the location of the .gitignore file (relative to the toplevel of
the work tree if not from a .gitignore file).
o Otherwise, Git treats the pattern as a shell glob suitable for
consumption by fnmatch(3) with the FNM_PATHNAME flag: wildcards in
the pattern will not match a / in the pathname. For example,
"Documentation/*.html" matches "Documentation/git.html" but not
"Documentation/ppc/ppc.html" or
"tools/perf/Documentation/perf.html".
Putting a trailing slash was my way of opting in to the "rooted path" semantics
without looking different from the surrounding rooted paths like "src/go/build/zcgo.go".
But HA HA GIT FOOLED YOU! above those two bullets the docs say:
o If the pattern ends with a slash, it is removed for the purpose of
the following description, ...
Change all the patterns to use a leading slash for "rooted" behavior.
This bit me earlier today because I had a perfectly reasonable source
code directory go/src/cmd/go/testdata/src/empty/pkg that was
not added by 'git add empty'.
Change-Id: I6f8685b3c5be22029c33de9ccd735487089a1c03
Reviewed-on: https://go-review.googlesource.com/34832
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Fixes#12272
Change-Id: I2115ec62ed4061084c482eb385a583a1c1909888
Reviewed-on: https://go-review.googlesource.com/22838
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
We no longer use yacc, and we shouldn't have any y.output files.
Change-Id: I045671b6aef3f53c3cfe068b0c14a4871689c13e
Reviewed-on: https://go-review.googlesource.com/22161
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
runtime/internal/sys will hold system-, architecture- and config-
specific constants.
Updates #11647
Change-Id: I6db29c312556087a42e8d2bdd9af40d157c56b54
Reviewed-on: https://go-review.googlesource.com/16817
Reviewed-by: Russ Cox <rsc@golang.org>
These assemblers produce byte-for-byte identical output
to the ones written in C.
They are primarily a proof that cmd/internal/obj can be used
standalone to produce working object files. (The use via objwriter
starts by deserializing an already-constructed internal representation,
so objwriter does not exercise the code in cmd/internal/obj that
creates such a representation from scratch.)
Change-Id: I1793d8d010046cfb9d8b4d2d4469e7f47a3d3ac7
Reviewed-on: https://go-review.googlesource.com/3143
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
cmd/internal/obj needs information about the default
values of GOROOT, GOARM, GOEXPERIMENT, Version, and so on.
It cannot ask package runtime, because during bootstrap
package runtime comes from Go 1.4.
So it must have its own copy.
Change-Id: I73d3e75a3d47210b3184a51a810ebb44826b81e5
Reviewed-on: https://go-review.googlesource.com/3140
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>