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

cmd/go: test failure in TestScript/list_pkgconfig_error from commit 906338f82fc6641e834964def3199ac25df93e94 onward #69651

Closed
siebenmann opened this issue Sep 27, 2024 · 4 comments

Comments

@siebenmann
Copy link

Go version

go version devel go1.24-6a730e1ef0 Fri Sep 27 00:32:20 2024 +0000 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/homes/hawklords/cks/.cache/go-build'
GOENV='/homes/hawklords/cks/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/homes/hawklords/cks/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/homes/hawklords/cks/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/data/code/go-lang/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='path'
GOTOOLDIR='/data/code/go-lang/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='devel go1.24-6a730e1ef0 Fri Sep 27 00:32:20 2024 +0000'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/homes/hawklords/cks/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmpfs/go-build3211830549=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Building the current development tree (with 'cd src; ./all.bash') on Ubuntu 22.04 and Fedora 40 fails from commit 906338f (which is the fix for #68283 ) onward with:

ok      cmd/fix 1.945s
vcs-test.golang.org rerouted to http://127.0.0.1:33547
https://vcs-test.golang.org rerouted to https://127.0.0.1:44403
go test proxy running at GOPROXY=http://127.0.0.1:40037/mod
--- FAIL: TestScript (0.20s)
    --- FAIL: TestScript/list_pkgconfig_error (1.51s)
        script_test.go:139: 2024-09-27T02:09:06Z
        script_test.go:141: $WORK=/tmpfs/cks-gobuild/cmd-go-test-2494934397/tmpdir1310559430/list_pkgconfig_error2829839146
        script_test.go:163: 
            > [!cgo] skip 'test verifies cgo pkg-config errors'
            [condition not met]
            > [!exec:pkg-config] skip 'test requires pkg-config tool'
            [condition not met]
            > ! go list -export .
            [stdout]
            example
            [stderr]
            # example
            # [pkg-config --cflags  -- libnot-a-valid-cgo-library]
            Package libnot-a-valid-cgo-library was not found in the pkg-config search path.
            Perhaps you should add the directory containing `libnot-a-valid-cgo-library.pc'
            to the PKG_CONFIG_PATH environment variable
            Package 'libnot-a-valid-cgo-library', required by 'virtual:world', not found
            [exit status 1]
            # 'Package .* not found appears' in pkg-config and pkgconf; while
            # 'could not find package .*' appears in u-config. See #68283. (0.000s)
            > stderr '#^ example\n#pkg-config .*\n(.*\n)*(Package .* not found)|(could not find package .*)'
        script_test.go:163: FAIL: testdata/script/list_pkgconfig_error.txt:7: stderr '#^ example\n#pkg-config .*\n(.*\n)*(Package .* not found)|(could not find package .*)': no match for `(?m)#^ example\n#pkg-config .*\n(.*\n)*(Package .* not found)|(could not find package .*)` in stderr
FAIL
FAIL    cmd/go  40.379s

It appears that the revised regular expression in that commit doesn't expect or allow the output "# [pkg-config ..." and instead requires that line to start with "#pkg-config" (no space, no '[').

What did you see happen?

I expected the tree to pass all.bash tests.

What did you expect to see?

The failure above.

@qiulaidongfeng
Copy link
Member

Thanks for you report.
I will send fix.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/616099 mentions this issue: cmd/go: fix TestScript/list_pkgconfig_error fail

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/616336 mentions this issue: Revert "cmd/go: relax the regular expression of TestScript/list_pkgconfig_error"

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

No branches or pull requests

4 participants