go: x/playground: show a meaningful error message for build timeouts

What version of Go are you using (go version)?

The version of Go in use by the play.golang.org.

Does this issue reproduce with the latest release?

N/A

What operating system and processor architecture are you using (go env)?

Go Playground.

What did you do?

Import a module that imports golang.org/x/crypto.

package main

import (
	"fmt"

	"github.com/stellar/go/txnbuild"
)

func main() {
	tx := txnbuild.Transaction{}
	err := tx.Build()
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(tx)
}
--go.mod--
module play.ground
require github.com/stellar/go v0.0.0-20200320201948-bab6abc8fbf3

https://play.golang.org/p/SK8gXGPzUvf

What did you expect to see?

I expected to see the playground’s Go build process find golang.org/x/crypto and continue building, or if there is a build failure, a more meaningful error message.

What did you see instead?

When finding golang.org/x/crypto the build fails. No meaningful error message beyond that is displayed. Timeout is not mentioned so I don’t think the process is taking too long and being killed.

go: finding github.com/stellar/go latest
go: downloading github.com/stellar/go v0.0.0-20200320201948-bab6abc8fbf3
go: extracting github.com/stellar/go v0.0.0-20200320201948-bab6abc8fbf3
go: downloading github.com/pkg/errors v0.8.1
go: downloading golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708
go: downloading github.com/lib/pq v1.2.0
go: downloading github.com/stellar/go-xdr v0.0.0-20180917104419-0bc96f33a18e
go: extracting github.com/pkg/errors v0.8.1
go: extracting github.com/stellar/go-xdr v0.0.0-20180917104419-0bc96f33a18e
go: extracting github.com/lib/pq v1.2.0
go: extracting golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708
go: finding github.com/pkg/errors v0.8.1
go: finding github.com/lib/pq v1.2.0
go: finding github.com/stellar/go-xdr v0.0.0-20180917104419-0bc96f33a18e
go: finding golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708

Go build failed.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (16 by maintainers)

Commits related to this issue

Most upvoted comments

This snippet (https://play.golang.org/p/jRB81AYhnq8) now fails correctly:

timeout running go build
go: downloading github.com/stellar/go v0.0.0-20200320201948-bab6abc8fbf3
go: downloading github.com/pkg/errors v0.8.1
go: downloading github.com/stellar/go-xdr v0.0.0-20180917104419-0bc96f33a18e
go: downloading github.com/lib/pq v1.2.0
go: downloading golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708

Go build failed.

Ok, after lots of cleanup and investigation, there’s a bug in the playground. The build for this code is timing out, but the wrong context is being checked for the timeout error.

I’ll have a patch ready for this soon, along with removing NaCL code as part of #25224

Thanks again for the helpful issue report!

CC @andybons @dmitshur @toothrot @cagedmantis: do y’all maintain the Playground these days? (The entry for it at https://dev.golang.org/owners is blank; I know it used to be mainly @bradfitz.)

CC @ysmolsky who I think has done some work on it too.