Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/build/cmd/tip: installs x/website/cmd/golangorg from internet instead of the cloned commit #34545

Closed
dmitshur opened this issue Sep 26, 2019 · 2 comments

Comments

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Sep 26, 2019

The golangorgBuilder.Init method of cmd/tip dutifully clones the provided to it revision of the website repository to disk... and then proceeds to completely ignore that revision and just installs the latest version from the internet instead.

That is quite silly; it shouldn't do that.

(It's not very harmful because the intention of golangorgBuilder.Init is to fetch and use the lastest HEAD of go and website repositories, but in addition to doing same work twice, it also means there's a small chance the x/website revision reported by the /_tipstatus endpoint would be slightly off.)


I spotted this problem after debugging issue #34526 and then seeing the following in cmd/tip production logs:

go=225f484c/website=a9a9c92a: 2019/09/26 01:45:14 installing golangorg ...
go=225f484c/website=a9a9c92a: 2019/09/26 01:45:14 go: finding golang.org/x/website latest
go=225f484c/website=a9a9c92a: 2019/09/26 01:45:17 go: downloading golang.org/x/website v0.0.0-20190923174145-a9a9c92a2c93
go=225f484c/website=a9a9c92a: 2019/09/26 01:45:17 go: extracting golang.org/x/website v0.0.0-20190923174145-a9a9c92a2c93
go=225f484c/website=a9a9c92a: 2019/09/26 01:45:18 go: downloading golang.org/x/tools v0.0.0-20190516015132-d1a3278ee749
go=225f484c/website=a9a9c92a: 2019/09/26 01:45:18 go: downloading golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
go=225f484c/website=a9a9c92a: 2019/09/26 01:45:18 go: extracting golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
go=225f484c/website=a9a9c92a: 2019/09/26 01:45:18 go: extracting golang.org/x/tools v0.0.0-20190516015132-d1a3278ee749
go=225f484c/website=a9a9c92a: 2019/09/26 01:45:18 go: finding golang.org/x/tools v0.0.0-20190516015132-d1a3278ee749
go=225f484c/website=a9a9c92a: 2019/09/26 01:45:18 go: finding golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
go=225f484c/website=a9a9c92a: 2019/09/26 01:45:25 starting golangorg ...
@dmitshur dmitshur self-assigned this Sep 26, 2019
@gopherbot gopherbot added this to the Unreleased milestone Sep 26, 2019
@gopherbot
Copy link

@gopherbot gopherbot commented Sep 26, 2019

Change https://golang.org/cl/197397 mentions this issue: cmd/tip: use website repo on disk for installing cmd/golangorg

@dmitshur
Copy link
Member Author

@dmitshur dmitshur commented Sep 26, 2019

This is deployed and I can confirm the fix worked.


go=cf032380/website=a9a9c92a: 2019/09/26 15:05:11 installing golangorg ...
go=cf032380/website=a9a9c92a: 2019/09/26 15:05:12 go: downloading golang.org/x/tools v0.0.0-20190516015132-d1a3278ee749
go=cf032380/website=a9a9c92a: 2019/09/26 15:05:12 go: downloading golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
go=cf032380/website=a9a9c92a: 2019/09/26 15:05:12 go: extracting golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
go=cf032380/website=a9a9c92a: 2019/09/26 15:05:12 go: extracting golang.org/x/tools v0.0.0-20190516015132-d1a3278ee749
go=cf032380/website=a9a9c92a: 2019/09/26 15:05:12 go: finding golang.org/x/tools v0.0.0-20190516015132-d1a3278ee749
go=cf032380/website=a9a9c92a: 2019/09/26 15:05:12 go: finding golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
go=cf032380/website=a9a9c92a: 2019/09/26 15:05:19 starting golangorg ...

Note these lines are no longer there:

go: finding golang.org/x/website latest
go: downloading golang.org/x/website v0.0.0-20190923174145-a9a9c92a2c93
go: extracting golang.org/x/website v0.0.0-20190923174145-a9a9c92a2c93

It's only downloading dependencies now, which is the intended behavior.

codebien added a commit to codebien/build that referenced this issue Nov 13, 2019
The 'go install golang.org/x/website/cmd/golangorg' command is being
configured with GO111MODULE=on and GOPROXY=https://proxy.golang.org
environment variables, but its directory was not set. As a result,
the main module was an empty module (GOMOD=/dev/null) instead of
the module in the website repository that was just checked out.

Set the working directory of the go install command to websiteDir,
so that the intended website module is used during the build.

Fixes golang/go#34545

Change-Id: If51030494ddb90a63b9d198209a04c5fb328784e
Reviewed-on: https://go-review.googlesource.com/c/build/+/197397
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@golang golang locked and limited conversation to collaborators Sep 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.