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

go/internal/srcimporter: TestImportedTypes depends on the network, breaks several builds #30760

Closed
bradfitz opened this issue Mar 12, 2019 · 5 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.

Comments

@bradfitz
Copy link
Contributor

A new(?) test brought in with a vendor update in c5cf662 requires the network (even in short mode) and fails on a number of builds.

Repro:

bradfitz@gdev:~/go/src$ ./make.bash 
Building Go cmd/dist using /home/bradfitz/go1.4.
Building Go toolchain1 using /home/bradfitz/go1.4.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for linux/amd64.
---
Installed Go for linux/amd64 in /home/bradfitz/go
Installed commands in /home/bradfitz/go/bin

bradfitz@gdev:~/go/src$ go version
go version devel +8b2a2d0394 Tue Mar 12 02:07:34 2019 +0000 linux/amd64

bradfitz@gdev:~/go/src$ mkdir -p /tmp/foo; GO111MODULE= GOPATH=/tmp/foo GOPROXY=off go test -v -run=TestImportedTypes -short go/internal/srcimporter -count=1
=== RUN   TestImportedTypes
--- FAIL: TestImportedTypes (0.47s)
    srcimporter_test.go:120: go/build: importGo golang.org/x/text/unicode/norm: exit status 1
        go: downloading golang.org/x/text v0.1.1-0.20171102144821-8253218a5ec6
        can't load package: package golang.org/x/text/unicode/norm: unknown import path "golang.org/x/text/unicode/norm": module lookup disabled by GOPROXY=off
        
        
FAIL
FAIL    go/internal/srcimporter 0.476s

/cc @jayconrod @bcmills @eliasnaur @dmitshur

@bradfitz
Copy link
Contributor Author

Notably, this part of that CL:

https://go-review.googlesource.com/c/go/+/164623/19/src/go/internal/srcimporter/srcimporter_test.go

diff --git a/src/go/internal/srcimporter/srcimporter_test.go b/src/go/internal/srcimporter/srcimporter_test.go
index b84672610c..087f97461e 100644
--- a/src/go/internal/srcimporter/srcimporter_test.go
+++ b/src/go/internal/srcimporter/srcimporter_test.go
@@ -99,7 +99,7 @@ var importedObjectTests = []struct {
        {"math.Pi", "const Pi untyped float"},
        {"math.Sin", "func Sin(x float64) float64"},
        {"math/big.Int", "type Int struct{neg bool; abs nat}"},
-       {"internal/x/text/unicode/norm.MaxSegmentSize", "const MaxSegmentSize untyped int"},
+       {"golang.org/x/text/unicode/norm.MaxSegmentSize", "const MaxSegmentSize untyped int"},
 }
 

@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 12, 2019
@gopherbot
Copy link

Change https://golang.org/cl/167038 mentions this issue: go/internal/srcimporter: don't depend on the network in short mode test

@bcmills
Copy link
Contributor

bcmills commented Mar 12, 2019

The test is not new, just newly-exposed. CL 166977 has a hacky workaround; a proper fix will require a bit more work on srcimporter.

@gopherbot
Copy link

Change https://golang.org/cl/167039 mentions this issue: dashboard: set GOPROXY=off for the "go" repo to catch more network usage

@gopherbot
Copy link

Change https://golang.org/cl/166977 mentions this issue: go/build: bypass importGo if srcDir is in GOROOT/src

gopherbot pushed a commit to golang/build that referenced this issue Mar 13, 2019
Updates golang/go#30612
Updates golang/go#30760

Change-Id: I296f4f7a163c1bdd59e839229c0961b21f26da89
Reviewed-on: https://go-review.googlesource.com/c/build/+/167039
Reviewed-by: Bryan C. Mills <bcmills@google.com>
@golang golang locked and limited conversation to collaborators Mar 11, 2020
@rsc rsc unassigned bcmills Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants