-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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/internal/moddeps: TestAllDependencies fails when GOROOT involves symlinks #46269
Comments
Thanks for reporting. That seems unexpected. This did not happen when I ran the test locally (darwin/amd64) nor on builders. Is there any information you can add about how you checked out the GOROOT directory to help reproduce this? |
The output of |
Are you able to try with commit dade83a, and its parent, and see if it reproduces with those? |
Can you describe your symlink setup in more detail? That would be very helpful in reproducing this and understanding the issue. I expect either the test can be improved to handle this situation, if that's feasible, or otherwise detect it and skip running. |
I have a symlink called /usr/local/go that points to the directory /usr/local/go-tip which is a normal git checkout of the go repository. The env variable PATH contains /usr/local/go/bin. The output of |
Thanks, that's very helpful. I'm able to reproduce the error with that symlink setup, both with I'll work on a fix. I also want to confirm whether this type of symlink setup is something we support, or if it shouldn't be supported. If it should be supported, we should consider adding a builder (or test, if viable) to provide coverage to help catch similar regressions. CC @bcmills. |
I understand this test never worked in the past, it just passed because it found no modules. This is because I'm currently leaning towards fixing this by detecting when |
It should be ok for |
Based on previous experience, I suspect that the problem is here: go/src/cmd/internal/moddeps/moddeps_test.go Lines 438 to 439 in 6c1c055
When we set |
(We may need to make the same change in the other places where we set the |
golang.org/x/tools/internal/gocommand handles this stuff; I wonder if it would be worth cutting down its dependencies and using it in the stdlib tests. |
No, the original report is against a commit that happened after dade83a |
PS. I actually took a look at fixing this a few days ago. It turns out that there are many places in that set of tests that assumes runtime.GOROOT() is not a symlink. |
Change https://golang.org/cl/347351 mentions this issue: |
Dup #64375? |
This does seem to be the same problem, thanks. Closing. |
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
PASS
What did you see instead?
It seems that this was introduced by https://go-review.googlesource.com/c/go/+/320991 6c1c055
cc @dmitshur
The text was updated successfully, but these errors were encountered: