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

make test on Windows 10 under MSYS fails to compile the code #1108

Closed
krader1961 opened this issue Aug 15, 2020 · 3 comments
Closed

make test on Windows 10 under MSYS fails to compile the code #1108

krader1961 opened this issue Aug 15, 2020 · 3 comments

Comments

@krader1961
Copy link
Contributor

Running make test on Windows 10 results in this failure:

gcc_libinit_windows.c: In function ‘x_cgo_sys_thread_create’:
gcc_libinit_windows.c:57:12: error: implicit declaration of function ‘_beginthread’ [-Werr
or=implicit-function-declaration]
   57 |  thandle = _beginthread(func, 0, arg);
      |            ^~~~~~~~~~~~
cc1: all warnings being treated as errors

That is apparently due to go test -race ./... requiring the tdm-gcc rather than the gcc compiler provided by MSYS. As a consequence every unit test fails. Running go test ./... succeeds.

This leads me to several questions. For example, this seems to work on AppVeyor CI. However, I can't tell if that's because it runs go test ./... or tdm-gcc is being installed and used so as to allow make test to work. I can't tell which is true because I can't figure out how the Elvish CI environment on AppVeyor is configured. Nor is there any documentation on how to configure Windows to support building and testing Elvish on that platform.

@krader1961
Copy link
Contributor Author

Also, it's not clear if tdm-gcc is a prerequisite for building the Windows elvish binary that is available at https://elv.sh/get/. In other words, which toolchains are supported? While MSYS appears to be required, as a practical matter, to use Elvish on Windows it appears only the standard Go toolchain is needed to build it -- albeit with tdm-gcc as a prereq in order to execute go test -race ./....

@xiaq
Copy link
Member

xiaq commented Aug 18, 2020

Hmm, AppVeyor uses a plain go test - the config file is .appveyor.yml. And that's exactly because I had problems with go test -race on Windows.

golang/go#27089 mentions that go test -race on Windows requires (some) GCC, and presumably some GCC builds are compatible with Go while others are not (I didn't find any specific reference to tdm-gcc there).

I'll just remove windows from the make test rule as we can't reliably determine whether the Windows environment has a suitable GCC binary.

@xiaq
Copy link
Member

xiaq commented Aug 18, 2020

Also, this isn't really an Elvish-specific problem, but a Go toolchain issue.

@xiaq xiaq closed this as completed in ce19bca Aug 18, 2020
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

2 participants