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

Build failure in msys2 in windows after updating from 1.1.9 to 1.1.10 #143

Closed
Dinnerbone opened this issue Jul 25, 2023 · 12 comments
Closed
Labels
question There is a question to be answered

Comments

@Dinnerbone
Copy link

I thought (hoped) #141 would fix it but seemingly not.

When running cargo clippy on a project that indirectly depends on libz-sys, I can no longer build after libz-sys got updated to 1.1.10 (including 1.1.11). I get the following error:

error: failed to run custom build command for `curl-sys v0.4.64+curl-8.2.0`

Caused by:
  process didn't exit successfully: `C:\Users\Dinnerbone\workspace\personal\ruffle\target\debug\build\curl-sys-98d10b0290d5e12c\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-changed=curl
  cargo:root=C:\Users\Dinnerbone\workspace\personal\ruffle\target\debug\build\curl-sys-7017c58811c3cc06\out
  cargo:include=C:\Users\Dinnerbone\workspace\personal\ruffle\target\debug\build\curl-sys-7017c58811c3cc06\out\include
  cargo:static=1
  cargo:rustc-cfg=libcurl_vendored
  cargo:rustc-cfg=link_libnghttp2
  cargo:rustc-cfg=link_libz
  TARGET = Some("x86_64-pc-windows-msvc")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc
  CC_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc
  CC_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc
  CFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc
  CFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  DEBUG = Some("true")
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/asyn-thread.o" "-c" "curl/lib/asyn-thread.c"
  asyn-thread.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/altsvc.o" "-c" "curl/lib/altsvc.c"
  altsvc.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/base64.o" "-c" "curl/lib/base64.c"
  base64.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/bufq.o" "-c" "curl/lib/bufq.c"
  bufq.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/bufref.o" "-c" "curl/lib/bufref.c"
  bufref.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/cfilters.o" "-c" "curl/lib/cfilters.c"
  cfilters.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/cf-h1-proxy.o" "-c" "curl/lib/cf-h1-proxy.c"
  cf-h1-proxy.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/cf-haproxy.o" "-c" "curl/lib/cf-haproxy.c"
  cf-haproxy.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/cf-https-connect.o" "-c" "curl/lib/cf-https-connect.c"
  cf-https-connect.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/cf-socket.o" "-c" "curl/lib/cf-socket.c"
  cf-socket.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/conncache.o" "-c" "curl/lib/conncache.c"
  conncache.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/connect.o" "-c" "curl/lib/connect.c"
  connect.c
  exit code: 0
  running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/content_encoding.o" "-c" "curl/lib/content_encoding.c"
  content_encoding.c
  curl/lib/content_encoding.c(32): fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory
  exit code: 2

  --- stderr
  fatal: not a git repository (or any of the parent directories): .git


  error occurred: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "curl/lib" "-I" "curl/include" "-I" "C:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\libnghttp2-sys-1332104d99585204\\out\\i\\include" "-DBUILDING_LIBCURL" "-DCURL_DISABLE_DICT" "-DCURL_DISABLE_GOPHER" "-DCURL_DISABLE_IMAP" "-DCURL_DISABLE_LDAP" "-DCURL_DISABLE_LDAPS" "-DCURL_DISABLE_POP3" "-DCURL_DISABLE_RTSP" "-DCURL_DISABLE_SMB" "-DCURL_DISABLE_SMTP" "-DCURL_DISABLE_TELNET" "-DCURL_DISABLE_TFTP" "-DCURL_STATICLIB" "-DENABLE_IPV6" "-DHAVE_ASSERT_H" "-DOS=\"unknown\"" "-DHAVE_ZLIB_H" "-DHAVE_LONGLONG" "-DHAVE_LIBZ" "-DHAVE_BOOL_T" "-DHAVE_STDBOOL_H" "-DHAVE_GETADDRINFO" "-DHAVE_GETPEERNAME" "-DHAVE_GETSOCKNAME" "-DCURL_DISABLE_NTLM" "-DCURL_DISABLE_FTP" "-DUSE_NGHTTP2" "-DNGHTTP2_STATICLIB" "-DUSE_WINDOWS_SSPI" "-DUSE_SCHANNEL" "-DWIN32" "-DUSE_THREADS_WIN32" "-DHAVE_IOCTLSOCKET_FIONBIO" "-DUSE_WINSOCK" "-FoC:\\Users\\Dinnerbone\\workspace\\personal\\ruffle\\target\\debug\\build\\curl-sys-7017c58811c3cc06\\out\\build\\curl/lib/content_encoding.o" "-c" "curl/lib/content_encoding.c" with args "cl.exe" did not execute successfully (status code exit code: 2).

Downgrading to 1.1.9 (cargo update -p libz-sys --precise 1.1.9) makes it work as expected. Upgrading it again makes it break.

Only running clippy seems to be affected, I can still do an actual build fine for some reason. I can also clippy fine in regular cmd.exe, so this is probably specific to using msys2. It worked before though! :(

@Byron
Copy link
Member

Byron commented Jul 25, 2023

I think there is two PRs that could cause this:

Of course, that doesn't explain what clippy would have to do with this, but it should be a good starting point. Maybe you could revert these PRs and try it locally to see if one of them is indeed causing the issue?

In the meantime, I will see if running cargo clippy on the CI here reproduces the issue already.

@Byron
Copy link
Member

Byron commented Jul 25, 2023

It looks like it doesn't reproduce with any project, flate2, that has a direct dependency to libz-sys.

This probably leaves us with you trying to apply a fix locally like suggested here or with providing more information on how to reproduce the issue.

Besides, my top-tip is to undo #39 first. It's a single line, with great potential.

@Byron Byron added the question There is a question to be answered label Jul 25, 2023
Byron added a commit to Byron/libz-sys that referenced this issue Jul 26, 2023
Byron added a commit to Byron/libz-sys that referenced this issue Jul 26, 2023
@Byron
Copy link
Member

Byron commented Jul 26, 2023

I was lucky enough to be able to reproduce the issue on a VM, and it quickly turned out that #39 was indeed to blame.

Once #146 is merged I will create a new hotfix release which will resolve the issue.

@nirbheek
Copy link

Which zlib.pc is getting picked up while running on MSYS2? I think we need to investigate that and fix it instead of just disabling pkg-config again on windows.

@Dinnerbone
Copy link
Author

Oh wow thank you for investigating it! I intended to try and bisect it later today when I was back in front of a pc 😅
I appreciate the help!

@Byron
Copy link
Member

Byron commented Jul 26, 2023

Which zlib.pc is getting picked up while running on MSYS2? I think we need to investigate that and fix it instead of just disabling pkg-config again on windows.

I think it's important to fix the issue now as it was recently introduced. This buys time to see what it takes to use pkg-config on windows. It's a separate matter that can be contributed along with test to have some protection from regressions like these.

@Byron Byron closed this as completed in 39a51ea Jul 26, 2023
Byron added a commit that referenced this issue Jul 26, 2023
@Byron
Copy link
Member

Byron commented Jul 26, 2023

A new release was created that contains the fix.

I truly hope we are back to a stable state now.

@torokati44
Copy link

Just a small detail about the !target.contains("msvc") && // pkg-config just never works here line:
I think pkg-config can work on Windows just fine, in msys2.

The check for msvc being in the target is not right for this IMHO, because:

One could target msvc both when building in an msys2 environment, and when natively (from CMD.EXE for example).
And one could both target windws-gnu and windows-msvc when building in msys2.

@Dinnerbone
Copy link
Author

Confirmed the new version works for me. Thanks again!

@micolous
Copy link
Contributor

micolous commented Jul 28, 2023

Having a look at the build log in the original report, it looks like it's actually trying to build a vendored libcurl from source, rather than including a system package, and that has its own custom build script. It's also building using an MSVC toolchain, MSVC host and MSVC target – so while it may be in an MSYS2 environment, it's not using any GNU/msys2 toolchain.

As a result, it's extremely strange that 39a51ea (a change in libz-sys) fixed the issue. So I did some digging:

curl-rust currently never uses pkg-config to find libcurl on Windows (both MSVC and GNU toolchains):

https://github.com/alexcrichton/curl-rust/blob/ff6ad21cc1034826b2ab3f8be0653d8c446e1bdc/curl-sys/build.rs#L30-L37

There's a PR to change it, but the maintainers currently don't want to change it, as they're worried about breakages.

When the curl-rust build script can't find libcurl, it builds it from source. It creates its own pkg-config file (even on Windows), and removes all library linkages:

https://github.com/alexcrichton/curl-rust/blob/ff6ad21cc1034826b2ab3f8be0653d8c446e1bdc/curl-sys/build.rs#L100

...and configures with zlib support:

https://github.com/alexcrichton/curl-rust/blob/ff6ad21cc1034826b2ab3f8be0653d8c446e1bdc/curl-sys/build.rs#L127

On Windows when built with an MSVC host (because #[cfg(target_env = 'msvc')] in a build.rs affects the host platform, not the target), and using feature windows-static-ssl, it'll use vcpkg to pull in zlib (and openssl):

https://github.com/alexcrichton/curl-rust/blob/ff6ad21cc1034826b2ab3f8be0653d8c446e1bdc/curl-sys/build.rs#L296-L299

Otherwise, it can only use the system include directories, and relies on libz-sys to provide appropriate linkages to zlib in the final binary.

As a result, curl-rust will only pull in zlib on MSVC host platforms when targetting Windows is if there's a matching zlib in vcpkg. This would only work with MSVC target platforms until mcgoo/vcpkg-rs#52 is in.

On other platforms that mostly isn't a problem, because there's normally an appropriate zlib in the system include path.

As for why the rollback "fixed it", by suspicion is that when libz-sys swiched to using pkg-config, it no longer had to build its own zlib from source, but curl-rust's build process has a transitive dependency on those artefacts.

I think it was the right call to do a roll-back, but while #39 triggered this issue, it isn't the root cause. I suspect that alexcrichton/curl-rust#486 would have fixed this where there's a system-installed libcurl with pkg-config data, but curl-rust also needs to use pkg-config to pull in zlib too when building libcurl from source.

@micolous
Copy link
Contributor

I found where curl-rust's vendoring transitively depends on libz-sys also vendoring or it being in the system include path:

https://github.com/alexcrichton/curl-rust/blob/ff6ad21cc1034826b2ab3f8be0653d8c446e1bdc/curl-sys/build.rs#L57-L59

Which is built by libz-sys here:

libz-sys/build.rs

Lines 93 to 94 in 0bb7bd4

fn build_zlib(cfg: &mut cc::Build, target: &str) {
let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap());

libz-sys/build.rs

Lines 135 to 137 in 0bb7bd4

fs::create_dir_all(dst.join("include")).unwrap();
fs::copy("src/zlib/zlib.h", dst.join("include/zlib.h")).unwrap();
fs::copy("src/zlib/zconf.h", dst.join("include/zconf.h")).unwrap();

So yes, curl-rust should be searching for zlib some other way... and it may need some way to extract the build configuration (and include paths) from libz-sys so that it gets the same zlib.

@Byron
Copy link
Member

Byron commented Jul 28, 2023

Thanks so much @micolous for this awesome detective work! It's clearly beyond me, too, and I hope you will be able to orchestrate the involved crates into a better state overall.
I will be happy to help as good as I can, but will definitely rely on your PRs to make it happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question There is a question to be answered
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants