-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: TestCgoPkgConfig failed #17846
Comments
@sillyousu What Linux distribution are you running? Can you please try:
and reply with the output from the pkg-config command? This test failure indicates that somehow we lost the backslash after the "hello". |
|
Okay, so this confirms that your pkg-config did not properly handle the whitespace. CentOS 6.5 appears to include pkg-config 0.23, which dates from 6 years ago. Looking at the source code, it simply has no handling for escape sequences at all. I'm a bit confused though, because it does say in a comment
which does seem like it applies here. Ironically support for whitespace in paths was added later in 2010: https://cgit.freedesktop.org/pkg-config/commit/?id=69a7eaa6 @rsc I'm not sure what to do here. Should the test run pkg-config --version and try to parse the output? Or just ignore the test failure on very old distros? @sillyousu This test failure is harmless and your Go is otherwise fine; feel free to ignore it and use the resulting go. You simply won't be able to link pkg-config libraries that are in paths containing whitespace (unlikely on CentOS). |
@quentinmit Does the test work if you quote "-DDEFINED_FROM_PKG_CONFIG=hello world" on the Cflags line in the pc file? If that is more reliable with older versions of pkg-config, then that seems fine. We're checking our handling of pkg-config's output, not pkg-config's input parser. |
Neither double quotes nor backslashes work in pkg-config 0.23. AFAICT there is simply no way to get whitespace into an argument in pkg-config 0.23. Double quotes also don't work in OpenBSD's pkg-config, which is why I put backslashes into the test. |
How about running something like pkg-config --version and t.Skip for older versions? |
That's what I suggested above. Yeah, we can do that. I'm not sure what the best way to compare the version number is - parse with a regex? @sillyousu Can you confirm what |
CL https://golang.org/cl/33027 mentions this issue. |
centos65x64TopHighoocwbezz➜ ~ pkg-config --version |
The lack of pkg-config functionality doesn't bother me. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
./all.bash
version: 8a2a999
What did you expect to see?
no failure
What did you see instead?
The text was updated successfully, but these errors were encountered: