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

libuv build fails with mingw-w64-x86_64-headers-git-9.0.0.6327.f29c1101f-1-any #9946

Closed
erw7 opened this issue Oct 31, 2021 · 8 comments · Fixed by #9949
Closed

libuv build fails with mingw-w64-x86_64-headers-git-9.0.0.6327.f29c1101f-1-any #9946

erw7 opened this issue Oct 31, 2021 · 8 comments · Fixed by #9949

Comments

@erw7
Copy link
Contributor

erw7 commented Oct 31, 2021

I don't know if this is the right place to report this, but I get the following libuv build failures. The reason for this is that mstcpip.h is included in ws2tcpip.h. In the WS2tcpip.h of SDK (10.0.19041.0), mstcpip.h is not inlcude.

Build Log
2021-10-31T14:49:31.9963664Z -- Build files have been written to: D:/a/neovim/neovim/nvim-deps/build/src/libuv
2021-10-31T14:49:35.2859479Z [57/137] cmd.exe /C "cd /D D:\a\neovim\neovim\nvim-deps\build\src\libuv && C:\msys64\mingw64\bin\cmake.exe --build . --config RelWithDebInfo && C:\msys64\mingw64\bin\cmake.exe -E touch D:/a/neovim/neovim/nvim-deps/build/src/libuv-stamp/libuv-build"
2021-10-31T14:49:35.2861625Z FAILED: build/src/libuv-stamp/libuv-build D:/a/neovim/neovim/nvim-deps/build/src/libuv-stamp/libuv-build 
2021-10-31T14:49:35.2898047Z cmd.exe /C "cd /D D:\a\neovim\neovim\nvim-deps\build\src\libuv && C:\msys64\mingw64\bin\cmake.exe --build . --config RelWithDebInfo && C:\msys64\mingw64\bin\cmake.exe -E touch D:/a/neovim/neovim/nvim-deps/build/src/libuv-stamp/libuv-build"
2021-10-31T14:49:35.2900149Z [1/36] Building C object CMakeFiles/uv.dir/src/idna.c.obj
2021-10-31T14:49:35.2901108Z [2/36] Building C object CMakeFiles/uv.dir/src/strscpy.c.obj
2021-10-31T14:49:35.2902102Z [3/36] Building C object CMakeFiles/uv.dir/src/fs-poll.c.obj
2021-10-31T14:49:35.2902941Z FAILED: CMakeFiles/uv.dir/src/fs-poll.c.obj 
2021-10-31T14:49:35.2905032Z C:\msys64\mingw64\bin\cc.exe -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600 -ID:/a/neovim/neovim/nvim-deps/build/src/libuv/./include -ID:/a/neovim/neovim/nvim-deps/build/src/libuv/./src -O2 -g -DNDEBUG -MD -MT CMakeFiles/uv.dir/src/fs-poll.c.obj -MF CMakeFiles\uv.dir\src\fs-poll.c.obj.d -o CMakeFiles/uv.dir/src/fs-poll.c.obj -c D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/fs-poll.c
2021-10-31T14:49:35.2907144Z In file included from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/internal.h:29,
2021-10-31T14:49:35.2908142Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/fs-poll.c:26:
2021-10-31T14:49:35.2909329Z D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/winapi.h:4730:16: error: redefinition of 'struct _TCP_INITIAL_RTO_PARAMETERS'
2021-10-31T14:49:35.2910464Z  4730 | typedef struct _TCP_INITIAL_RTO_PARAMETERS {
2021-10-31T14:49:35.2911116Z       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2911981Z In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h:265,
2021-10-31T14:49:35.2912968Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv/win.h:48,
2021-10-31T14:49:35.2913878Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv.h:64,
2021-10-31T14:49:35.2914806Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/fs-poll.c:22:
2021-10-31T14:49:35.2915788Z C:/msys64/mingw64/x86_64-w64-mingw32/include/mstcpip.h:163:16: note: originally defined here
2021-10-31T14:49:35.2916745Z   163 | typedef struct _TCP_INITIAL_RTO_PARAMETERS {
2021-10-31T14:49:35.2917413Z       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2918190Z In file included from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/internal.h:29,
2021-10-31T14:49:35.2919205Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/fs-poll.c:26:
2021-10-31T14:49:35.2920512Z D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/winapi.h:4733:3: error: conflicting types for 'TCP_INITIAL_RTO_PARAMETERS'; have 'struct _TCP_INITIAL_RTO_PARAMETERS'
2021-10-31T14:49:35.2921821Z  4733 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
2021-10-31T14:49:35.2922558Z       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2923542Z In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h:265,
2021-10-31T14:49:35.2924542Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv/win.h:48,
2021-10-31T14:49:35.2925447Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv.h:64,
2021-10-31T14:49:35.2926390Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/fs-poll.c:22:
2021-10-31T14:49:35.2927682Z C:/msys64/mingw64/x86_64-w64-mingw32/include/mstcpip.h:166:3: note: previous declaration of 'TCP_INITIAL_RTO_PARAMETERS' with type 'TCP_INITIAL_RTO_PARAMETERS'
2021-10-31T14:49:35.2928900Z   166 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
2021-10-31T14:49:35.2929630Z       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2930445Z In file included from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/internal.h:29,
2021-10-31T14:49:35.2931629Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/fs-poll.c:26:
2021-10-31T14:49:35.2932996Z D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/winapi.h:4733:32: error: conflicting types for 'PTCP_INITIAL_RTO_PARAMETERS'; have 'struct _TCP_INITIAL_RTO_PARAMETERS *'
2021-10-31T14:49:35.2934297Z  4733 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
2021-10-31T14:49:35.2935009Z       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2935807Z In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h:265,
2021-10-31T14:49:35.2936788Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv/win.h:48,
2021-10-31T14:49:35.2937690Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv.h:64,
2021-10-31T14:49:35.2938625Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/fs-poll.c:22:
2021-10-31T14:49:35.2940119Z C:/msys64/mingw64/x86_64-w64-mingw32/include/mstcpip.h:166:32: note: previous declaration of 'PTCP_INITIAL_RTO_PARAMETERS' with type 'PTCP_INITIAL_RTO_PARAMETERS' {aka 'struct _TCP_INITIAL_RTO_PARAMETERS *'}
2021-10-31T14:49:35.2941553Z   166 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
2021-10-31T14:49:35.2942307Z       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2943053Z [4/36] Building C object CMakeFiles/uv.dir/src/random.c.obj
2021-10-31T14:49:35.2943872Z FAILED: CMakeFiles/uv.dir/src/random.c.obj 
2021-10-31T14:49:35.2946024Z C:\msys64\mingw64\bin\cc.exe -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600 -ID:/a/neovim/neovim/nvim-deps/build/src/libuv/./include -ID:/a/neovim/neovim/nvim-deps/build/src/libuv/./src -O2 -g -DNDEBUG -MD -MT CMakeFiles/uv.dir/src/random.c.obj -MF CMakeFiles\uv.dir\src\random.c.obj.d -o CMakeFiles/uv.dir/src/random.c.obj -c D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/random.c
2021-10-31T14:49:35.2947983Z In file included from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/internal.h:29,
2021-10-31T14:49:35.2948923Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/random.c:26:
2021-10-31T14:49:35.2950237Z D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/winapi.h:4730:16: error: redefinition of 'struct _TCP_INITIAL_RTO_PARAMETERS'
2021-10-31T14:49:35.2951386Z  4730 | typedef struct _TCP_INITIAL_RTO_PARAMETERS {
2021-10-31T14:49:35.2952076Z       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2952824Z In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h:265,
2021-10-31T14:49:35.2953809Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv/win.h:48,
2021-10-31T14:49:35.2954745Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv.h:64,
2021-10-31T14:49:35.2955640Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/random.c:22:
2021-10-31T14:49:35.2956677Z C:/msys64/mingw64/x86_64-w64-mingw32/include/mstcpip.h:163:16: note: originally defined here
2021-10-31T14:49:35.2957949Z   163 | typedef struct _TCP_INITIAL_RTO_PARAMETERS {
2021-10-31T14:49:35.2958633Z       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2959462Z In file included from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/internal.h:29,
2021-10-31T14:49:35.2960430Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/random.c:26:
2021-10-31T14:49:35.2961800Z D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/winapi.h:4733:3: error: conflicting types for 'TCP_INITIAL_RTO_PARAMETERS'; have 'struct _TCP_INITIAL_RTO_PARAMETERS'
2021-10-31T14:49:35.2963240Z  4733 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
2021-10-31T14:49:35.2963971Z       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2964776Z In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h:265,
2021-10-31T14:49:35.2965758Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv/win.h:48,
2021-10-31T14:49:35.2966805Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv.h:64,
2021-10-31T14:49:35.2967710Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/random.c:22:
2021-10-31T14:49:35.2968971Z C:/msys64/mingw64/x86_64-w64-mingw32/include/mstcpip.h:166:3: note: previous declaration of 'TCP_INITIAL_RTO_PARAMETERS' with type 'TCP_INITIAL_RTO_PARAMETERS'
2021-10-31T14:49:35.2970226Z   166 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
2021-10-31T14:49:35.2970906Z       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2971768Z In file included from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/internal.h:29,
2021-10-31T14:49:35.2972762Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/random.c:26:
2021-10-31T14:49:35.2974014Z D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/win/winapi.h:4733:32: error: conflicting types for 'PTCP_INITIAL_RTO_PARAMETERS'; have 'struct _TCP_INITIAL_RTO_PARAMETERS *'
2021-10-31T14:49:35.2975303Z  4733 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
2021-10-31T14:49:35.2976056Z       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2976805Z In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h:265,
2021-10-31T14:49:35.2977777Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv/win.h:48,
2021-10-31T14:49:35.2978705Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/include/uv.h:64,
2021-10-31T14:49:35.2979587Z                  from D:/a/neovim/neovim/nvim-deps/build/src/libuv/src/random.c:22:
2021-10-31T14:49:35.2981020Z C:/msys64/mingw64/x86_64-w64-mingw32/include/mstcpip.h:166:32: note: previous declaration of 'PTCP_INITIAL_RTO_PARAMETERS' with type 'PTCP_INITIAL_RTO_PARAMETERS' {aka 'struct _TCP_INITIAL_RTO_PARAMETERS *'}
2021-10-31T14:49:35.2982645Z   166 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
2021-10-31T14:49:35.2983359Z       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-31T14:49:35.2984095Z [5/36] Building C object CMakeFiles/uv.dir/src/inet.c.obj
2021-10-31T14:49:35.2984908Z ninja: build stopped: subcommand failed.
@lazka
Copy link
Member

lazka commented Oct 31, 2021

@lhmouse any ideas?

@Biswa96
Copy link
Member

Biswa96 commented Oct 31, 2021

The issue is in neovim/deps repository. It already defines TCP_INITIAL_RTO_PARAMETERS structure which is defined in mstcpip.h in mingw-w64 headers (and WinSDK also). Here https://github.com/neovim/deps/blob/master/src/libuv/src/win/winapi.h

@erw7
Copy link
Contributor Author

erw7 commented Oct 31, 2021

libuv includes ws2tcpip.h, but does not include mstcpip.h. Therefore, no conflicts have occurred until now. The new header has been changed to include mstcpip.h in ws2tcpip.h (https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-headers/include/ws2tcpip.h#l265). That is the cause of this problem. As I wrote in #9946 (comment) WS2tcpip.h in SDK does not include mstcpip.h. So, isn't this a problem with the MinGW header?

@Biswa96
Copy link
Member

Biswa96 commented Oct 31, 2021

That's also an issue. A project should not define types which already in system provided header. But also mingw-w64 may not have that TCP_INITIAL_RTO_PARAMETERS type previously. So, which one should be fixed first? 😕

@Biswa96
Copy link
Member

Biswa96 commented Oct 31, 2021

I shall try to compile some projects first before removing mstcpip.h.

@MehdiChinoune
Copy link
Collaborator

libuv includes ws2tcpip.h, but does not include mstcpip.h. Therefore, no conflicts have occurred until now. The new header has been changed to include mstcpip.h in ws2tcpip.h (https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-headers/include/ws2tcpip.h#l265). That is the cause of this problem. As I wrote in #9946 (comment) WS2tcpip.h in SDK does not include mstcpip.h. So, isn't this a problem with the MinGW header?

Looking at the commit history of ws2tcpip.h https://sourceforge.net/p/mingw-w64/mingw-w64/ci/2b92dc939918246a28f616ae036e7fde2f5ea979/tree//mingw-w64-headers/include/ws2tcpip.h?diff=bed29d9f84b6cc424a62d6e092a0f7b41234593b (from 2019-02-11 to the latest commit) I don't see any change related to mstcpip.h, The header file was included before!

@Biswa96
Copy link
Member

Biswa96 commented Oct 31, 2021

It looks like ws2tcpip.h requires mstcpip.h for SOCKET_SECURITY_QUERY_TEMPLATE type. Though WinSDK's ws2tcpip.h does not include mstcpip.h, the former one requires SOCKET_SECURITY_QUERY_TEMPLATE type definition for WSAQuerySocketSecurity function definition.

@erw7
Copy link
Contributor Author

erw7 commented Nov 1, 2021

The following change seems to have added the definition of the structure, causing a conflict. Removing the include of mstcpip.h in ws2tcpip.h may cause other problems, so I created a PR (libuv/libuv#3345) to fix it on the libuv side.

https://sourceforge.net/p/mingw-w64/mingw-w64/ci/47a9f0deb379103da970f82c79763ad2afb881b1/tree//mingw-w64-headers/include/mstcpip.h?diff=5de42ab2f1bcbda7ceea828e409bb57df581a08c

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

Successfully merging a pull request may close this issue.

4 participants