x/playground: timeout compiling trivial code that imports net/http
If I try to run the example here:
https://golang.org/pkg/net/http/httputil#DumpResponse
I get this:
~~~ timeout running go build
Go build failed. ~~~
Same result if using same code on the playground:
https://play.golang.org/p/nf79uLXs5-b
If I run locally, it works fine:
~~~ "HTTP/1.1 200 OK\r\nContent-Length: 76\r\nContent-Type: text/plain; charset=utf-8\r\nDate: Wed, 19 Jul 1972 19:00:00 GMT\r\n\r\nGo is a general-purpose language designed with systems programming in mind.\n" ~~~
13 Answer:
It seems to happen with an even simpler program that imports net/http
for side-effects only. For example, I'm getting a "timeout running go build" when trying to run:
package main
import (
_ "fmt"
_ "net/http"
)
func main() {
fmt.Println("output")
}
Instead of the expected build error like "./prog.go:8:2: undefined: fmt".
CC @golang/release.
It's possible that our changes in #44714 and #44389 caused longer compilation times due to differences in what is considered stale now. We might have to increase the compilation timeout to account for this.
Change https://golang.org/cl/302770 mentions this issue: all: instrument build and vet time
Change https://golang.org/cl/302771 mentions this issue: all: increase compile timeout to 10 seconds
Change https://golang.org/cl/302769 mentions this issue: internal/metrics: add new package for recording metrics
Change https://golang.org/cl/303469 mentions this issue: internal/metrics: fix detection of GCE environment
I am going to re-open this. I want to fix it, but have been busy with other things.
@89z FYI, the linked snippet does pass for me after our changes, but still occasionally fails: https://play.golang.org/p/nf79uLXs5-b
Modules by default impacted our caching strategy for dependencies on the playground, and we've not figured out the best way to resolve that yet.
Change https://golang.org/cl/337010 mentions this issue: all: fix build timeouts for std dependent snippets
@89z seems like you identified a real problem which the team is putting real effort into fixing. Ongoing bugs should be tracked by open issues; therefore, I don't see why we should close this issue until the problem is fixed (which seems imminent). If you "lack interest" in this issue, you are welcome to just stop interacting with it.
Additionally, multiple merged and in-progress CLs already reference this issue number, so switching to a new issue now just makes the history harder to follow.
@cespare OK fair enough. I respect you because of your comments on Go generics [1], so whatever you say.
- https://github.com/golang/go/issues/45955#issuecomment-832355311
@89z You should be able to click on the "Unsubscribe" button over on the right if you no longer care about this issue. Thanks.
The playground should deploy shortly, and I'll update here after verifying this was fixed.
Read next
- encoding/json: decoding into existing map pointer values unexpectedly reallocates them
- cmd/go: allow fuzzing multiple targets per package
- I can't install go on freebsd 12.2
- go x/image/bmp: support 1-bit format
- go: don't change the libraries in 1.18
- go proposal: spec: add native support for programming persistent memory in Go
- go github: consider using GitHub Discussions (currently available in beta)
- [Solved] go proposal: spec: direct reference to embedded fields in struct literals