cmd/tip: also fetch x/net repository before building cmd/godoc
x/tools/cmd/godoc uses at least one Go package from x/net as of
CL 157197.
Don't add it to signature because we don't want the signature to
change whenever new commits to x/net are pushed, causing tip.golang.org
to be redeployed. This is because x/net is not considered a critical
component of the website at this time, and that's not expected to
change soon.
When the website begins using modules, it will specify the x/net
version precisely and this decision will no longer matter.
Fixes golang/go#29874
Change-Id: I1fa76bb81f8d2ffc2314375e2dfe4898c3af58de
Reviewed-on: https://go-review.googlesource.com/c/158937
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/cmd/tip/godoc.go b/cmd/tip/godoc.go
index e6808f5..13b8912 100644
--- a/cmd/tip/godoc.go
+++ b/cmd/tip/godoc.go
@@ -25,13 +25,18 @@
}
func (b godocBuilder) Signature(heads map[string]string) string {
+ // x/net is intentionally not a part of the signature, because
+ // at this time it does not contribute substantially to the deployed
+ // website, and so we don't want tip.golang.org redeployed whenever
+ // x/net changes. This will no longer matter when the Go website uses
+ // modules to pin its dependencies to specific versions.
return fmt.Sprintf("go=%v/tools=%v", prefix8(heads["go"]), prefix8(heads["tools"]))
}
func (b godocBuilder) Init(logger *log.Logger, dir, hostport string, heads map[string]string) (*exec.Cmd, error) {
-
goDir := filepath.Join(dir, "go")
toolsDir := filepath.Join(dir, "gopath/src/golang.org/x/tools")
+ netDir := filepath.Join(dir, "gopath/src/golang.org/x/net")
logger.Printf("checking out go repo ...")
if err := checkout(repoURL+"go", heads["go"], goDir); err != nil {
return nil, fmt.Errorf("checkout of go: %v", err)
@@ -40,6 +45,10 @@
if err := checkout(repoURL+"tools", heads["tools"], toolsDir); err != nil {
return nil, fmt.Errorf("checkout of tools: %v", err)
}
+ logger.Printf("checking out net repo ...")
+ if err := checkout(repoURL+"net", heads["net"], netDir); err != nil {
+ return nil, fmt.Errorf("checkout of net: %v", err)
+ }
var logWriter io.Writer = toLoggerWriter{logger}