-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
path/filepath: TestBug3486 fails if GOROOT/test is removed #29713
Comments
How did you install your copy of the The test is looking for the go/src/path/filepath/path_test.go Line 1293 in 56c9f8e
The test passes when run with the
And the directory is clearly present in the official distribution tarball, at least for
So as far as I can tell, the most likely explanation is some sort of packaging issue. Perhaps your distro maintainer pruned files out of |
I'm using the official go package for Arch Linux. It does seem to omit the test dir. I can file a bug with the distro, but is the test dir required as part of a Go install? I have had no issues with it missing (other than this test failure). It also seems wrong that a stdlib test requires the toolchain/runtime test dir to exist. And furthermore end users almost certainly would have no need for toolchain/runtime tests for a Go install? |
There is currently nothing in the documentation that says it can be removed, so I'd say that yes, it is required. I would argue that anything that is safe to prune out for individual distros should also be pruned out of the standard release tarball (see #27151), and conversely, anything that is not pruned out of the standard release should not be pruned out in individual distros either. If you think we should prune out the |
Marking as NeedsDecision: we need to determine whether ordinary tests in the standard library should depend on the existence of |
I think it's perfectly fine for standard library tests to require the existence of In general, if you don't have a complete distribution, you shouldn't expect the tests to pass. This is not to say that Arch Linux is doing the wrong thing by omitting the |
I believe this is the only stdlib test that requires Edit: Looking at go/src/path/filepath/path_test.go Line 1286 in 447965d
I think it could be easily rewritten to not rely on |
It is excessive and I don't mind changing it for the 1.13 release. But the general principle still holds: if the distro doesn't include the complete Go release, then you should not expect the standard library tests to pass. That just isn't an invariant we have any reason to maintain, nor are we going to test that it works. |
I understand and that's fine. However if you'll entertain a little philosophical discussion, I don't see when it should ever be the case that stdlib tests rely on any files outside of the
Assuming there are no such reasons to violate this invariant (which of course could be a mistaken assumption on my part), one potential reason to maintain this invariant is that if the "lite" Go distribution idea in #27151 gains traction, a "lite" Go distribution that omits the I have already filed a downstream bug, so I'm not pushing this idea with the intent of changing Go policy for the sake of fixing an Arch Linux bug. I'd just like to clarify my own thoughts about this. |
This kind of thing is only maintainable if it is tested. So if we decide that we care about a "lite" Go distribution, then our first step would be to arrange for our automated testers to remove the appropriate directories and then run all the tests. Unless and until we take that step, this simply isn't worth worrying about. |
I took a little bit of time to see if I could fix this, and ironically, the reason this test is using the This test was originally written for #3486 and only check So I will postpone fixing this bug until #28387 is resolved. |
Looks like there's now another std lib test that depends on GOROOT/test existing. Failure if it's deleted:
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, 1.11.4 is the latest (not counting betas?).
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
All tests pass
What did you see instead?
Test failures:
(I found a bug for the same test, but the failure mode is different: #5863)
The text was updated successfully, but these errors were encountered: