go: runtime: several tests are failing on windows-arm64-aws builder due to redeclaration warnings (upgraded to errors in testing)

--- FAIL: TestCgoDLLImports (19.82s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders

[...]

FAIL
FAIL	runtime	66.604s
More Failing Tests in runtime

Here are the other failing test in runtime, all with the same problem:

--- FAIL: TestCgoPanicDeadlock (17.25s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoTracebackContext (17.25s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoCCodeSIGPROF (17.24s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoCheckBytes (0.00s)
    crash_cgo_test.go:188: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestBigStackCallbackCgo (0.00s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoExternalThreadPanic (0.00s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoTraceback (0.00s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoCrashHandler (0.00s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders

Source: https://storage.googleapis.com/go-build-log/986587f4/windows-arm64-aws_fcda3dac.log from CL 323990.

There’s also a test in cmd/link that builds testprogcgo with the same problem:

--- FAIL: TestDWARF (0.00s)
    --- FAIL: TestDWARF/testprogcgo (33.77s)
        dwarf_test.go:94: go build -o C:\Users\gopher\AppData\Local\Temp\TestDWARF_testprogcgo649726619\001\testprogcgo.exe ../../runtime/testdata/testprogcgo: exit status 1
            # runtime/testdata/testprogcgo
            In file included from _cgo_export.c:4:
            cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
            aprof.go:13:14: note: previous declaration is here
            cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
            bigstack_windows.go:9:13: note: previous declaration is here
            go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
FAIL
FAIL	cmd/link	35.289s

Source: https://storage.googleapis.com/go-build-log/0f330f99/windows-arm64-aws_80fa3b05.log from CL 323993.

This is possibly connected to the builder using a newer version of the C toolchain, as discussed in #46406.

Note these are warnings if run locally, but the build system upgrade warnings during test execution into to failures.

CC @rsc, @golang/release, @zx2c4.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (10 by maintainers)

Commits related to this issue

Most upvoted comments

That said that CL is in the 1.15 and 1.16 releases and I don’t recall seeing any complaints.

Maybe only Windows/ARM64 uses clang-based C toolchain which warns that, whereas previously Windows/AMD64 and 386 use GCC which doesn’t warn that?

I’ve got a fix for that in https://go-review.googlesource.com/c/go/+/326310/

But I’m now battling the next clang-related issue, where apparently it wants a microsoft-style import library, rather than a straight up .dll pretending to be a .a like gcc takes.