Skip to content

x/website: Invalid compiler requirements for race detector on Windows #61916

@antoninbas

Description

@antoninbas

The current documentation reads:

On Windows, the race detector runtime is sensitive to the version of the C compiler installed; as of Go 1.21, building a program with -race requires a C compiler that incorporates version 8 or later of the mingw-w64 runtime libraries. You can test your C compiler by invoking it with the arguments --print-file-name libsynchronization.a. A newer compliant C compiler will print a full path for this library, whereas older C compilers will just echo the argument.

According to the documentation, version 8 of the mingw-w64 runtime libraries should work, as it is the minimum required version ("version 8 or later"). However, it doesn't seem to work.

I have tested using Github Actions runners for Windows. Github actions supports 2 runners: windows-2019 (which comes with Mingw-w64 8.1.0), and windows-2022 (which comes with Mingw-w64 11.2.0). I can run the race detector successfully with the latter (windows-2022), but not with the former (windows-2019). When using ``windows-2019andMingw-w64 8.1.0`, the observed error is the same as for #61058: `exit status 0xc0000139`.

windows-2019 runner:

> gcc --print-file-name libsynchronization.a
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libsynchronization.a

windows-2022 runner:

Run gcc --print-file-name libsynchronization.a
c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libsynchronization.a

I don't know what the exact requirement is, but 8.1.0 does not work (unless some other dependency is at fault).

Installed software on Github Actions Windows runners:

Note that I am using Go v1.21, and that I didn't have the same issue with Go v1.19.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Windowswebsite

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions