Unreviewed changes
5 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: src/cmd/go/internal/doc/pkgsite.go
Insertions: 8, Deletions: 1.
@@ -65,9 +65,16 @@
if err != nil {
base.Fatal(err)
}
+ if len(pkgs) == 0 {
+ base.Fatalf("go: internal error: no packages loaded for %s", pkgVers)
+ }
+ if len(pkgs) > 1 {
+ base.Fatalf("go: internal error: pattern %s matches multiple packages", pkgVers)
+ }
p := pkgs[0]
p.Internal.OmitDebug = true
p.Internal.ExeName = p.DefaultExecName()
+ load.CheckPackageErrors([]*load.Package{p})
a := b.LinkAction(loader, work.ModeBuild, work.ModeBuild, p)
a.CacheExecutable = true
@@ -116,7 +123,7 @@
env = append(env, "GOPROXY="+gomodcache+","+goproxy)
}
- pkgsite := buildPkgsite(context.Background())
+ pkgsite := buildPkgsite(ctx)
cmd := exec.Command(pkgsite, "-gorepo", cfg.GOROOT, "-http", addr, "-open", path)
cmd.Env = env
cmd.Stdout = os.Stderr
```
Change information
Commit message:
cmd/go: build pkgsite doc command in same go command invocation
Instead of running go run. This is enabled by Ian Alexander's work to
remove global state in the loader package.
This also fixes an issue where we can't build and run the pkgsite binary
because, with our GOPROXY setting, if pkgsite module is available in the
module cache at the requested version, but the pkgsite/cmd/internal/doc
module isn't we'll give up trying to fetch the doc module. Now that the
build and execution are separated, we can make sure the GOPROXY setting
is only supplied to the running pkgsite binary, but not to the
operations that build it.
Fixes #78457
Change-Id: Id2a754fee12b68240243773f81e7d00b6a6a6964
Files:
- M src/cmd/go/internal/doc/doc.go
- M src/cmd/go/internal/doc/pkgsite.go
- M src/cmd/go/internal/doc/pkgsite_bootstrap.go
Change size: M
Delta: 3 files changed, 58 insertions(+), 13 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +1 by Michael Matloob, +2 by Dmitri Shuralyov, +1 by Dmitri Shuralyov
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI