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

clippy: fix new warnings in Rust 1.71 #606

Closed
wants to merge 2 commits into from

Conversation

ahayzen-kdab
Copy link
Collaborator

No description provided.

@ahayzen-kdab
Copy link
Collaborator Author

Windows is failing, looks like maybe a new linker failure in rustc 1.71 ?

Searching around the linker errors seems to be related to Ws2_32.lib not being linked ? Or to do with MTd vs MDd being mismatched between the binaries 🤔

@ahayzen-kdab
Copy link
Collaborator Author

Ugh appears Qt 5 and Qt 6 are failing in subtly different ways

Qt 5 linking failure [16/74] Linking CXX shared library examples\qml_extension_plugin\plugin\core_qmlplugin.dll FAILED: examples/qml_extension_plugin/plugin/core_qmlplugin.dll examples/qml_extension_plugin/plugin/core_qmlplugin.lib cmd.exe /C "cd . && "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=examples\qml_extension_plugin\plugin\CMakeFiles\core_qmlplugin.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1435~1.322\bin\HostX64\x64\link.exe /nologo examples\qml_extension_plugin\plugin\CMakeFiles\core_qmlplugin.dir\core_qmlplugin_autogen\mocs_compilation.cpp.obj examples\qml_extension_plugin\plugin\CMakeFiles\core_qmlplugin.dir\cpp\plugin.cpp.obj /out:examples\qml_extension_plugin\plugin\core_qmlplugin.dll /implib:examples\qml_extension_plugin\plugin\core_qmlplugin.lib /pdb:examples\qml_extension_plugin\plugin\core_qmlplugin.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /WHOLEARCHIVE:examples\qml_extension_plugin\plugin\qml_extension_plugin.lib vcpkg_installed\x64-windows\lib\Qt5QuickControls2.lib vcpkg_installed\x64-windows\lib\Qt5Quick.lib vcpkg_installed\x64-windows\lib\Qt5Gui.lib vcpkg_installed\x64-windows\lib\Qt5QmlModels.lib vcpkg_installed\x64-windows\lib\Qt5Qml.lib vcpkg_installed\x64-windows\lib\Qt5Network.lib vcpkg_installed\x64-windows\lib\Qt5Core.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D C:\cxx-qt\build\examples\qml_extension_plugin\plugin && "C:\Program Files\PowerShell\7\pwsh.exe" -noprofile -executionpolicy Bypass -file C:/cxx-qt/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary C:/cxx-qt/build/examples/qml_extension_plugin/plugin/core_qmlplugin.dll -installedDir C:/cxx-qt/build/vcpkg_installed/x64-windows/bin -OutVariable out"" LINK: command "C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1435~1.322\bin\HostX64\x64\link.exe /nologo examples\qml_extension_plugin\plugin\CMakeFiles\core_qmlplugin.dir\core_qmlplugin_autogen\mocs_compilation.cpp.obj examples\qml_extension_plugin\plugin\CMakeFiles\core_qmlplugin.dir\cpp\plugin.cpp.obj /out:examples\qml_extension_plugin\plugin\core_qmlplugin.dll /implib:examples\qml_extension_plugin\plugin\core_qmlplugin.lib /pdb:examples\qml_extension_plugin\plugin\core_qmlplugin.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /WHOLEARCHIVE:examples\qml_extension_plugin\plugin\qml_extension_plugin.lib vcpkg_installed\x64-windows\lib\Qt5QuickControls2.lib vcpkg_installed\x64-windows\lib\Qt5Quick.lib vcpkg_installed\x64-windows\lib\Qt5Gui.lib vcpkg_installed\x64-windows\lib\Qt5QmlModels.lib vcpkg_installed\x64-windows\lib\Qt5Qml.lib vcpkg_installed\x64-windows\lib\Qt5Network.lib vcpkg_installed\x64-windows\lib\Qt5Core.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:examples\qml_extension_plugin\plugin\core_qmlplugin.dll.manifest" failed (exit code 1120) with the following output: Creating library examples\qml_extension_plugin\plugin\core_qmlplugin.lib and object examples\qml_extension_plugin\plugin\core_qmlplugin.exp

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_WSAStartup referenced in function _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17he6ccc121c87dd285E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_WSACleanup referenced in function _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17he6ccc121c87dd285E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_freeaddrinfo referenced in function _ZN4core3ptr165drop_in_place$LT$core..iter..adapters..map..Map$LT$std..sys_common..net..LookupHost$C$std..net..socket_addr..resolve_socket_addr..$u7b$$u7b$closure$u7d$$u7d$$GT$$GT$17hd348d8c163534764E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_closesocket referenced in function _ZN4core3ptr51drop_in_place$LT$std..sys..windows..net..Socket$GT$17ha7d49ed65e4a62f0E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_GetUserProfileDirectoryW referenced in function _ZN3std3env8home_dir17hf92af1f80156d4acE

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_shutdown referenced in function _ZN3std3net3tcp9TcpStream8shutdown17h0b8a8a6018d89059E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_WSAGetLastError referenced in function _ZN3std3net3tcp9TcpStream8shutdown17h0b8a8a6018d89059E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_setsockopt referenced in function _ZN3std3net3udp9UdpSocket16set_read_timeout17h15a7851aeb6ff53bE

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_getsockopt referenced in function _ZN3std3net3udp9UdpSocket12read_timeout17h9796db3c7ecbd1daE

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_recv referenced in function _ZN3std3net3udp9UdpSocket4peek17h1d7606f6e84f09f8E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_WSARecv referenced in function ZN58$LT$std..net..tcp..TcpStream$u20$as$u20$std..io..Read$GT$13read_vectored17h9ab2ac35c7cf3d42E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_WSASend referenced in function ZN59$LT$std..net..tcp..TcpStream$u20$as$u20$std..io..Write$GT$14write_vectored17hd1c57acd0289d04eE

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_send referenced in function ZN63$LT$$RF$std..net..tcp..TcpStream$u20$as$u20$std..io..Write$GT$5write17ha414950533429ff8E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_accept referenced in function _ZN3std3net3tcp11TcpListener6accept17hcf1e5bc3b39b6b30E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_ioctlsocket referenced in function _ZN3std3net3udp9UdpSocket15set_nonblocking17hecd30f572a8341b8E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_getpeername referenced in function _ZN3std3net3udp9UdpSocket9peer_addr17h9e4e6a1427982cabE

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_WSADuplicateSocketW referenced in function _ZN3std2os7windows2io6socket14BorrowedSocket18try_clone_to_owned17h710949ebc09f96a6E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_WSASocketW referenced in function _ZN3std2os7windows2io6socket14BorrowedSocket18try_clone_to_owned17h710949ebc09f96a6E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_getaddrinfo referenced in function _ZN3std3sys6common14small_c_string24run_with_cstr_allocating17h8e910c6130dc86eeE

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_NtCreateFile referenced in function _ZN3std3sys7windows2fs20open_link_no_reparse17ha8439d4ac49b3913E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_RtlNtStatusToDosError referenced in function _ZN3std3sys7windows2fs20open_link_no_reparse17ha8439d4ac49b3913E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_NtReadFile referenced in function _ZN3std3sys7windows6handle6Handle16synchronous_read17hfd3297a2d25b288dE

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_NtWriteFile referenced in function _ZN3std3sys7windows6handle6Handle17synchronous_write17h1f1222e834ac3046E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_connect referenced in function _ZN3std3sys7windows3net6Socket15connect_timeout17h94258e7dcc0f1783E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_select referenced in function _ZN3std3sys7windows3net6Socket15connect_timeout17h94258e7dcc0f1783E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_recvfrom referenced in function _ZN3std3sys7windows3net6Socket20recv_from_with_flags17hbe8c91ac0e41bfadE

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_BCryptGenRandom referenced in function _ZN3std3sys7windows4pipe9anon_pipe17h721e08ce9d308fa9E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_bind referenced in function _ZN3std10sys_common3net11TcpListener4bind17hf9dcb78187382003E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_listen referenced in function _ZN3std10sys_common3net11TcpListener4bind17hf9dcb78187382003E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_getsockname referenced in function _ZN3std10sys_common3net11TcpListener11socket_addr17h1dc61f139203ee41E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_sendto referenced in function _ZN3std10sys_common3net9UdpSocket7send_to17h58a2b3e0b57e68ebE

examples\qml_extension_plugin\plugin\core_qmlplugin.dll : fatal error LNK1120: 31 unresolved externals

Qt 6 linking failure [16/74] Linking CXX shared library examples\qml_extension_plugin\plugin\core_qmlplugin.dll FAILED: examples/qml_extension_plugin/plugin/core_qmlplugin.dll examples/qml_extension_plugin/plugin/core_qmlplugin.lib cmd.exe /C "cd . && "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=examples\qml_extension_plugin\plugin\CMakeFiles\core_qmlplugin.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1435~1.322\bin\HostX64\x64\link.exe /nologo examples\qml_extension_plugin\plugin\CMakeFiles\core_qmlplugin.dir\core_qmlplugin_autogen\mocs_compilation.cpp.obj examples\qml_extension_plugin\plugin\CMakeFiles\core_qmlplugin.dir\cpp\plugin.cpp.obj /out:examples\qml_extension_plugin\plugin\core_qmlplugin.dll /implib:examples\qml_extension_plugin\plugin\core_qmlplugin.lib /pdb:examples\qml_extension_plugin\plugin\core_qmlplugin.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /WHOLEARCHIVE:examples\qml_extension_plugin\plugin\qml_extension_plugin.lib vcpkg_installed\x64-windows\lib\Qt6QuickControls2.lib vcpkg_installed\x64-windows\lib\Qt6Quick.lib vcpkg_installed\x64-windows\lib\Qt6OpenGL.lib vcpkg_installed\x64-windows\lib\Qt6Gui.lib d3d11.lib dxgi.lib dxguid.lib dcomp.lib user32.lib vcpkg_installed\x64-windows\lib\Qt6QmlModels.lib vcpkg_installed\x64-windows\lib\Qt6Qml.lib vcpkg_installed\x64-windows\lib\Qt6Network.lib vcpkg_installed\x64-windows\lib\Qt6Core.lib mpr.lib userenv.lib ws2_32.lib shell32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D C:\cxx-qt\build\examples\qml_extension_plugin\plugin && "C:\Program Files\PowerShell\7\pwsh.exe" -noprofile -executionpolicy Bypass -file C:/cxx-qt/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary C:/cxx-qt/build/examples/qml_extension_plugin/plugin/core_qmlplugin.dll -installedDir C:/cxx-qt/build/vcpkg_installed/x64-windows/bin -OutVariable out"" LINK: command "C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1435~1.322\bin\HostX64\x64\link.exe /nologo examples\qml_extension_plugin\plugin\CMakeFiles\core_qmlplugin.dir\core_qmlplugin_autogen\mocs_compilation.cpp.obj examples\qml_extension_plugin\plugin\CMakeFiles\core_qmlplugin.dir\cpp\plugin.cpp.obj /out:examples\qml_extension_plugin\plugin\core_qmlplugin.dll /implib:examples\qml_extension_plugin\plugin\core_qmlplugin.lib /pdb:examples\qml_extension_plugin\plugin\core_qmlplugin.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /WHOLEARCHIVE:examples\qml_extension_plugin\plugin\qml_extension_plugin.lib vcpkg_installed\x64-windows\lib\Qt6QuickControls2.lib vcpkg_installed\x64-windows\lib\Qt6Quick.lib vcpkg_installed\x64-windows\lib\Qt6OpenGL.lib vcpkg_installed\x64-windows\lib\Qt6Gui.lib d3d11.lib dxgi.lib dxguid.lib dcomp.lib user32.lib vcpkg_installed\x64-windows\lib\Qt6QmlModels.lib vcpkg_installed\x64-windows\lib\Qt6Qml.lib vcpkg_installed\x64-windows\lib\Qt6Network.lib vcpkg_installed\x64-windows\lib\Qt6Core.lib mpr.lib userenv.lib ws2_32.lib shell32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:examples\qml_extension_plugin\plugin\core_qmlplugin.dll.manifest" failed (exit code 1120) with the following output: Creating library examples\qml_extension_plugin\plugin\core_qmlplugin.lib and object examples\qml_extension_plugin\plugin\core_qmlplugin.exp

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_NtCreateFile referenced in function _ZN3std3sys7windows2fs20open_link_no_reparse17ha8439d4ac49b3913E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_RtlNtStatusToDosError referenced in function _ZN3std3sys7windows2fs20open_link_no_reparse17ha8439d4ac49b3913E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_NtReadFile referenced in function _ZN3std3sys7windows6handle6Handle16synchronous_read17hfd3297a2d25b288dE

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_NtWriteFile referenced in function _ZN3std3sys7windows6handle6Handle17synchronous_write17h1f1222e834ac3046E

qml_extension_plugin.lib(std-f54c5a8dc7e7febf.std.1153952cb135a7f6-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_BCryptGenRandom referenced in function _ZN3std3sys7windows4pipe9anon_pipe17h721e08ce9d308fa9E

examples\qml_extension_plugin\plugin\core_qmlplugin.dll : fatal error LNK1120: 5 unresolved externals

@ahayzen-kdab
Copy link
Collaborator Author

Manually linking ws2_32 wsock32 on Windows has helped the Qt 5 build reduce the linker errors.

However my question is now, what was doing this before ? and why has it broken ?

@Be-ing
Copy link
Contributor

Be-ing commented Jul 14, 2023

It's a Corrosion bug: corrosion-rs/corrosion#418

@Be-ing
Copy link
Contributor

Be-ing commented Jul 14, 2023

Actually, it's a Cargo bug: rust-lang/cargo#12360

@Be-ing
Copy link
Contributor

Be-ing commented Jul 14, 2023

Workaround for the build failure: #607

@ahayzen-kdab
Copy link
Collaborator Author

Closed in favour of #609

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 this pull request may close these issues.

2 participants