]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go: don't install most GOROOT .a files in pkg
authorMichael Matloob <matloob@golang.org>
Wed, 21 Sep 2022 19:51:27 +0000 (15:51 -0400)
committerMichael Matloob <matloob@golang.org>
Fri, 28 Oct 2022 23:35:08 +0000 (23:35 +0000)
commitb726b0cadb5102bb718f879bede0e76d1e5f5c34
treed5e474a4699d75e73039ef92f73ed86d5920424f
parent4c69d0eeb869cdc987e35d09a052a0e0320c0c96
cmd/go: don't install most GOROOT .a files in pkg

Packages in GOROOT that don't use cgo will not be installed in
GOROOT/pkg, and will instead be cached as usual like other Go
packages.

- add a internal/buildinternal package to hold the identities of the
  five packages that use cgo
- update dist's test code to do a go build std cmd before checking
  staleness on builders. Because most of those packages no longer have
  install locations, and have dependencies that don't either, the
  packages need to be cached to not be stale.
- fix index_test to import packages with the path "." when preparing
  the "want" values to compare the indexed data to. (the module index
  matches the behavior of build.ImportDir, which always passes in "."
  as the path.
- In both the index and go/build Importers, don't set
  PkgObj for GOROOT packages which will no longer have install
  targets. PkgTargetRoot will still be set to compute target paths,
  which will still be needed in buildmode=shared.
- "downgrade" all install actions that don't have a target to build
  actions. (The target should already not be set for packages that
  shouldn't be installed).

For #47257

Change-Id: Ia5aee6b3b20b58e028119cf0352a4c4a2f10f6b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/432535
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
18 files changed:
misc/cgo/testshared/shared_test.go
src/cmd/compile/internal/importer/gcimporter.go
src/cmd/dist/test.go
src/cmd/go/go_test.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/modindex/index_test.go
src/cmd/go/internal/modindex/read.go
src/cmd/go/internal/work/action.go
src/cmd/go/internal/work/build.go
src/cmd/go/internal/work/exec.go
src/cmd/go/testdata/script/install_goroot_targets.txt [new file with mode: 0644]
src/cmd/link/link_test.go
src/go/build/build.go
src/go/build/build_test.go
src/go/build/deps_test.go
src/go/internal/gcimporter/gcimporter.go
src/go/types/example_test.go
src/internal/buildinternal/needs_install.go [new file with mode: 0644]