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

gotooltest: move default GOPATH out of the main module #156

Merged
merged 1 commit into from Apr 22, 2022

Conversation

mvdan
Copy link
Collaborator

@mvdan mvdan commented Apr 22, 2022

(see commit message)

@mvdan mvdan requested review from myitcv and rogpeppe April 22, 2022 13:41
@mvdan
Copy link
Collaborator Author

mvdan commented Apr 22, 2022

FYI @rogpeppe this is one of the bugs we ran into this morning.

Otherwise, commands like `go mod tidy` will try to walk into the default
GOPATH directory. At best, that's a waste of resources, since
directories like GOMODPATH may contain lots of files. At worst, it
results in errors, as directories in GOMODPATH are not valid import paths:

	--- FAIL: TestScripts/list (0.01s)
		testscript.go:413:
			[...]
			> go mod tidy
			[stderr]
			mod/gopath/pkg/mod/fruit.com@v1.1.0/fruit: import path "mod/gopath/pkg/mod/fruit.com@v1.1.0/fruit" should not have @Version

We add the test in goproxytest, as goproxytest already uses gotooltest,
and we need an external module to reproduce the error.
Copy link
Owner

@rogpeppe rogpeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mvdan mvdan merged commit 009359f into rogpeppe:master Apr 22, 2022
@mvdan mvdan deleted the gopath-go1.18 branch June 21, 2022 11:57
cueckoo pushed a commit to cue-lang/cue-trybot that referenced this pull request Aug 23, 2022
See rogpeppe/go-internal#156;
the leading dot was added to "hide" the directory so that it is not
walked by commands such as `go list ./...`.

This broke our test, as we hard-coded the previous location via
`$WORK/gopath` to get to the default `GOBIN` location.
We can fix the tests and make them future-proof via `$GOPATH` instead.

The trybots didn't catch this on Gerrit as these are long tests.
I had forgotten that the long tests are opt-in,
and so the recent CL that bumped go-internal to v1.9.0 broke master.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I0203595f0352c6205deb22bff3a9a7ca2d06da07
cueckoo pushed a commit to cue-lang/cue that referenced this pull request Aug 24, 2022
See rogpeppe/go-internal#156;
the leading dot was added to "hide" the directory so that it is not
walked by commands such as `go list ./...`.

This broke our test, as we hard-coded the previous location via
`$WORK/gopath` to get to the default `GOBIN` location.
We can fix the tests and make them future-proof via `$GOPATH` instead.

The trybots didn't catch this on Gerrit as these are long tests.
I had forgotten that the long tests are opt-in,
and so the recent CL that bumped go-internal to v1.9.0 broke master.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I0203595f0352c6205deb22bff3a9a7ca2d06da07
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/542618
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants