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

cmd/go: TestScript/mod_convert_dep assumes that no parent of $WORK contains version-control metadata #39431

Closed
hongyi-zhao opened this issue Jun 6, 2020 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@hongyi-zhao
Copy link

Hi,

On Ubuntu 20.04, I try to use the following steps to compile the go git master version:

$ sudo apt-get install golang
$ sudo apt-get build-dep golang
$ git clone https://github.com/golang/go.git go.git
$ cd go.git/src
$ ./all.bash
Building Go cmd/dist using /usr/lib/go-1.13. (go1.13.8 linux/amd64)
Building Go toolchain1 using /usr/lib/go-1.13.
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.

##### Testing packages.
ok  	archive/tar	0.284s
ok  	archive/zip	0.283s
ok  	bufio	0.281s
ok  	bytes	0.610s
ok  	compress/bzip2	0.302s
ok  	compress/flate	0.776s
ok  	compress/gzip	0.348s
ok  	compress/lzw	0.155s
ok  	compress/zlib	0.242s
ok  	container/heap	0.166s
ok  	container/list	0.152s
ok  	container/ring	0.138s
ok  	context	0.200s
ok  	crypto	0.166s
ok  	crypto/aes	0.176s
ok  	crypto/cipher	0.163s
ok  	crypto/des	0.109s
ok  	crypto/dsa	0.149s
ok  	crypto/ecdsa	0.552s
ok  	crypto/ed25519	0.279s
ok  	crypto/elliptic	0.178s
ok  	crypto/hmac	0.139s
ok  	crypto/internal/subtle	0.165s
ok  	crypto/md5	0.104s
ok  	crypto/rand	0.165s
ok  	crypto/rc4	0.199s
ok  	crypto/rsa	0.401s
ok  	crypto/sha1	0.120s
ok  	crypto/sha256	0.108s
ok  	crypto/sha512	0.153s
ok  	crypto/subtle	0.173s
ok  	crypto/tls	0.776s
ok  	crypto/x509	1.324s
ok  	database/sql	0.990s
ok  	database/sql/driver	0.152s
ok  	debug/dwarf	0.113s
ok  	debug/elf	0.317s
ok  	debug/gosym	0.196s
ok  	debug/macho	0.144s
ok  	debug/pe	0.139s
ok  	debug/plan9obj	0.149s
ok  	encoding/ascii85	0.141s
ok  	encoding/asn1	0.108s
ok  	encoding/base32	0.191s
ok  	encoding/base64	0.161s
ok  	encoding/binary	0.015s
ok  	encoding/csv	0.010s
ok  	encoding/gob	0.530s
ok  	encoding/hex	0.128s
ok  	encoding/json	0.296s
ok  	encoding/pem	0.318s
ok  	encoding/xml	0.227s
ok  	errors	0.155s
ok  	expvar	0.183s
ok  	flag	0.295s
ok  	fmt	0.394s
ok  	go/ast	0.175s
ok  	go/build	0.544s
ok  	go/constant	0.186s
ok  	go/doc	0.325s
ok  	go/format	0.300s
ok  	go/importer	0.470s
ok  	go/internal/gccgoimporter	0.148s
ok  	go/internal/gcimporter	0.868s
ok  	go/internal/srcimporter	7.308s
ok  	go/parser	0.222s
ok  	go/printer	0.577s
ok  	go/scanner	0.171s
ok  	go/token	0.189s
ok  	go/types	1.482s
ok  	hash	0.158s
ok  	hash/adler32	0.158s
ok  	hash/crc32	0.158s
ok  	hash/crc64	0.150s
ok  	hash/fnv	0.151s
ok  	hash/maphash	0.314s
ok  	html	0.176s
ok  	html/template	0.295s
ok  	image	0.295s
ok  	image/color	0.264s
ok  	image/draw	0.320s
ok  	image/gif	0.622s
ok  	image/jpeg	0.328s
ok  	image/png	0.269s
ok  	index/suffixarray	0.457s
ok  	internal/cpu	0.046s
ok  	internal/fmtsort	0.183s
ok  	internal/poll	0.307s
ok  	internal/profile	0.182s
ok  	internal/reflectlite	0.335s
ok  	internal/singleflight	0.198s
ok  	internal/trace	0.242s
ok  	internal/unsafeheader	0.179s
ok  	internal/xcoff	0.178s
ok  	io	0.276s
ok  	io/ioutil	0.163s
ok  	log	0.290s
ok  	log/syslog	1.558s
ok  	math	0.182s
ok  	math/big	1.341s
ok  	math/bits	0.195s
ok  	math/cmplx	0.281s
ok  	math/rand	0.465s
ok  	mime	0.298s
ok  	mime/multipart	0.606s
ok  	mime/quotedprintable	0.322s
ok  	net	2.155s
ok  	net/http	11.340s
ok  	net/http/cgi	0.589s
ok  	net/http/cookiejar	0.240s
ok  	net/http/fcgi	0.214s
ok  	net/http/httptest	0.300s
ok  	net/http/httptrace	0.008s
ok  	net/http/httputil	0.226s
ok  	net/http/internal	0.191s
ok  	net/http/pprof	5.337s
ok  	net/internal/socktest	0.195s
ok  	net/mail	0.346s
ok  	net/rpc	0.241s
ok  	net/rpc/jsonrpc	0.264s
ok  	net/smtp	0.443s
ok  	net/textproto	0.236s
ok  	net/url	0.230s
ok  	os	1.049s
ok  	os/exec	1.712s
ok  	os/signal	2.838s
ok  	os/user	0.227s
ok  	path	0.179s
ok  	path/filepath	0.223s
ok  	plugin	0.252s
ok  	reflect	0.804s
ok  	regexp	0.298s
ok  	regexp/syntax	0.590s
ok  	runtime	54.711s
ok  	runtime/debug	0.256s
ok  	runtime/internal/atomic	0.242s
ok  	runtime/internal/math	0.169s
ok  	runtime/internal/sys	0.169s
ok  	runtime/pprof	5.894s
ok  	runtime/trace	2.804s
ok  	sort	0.333s
ok  	strconv	0.721s
ok  	strings	0.464s
ok  	sync	1.067s
ok  	sync/atomic	0.528s
ok  	syscall	0.178s
ok  	testing	0.773s
ok  	testing/iotest	0.240s
ok  	testing/quick	0.329s
ok  	text/scanner	0.339s
ok  	text/tabwriter	0.237s
ok  	text/template	0.355s
ok  	text/template/parse	0.380s
ok  	time	2.613s
ok  	unicode	0.238s
ok  	unicode/utf16	0.214s
ok  	unicode/utf8	0.223s
ok  	cmd/addr2line	3.075s
ok  	cmd/api	1.892s
ok  	cmd/asm/internal/asm	0.956s
ok  	cmd/asm/internal/lex	0.262s
ok  	cmd/compile	0.032s
ok  	cmd/compile/internal/gc	5.518s
ok  	cmd/compile/internal/logopt	1.433s
ok  	cmd/compile/internal/ssa	0.461s
ok  	cmd/compile/internal/syntax	0.328s
ok  	cmd/compile/internal/test	0.289s [no tests to run]
ok  	cmd/compile/internal/types	0.274s
ok  	cmd/cover	2.988s
ok  	cmd/doc	0.624s
ok  	cmd/fix	1.258s
go test proxy running at GOPROXY=http://127.0.0.1:39775/mod
go proxy: no archive rsc.io v1.5.2: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.1.0: file does not exist
go proxy: no archive rsc.io v1.5.1: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive test.go v1.0.0: file does not exist
go proxy: no archive rsc.io v1.5.2: file does not exist
go proxy: no archive example.com/newcycle v1.0.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
go proxy: no archive rsc.io v1.0.0: file does not exist
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/mod_convert_dep (0.48s)
        script_test.go:209: 
            # We should not create a go.mod file unless the user ran 'go mod init' explicitly.
            # However, we should suggest 'go mod init' if we can find an alternate config file. (0.122s)
            # The command we suggested should succeed. (0.227s)
            # In Plan 9, directories are automatically created in /n.
            # For example, /n/Gopkg.lock always exists, but it's a directory.
            # Test that we ignore directories when trying to find alternate config files. (0.127s)
            > cd $WORK/gopkgdir/x
            $WORK/gopkgdir/x
            > ! go list .
            [stderr]
            goroutine 1 [running]:
            runtime/debug.Stack(0x1, 0x1, 0xafede0)
            	/home/werner/Public/lang/golang/go.git/src/runtime/debug/stack.go:24 +0x9f
            runtime/debug.PrintStack()
            	/home/werner/Public/lang/golang/go.git/src/runtime/debug/stack.go:16 +0x25
            cmd/go/internal/modload.die()
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/internal/modload/init.go:314 +0x2fe
            cmd/go/internal/modload.ModRoot(0xc0001423c0, 0x1)
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/internal/modload/init.go:279 +0x55
            cmd/go/internal/modload.ImportPathsQuiet.func1(0xc000012080, 0x1, 0x1, 0x1)
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/internal/modload/load.go:88 +0x26a
            cmd/go/internal/modload.ImportPathsQuiet.func2(0x9b92e0, 0xc000392000, 0x0)
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/internal/modload/load.go:139 +0x62
            cmd/go/internal/modload.(*loader).load(0xc000142420, 0xc0002951c0)
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/internal/modload/load.go:686 +0x12aa
            cmd/go/internal/modload.ImportPathsQuiet(0xc0000221a0, 0x1, 0x1, 0xc00026e270, 0xd0, 0xc000284340, 0x2)
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/internal/modload/load.go:137 +0x265
            cmd/go/internal/modload.ImportPaths(0xc0000221a0, 0x1, 0x1, 0x203000, 0x203000, 0x203000)
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/internal/modload/load.go:53 +0x5d
            cmd/go/internal/load.ImportPaths(0xc0000221a0, 0x1, 0x1, 0xc00026b350, 0x40f2d0, 0xc000284410)
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/internal/load/pkg.go:2225 +0x5f
            cmd/go/internal/load.PackagesAndErrors(0xc0000221a0, 0x1, 0x1, 0x0, 0x0, 0x0)
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/internal/load/pkg.go:2153 +0xf8
            cmd/go/internal/load.Packages(0xc0000221a0, 0x1, 0x1, 0xc00025e1c0, 0x0, 0x0)
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/internal/load/pkg.go:2125 +0x5a
            cmd/go/internal/list.runList(0xdc98a0, 0xc0000221a0, 0x1, 0x1)
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/internal/list/list.go:453 +0x24f7
            main.main()
            	/home/werner/Public/lang/golang/go.git/src/cmd/go/main.go:190 +0x58d
            go: cannot find main module, but found .git/config in /
            	to create a module there, run:
            	cd ../../../../../.. && go mod init
            [exit status 1]
            > stderr 'cannot find main module'
            > ! stderr 'Gopkg.lock'
            > ! stderr 'go mod init'
            FAIL: testdata/script/mod_convert_dep.txt:23: unexpected match for `(?m)go mod init` found in stderr: go mod init
            
FAIL
FAIL	cmd/go	16.505s
ok  	cmd/go/internal/auth	0.218s
ok  	cmd/go/internal/cache	0.472s
ok  	cmd/go/internal/generate	0.034s
ok  	cmd/go/internal/get	0.017s
ok  	cmd/go/internal/imports	0.543s
ok  	cmd/go/internal/load	0.249s
ok  	cmd/go/internal/lockedfile	0.608s
ok  	cmd/go/internal/lockedfile/internal/filelock	0.489s
ok  	cmd/go/internal/modconv	0.039s
ok  	cmd/go/internal/modfetch	0.054s
ok  	cmd/go/internal/modfetch/codehost	0.020s
ok  	cmd/go/internal/modfetch/zip_sum_test	0.029s
ok  	cmd/go/internal/modload	0.022s
ok  	cmd/go/internal/mvs	0.564s
ok  	cmd/go/internal/par	0.559s
ok  	cmd/go/internal/renameio	0.650s
ok  	cmd/go/internal/search	0.281s
ok  	cmd/go/internal/test	0.018s
ok  	cmd/go/internal/txtar	0.508s
ok  	cmd/go/internal/web	0.021s
ok  	cmd/go/internal/work	0.055s
ok  	cmd/gofmt	0.547s
ok  	cmd/internal/buildid	0.705s
ok  	cmd/internal/dwarf	0.463s
ok  	cmd/internal/edit	0.513s
ok  	cmd/internal/goobj	1.649s
ok  	cmd/internal/goobj2	0.464s
ok  	cmd/internal/moddeps	2.507s
ok  	cmd/internal/obj	0.452s
ok  	cmd/internal/obj/arm64	0.395s
ok  	cmd/internal/obj/ppc64	0.284s
ok  	cmd/internal/obj/riscv	0.450s
ok  	cmd/internal/obj/x86	0.478s
ok  	cmd/internal/objabi	0.250s
ok  	cmd/internal/src	0.250s
ok  	cmd/internal/test2json	0.361s
ok  	cmd/link	15.274s
ok  	cmd/link/internal/benchmark	0.260s
ok  	cmd/link/internal/ld	3.981s
ok  	cmd/link/internal/loader	0.159s
ok  	cmd/link/internal/sym	0.260s
ok  	cmd/nm	2.606s
ok  	cmd/objdump	2.492s
ok  	cmd/oldlink/internal/sym	0.248s
ok  	cmd/pack	1.927s
ok  	cmd/trace	0.078s
ok  	cmd/vet	4.452s
FAIL
go tool dist: Failed: exit status 1

Any hints for this problem?

Regards.

@bcmills
Copy link
Contributor

bcmills commented Jun 6, 2020

The test is bogus. Coincidentally, I mailed out CL 236818 just an hour ago to remove it, having run into the same failure mode separately while testing #39385.

@bcmills bcmills changed the title Failed to pass the testing step when compiling the go git master version bootstrapped via the go compiler installed from distribution's repo on Ubuntu 20.04. cmd/go: TestScript/mod_convert_dep assumes that no parent of $WORK contains version-control metadata Jun 6, 2020
@bcmills bcmills self-assigned this Jun 6, 2020
@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure. labels Jun 6, 2020
@bcmills bcmills added this to the Go1.15 milestone Jun 6, 2020
@gopherbot
Copy link

Change https://golang.org/cl/236818 mentions this issue: cmd/go: remove a bogus assertion in mod_convert_dep

@golang golang locked and limited conversation to collaborators Jun 8, 2021
@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. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants