-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/vet: tests require Perl for errchk and fail with latest Perl #20007
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
Comments
Update: I read the perldelta wrong: unescaped left-brace is only deprecated in 5.24. It will become fatal in 5.26 (which is expected out soon, within a few months). So, currently, this bug will only show up for folks running Perls from the 5.25.x development releases. |
The actual use of perl is in the script test/errchk. |
@ianlancetaylor, we have a Go version of errchk already in test/run.go. (hence my longer title about one view of the bug being that we depend on Perl) |
That said, it might be just changing: $regexp = "$`$file:$n$'"; to: $regexp = "\\Q$`\\E$file:$n$'"; (or |
Sorry, our subject line editing collided. I never saw yours. |
Quite frankly, this entire test suite is confused whether the error lines it's dealing with are plain strings or regexes. This particular error is caused by this line. This is clearly meant to be matched stringwise, as are many other strings (that work fine most of the time because the meta-character Do you really need these to be regexes? If not I would recommend just quotemeta()ing it early (this may involve unquoting a few cases that are currently hand-quoted, for example because they contain a If you do need it, I would recommend consistently quoting all error strings. One possible intermediate solution is to add a new syntax that will explicitly enable the regular expression syntax. Something like:
All of this you really want to fix regardless of what perl is doing. |
In general the ERROR lines that appear in the files in the test directory are always intended to be regular expressions. I am less familiar with the use in vet, but if vet wants to match the way that the test directory works then the ERROR lines there should also always be regexps. Thanks for identifying the line; probably the right solution is to backslash-quote the |
The primary problem here isn't the |
My attempts to install a dev version of perl failed. Can someone confirm that CL 40950 fixes the immediate problem? Thanks. |
Here's a Debian jessie environment with Perl 5.25. You can build it and docker run it with some
|
FYI Latest go18 (go1.8.4-0-gf5bcb9b8fe) fails to bootstrap on Debian 9 because of this bug:
Go18 should be still supported according to release poilcy, thus it is better to backport 2e45310 there. Latest Go14 bootstraps ok. |
@rsc you probably overlooked this while backporting patches to go1.8.5 |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8.1 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
Grabbed the source tarball. Grabbed go-1.4 binary tarball and expanded under
$HOME
. Built 1.8.1 source per instructions (cd src; ./all.bash
). Got test suite failure due to a change in regex syntax that became a fatal error in 5.24. (I'm running perl-5.25.11, currently; once I submit this I will replicate with 5.24, 5.22, and (hopefully!) not replicate with 5.20.)What did you expect to see?
Fully passing test suite.
What did you see instead?
The text was updated successfully, but these errors were encountered: