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: C compiler version parsing fails for versions like gcc 8.3 [DragonFly] #64619

Closed
bcmills opened this issue Dec 8, 2023 · 1 comment
Closed
Assignees
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Dec 8, 2023

Go version

c71eedf

What operating system and processor architecture are you using (go env)?

dragonfly-amd64-622 at c71eedf90aff3fc73a645b88d2e5166b8a0179fd

:: Running /tmp/workdir/go/src/make.bash with args ["/tmp/workdir/go/src/make.bash" "-force"] and env ["PATH=/bin:/sbin:/usr/bin:/usr/local/bin" "HOME=/" "RC_PID=2" "WORKDIR=/tmp/workdir" "GOROOT_BOOTSTRAP=/tmp/workdir/go1.4" "GO_BUILDER_NAME=dragonfly-amd64-622" "GOBIN=" "TMPDIR=/tmp/workdir/tmp" "GOCACHE=/tmp/workdir/gocache" "GOPLSCACHE=/tmp/workdir/goplscache" "PWD=/tmp/workdir/go/src"] in dir /tmp/workdir/go/src

What did you do?

https://build.golang.org/log/3c7d2464881aa6cd4c5bec97b0fd3d3fc1addfa6

What did you expect to see?

All tests passing.

What did you see instead?

--- FAIL: TestScript (0.06s)
    --- FAIL: TestScript/cgo_stale_precompiled (0.92s)
        script_test.go:132: 2023-12-07T19:32:46Z
        script_test.go:134: $WORK=/tmp/workdir/tmp/cmd-go-test-6569609340248629423/tmpdir16117836249475985879/cgo_stale_precompiled1804669140117065298
        script_test.go:156: 
            # Regression test for https://go.dev/issue/47215 and https://go.dev/issue/50183:
            # A mismatched $GOROOT_FINAL or missing $CC caused the C dependencies of the net
            # package to appear stale, and it could not be rebuilt due to a missing $CC. (0.000s)
            # This test may start with the runtime/cgo package already stale.
            # Explicitly rebuild it to ensure that it is cached.
            # (See https://go.dev/issue/50892.)
            #
            # If running in non-short mode, explicitly vary CGO_CFLAGS
            # as a control case (to ensure that our regexps do catch rebuilds). (0.403s)
            # https://go.dev/issue/50183: a mismatched GOROOT_FINAL caused net to be stale. (0.193s)
            # https://go.dev/issue/47215: a missing $(go env CC) caused the precompiled net
            # to be stale. But as of https://go.dev/cl/452457 the precompiled libraries are
            # no longer installed anyway! Since we're requiring a C compiler in order to
            # build and use cgo libraries in the standard library, we should make sure it
            # matches what's in the cache. (0.311s)
            > [abscc] stop
            [condition not met]
            > env CGO_ENABLED=1
            > env CC=''
            > [!GOOS:plan9] env PATH=''  # Guaranteed not to include $(go env CC)!
            > [GOOS:plan9] env path=''
            [condition not met]
            > ! go build -x runtime/cgo
            [stderr]
            WORK=/tmp/workdir/tmp/cmd-go-test-6569609340248629423/tmpdir16117836249475985879/cgo_stale_precompiled1804669140117065298/tmp/go-build11950041837148003209
        script_test.go:156: FAIL: testdata/script/cgo_stale_precompiled.txt:39: go build -x runtime/cgo: unexpected success
FAIL
FAIL	cmd/go	52.660s
@bcmills bcmills added OS-Dragonfly NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels Dec 8, 2023
@bcmills bcmills added this to the Go1.22 milestone Dec 8, 2023
@bcmills bcmills self-assigned this Dec 8, 2023
@bcmills bcmills changed the title cmd/go: TestScript/cgo_stale_precompiled failing on dragonfly-amd64-622 as of CL 547998 cmd/go: C compiler version parsing fails for versions like gcc 8.3 [DragonFly] Dec 8, 2023
@gopherbot
Copy link

Change https://go.dev/cl/548120 mentions this issue: cmd/go: relax version regexp from CL 547998

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. FixPending Issues that have a fix which has not yet been reviewed or submitted. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Dec 8, 2023
ezz-no pushed a commit to ezz-no/go-ezzno that referenced this issue Feb 18, 2024
In CL 547998 I relaxed cmd/go's parsing of version lines to allow it
to recognize clang versions with vendor prefixes. To prevent false-positives,
I added a check for a version 3-tuple following the word "version".
However, it appears that some releases of GCC use only a 2-tuple instead.

Updates golang#64423.
Fixes golang#64619.

Change-Id: I5f1d0881b6295544a46ab958c6ad4c2155cf51fe
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/548120
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
Development

No branches or pull requests

3 participants