Bug #90748 MySQL 5.7.22 build fails on Windows
Submitted: 4 May 2018 9:04 Modified: 4 May 2018 11:58
Reporter: Manuel Matonin Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version: OS:Windows
Assigned to: CPU Architecture:x86

[4 May 2018 9:04] Manuel Matonin
Description:
When compiling 5.7.22 source on Windows 7 then build fails:

LINK : fatal error LNK1181: cannot open input file '' [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]

How to repeat:
H:\Work\mysql\mysql-5.7.22-x64\bld-static>cmake .. -DSIGNCODE=0 -DWITH_BOOST=h:\Work\boost_1_59_0 -DBUILD_CONFIG=mysql_release -G "Visual Studio 12 2013 Win64" -DLINK_STATIC_RUNTIME_LIBRARIES=1
-- Running cmake version 3.3.2
-- Could NOT find Git (missing:  GIT_EXECUTABLE)
-- Configuring with MAX_INDEXES = 64U
-- The C compiler identification is MSVC 18.0.40629.0
-- The CXX compiler identification is MSVC 18.0.40629.0
-- Check for working C compiler using: Visual Studio 12 2013 Win64
-- Check for working C compiler using: Visual Studio 12 2013 Win64 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 12 2013 Win64
-- Check for working CXX compiler using: Visual Studio 12 2013 Win64 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_GENERATOR: Visual Studio 12 2013 Win64
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void *
-- Check size of void * - done
-- SIZEOF_VOIDP 8
-- MySQL 5.7.22
-- Packaging as: mysql-5.7.22-winx64
-- Local boost dir h:/Work/boost_1_59_0
-- Found h:/Work/boost_1_59_0/boost/version.hpp
-- BOOST_VERSION_NUMBER is #define BOOST_VERSION 105900
-- BOOST_INCLUDE_DIR h:/Work/boost_1_59_0
-- Found Threads: TRUE
-- Looking for include file crypt.h
-- Looking for include file crypt.h - not found
-- Looking for getnameinfo
-- Looking for getnameinfo - found
-- Looking for inet_ntop
-- Looking for inet_ntop - found
-- Looking for log2
-- Looking for log2 - found
-- Looking for isinf
-- Looking for isinf - found
-- Performing Test HAVE_CXX_ISINF
-- Performing Test HAVE_CXX_ISINF - Success
-- Check size of struct timespec
-- Check size of struct timespec - failed
-- Performing Test HAVE_VISIBILITY_HIDDEN
-- Performing Test HAVE_VISIBILITY_HIDDEN - Failed
-- Check size of struct sockaddr_in6
-- Check size of struct sockaddr_in6 - done
-- Check size of struct in6_addr
-- Check size of struct in6_addr - done
-- Performing Test HAVE_IMPLICIT_DEPENDENT_NAME_TYPING
-- Performing Test HAVE_IMPLICIT_DEPENDENT_NAME_TYPING - Success
-- Looking for chown
-- Looking for chown - not found
-- Looking for include file numa.h
-- Looking for include file numa.h - not found
-- Looking for include file numaif.h
-- Looking for include file numaif.h - not found
-- NUMA library missing or required version not available
-- Check size of socklen_t
-- Check size of socklen_t - failed
-- Performing Test HAVE_NO_UNUSED_CONST_VAR
-- Performing Test HAVE_NO_UNUSED_CONST_VAR - Failed
-- WITH_PROTOBUF=bundled
-- Performing Test HAVE_NO_SIGN_COMPARE
-- Performing Test HAVE_NO_SIGN_COMPARE - Failed
-- Performing Test HAVE_NO_UNUSED_TYPEDEFS
-- Performing Test HAVE_NO_UNUSED_TYPEDEFS - Failed
-- Performing Test HAVE_NO_IGNORED_QUALIFIERS
-- Performing Test HAVE_NO_IGNORED_QUALIFIERS - Failed
-- Performing Test HAVE_NO_RETURN_TYPE
-- Performing Test HAVE_NO_RETURN_TYPE - Failed
-- Performing Test HAVE_NO_UNUSED_FUNCTION
-- Performing Test HAVE_NO_UNUSED_FUNCTION - Failed
-- Performing Test HAVE_MAYBE_UNINITIALIZED
-- Performing Test HAVE_MAYBE_UNINITIALIZED - Failed
-- Performing Test HAVE_UNUSED_BUT_SET
-- Performing Test HAVE_UNUSED_BUT_SET - Failed
-- protobuf version is 2.6
-- Performing Test HAVE_SYS_THREAD_SELFID
-- Performing Test HAVE_SYS_THREAD_SELFID - Failed
-- Performing Test HAVE_SYS_GETTID
-- Performing Test HAVE_SYS_GETTID - Failed
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP - Failed
-- Performing Test HAVE_INTEGER_PTHREAD_SELF
-- Performing Test HAVE_INTEGER_PTHREAD_SELF - Failed
-- Creating LDAP authentication SASL client library.
-- Looking for include file sasl/sasl.h
-- Looking for include file sasl/sasl.h - not found
-- Looking for include file lber.h
-- Looking for include file lber.h - not found
-- Required SASL library is missing. Skipping the LDAP SASL client authentication plugin.
-- Library mysqlclient depends on OSLIBS ws2_32;Secur32
-- MERGE_CONVENIENCE_LIBRARIES TARGET mysqlclient
-- MERGE_CONVENIENCE_LIBRARIES LIBS clientlib;dbug;strings;vio;mysys;mysys_ssl;zlib;yassl;taocrypt;auth_win_client
-- MERGE_CONVENIENCE_LIBRARIES MYLIBS clientlib;dbug;strings;vio;mysys;mysys_ssl;zlib;yassl;taocrypt;auth_win_client
-- Looking for include file endian.h
-- Looking for include file endian.h - not found
-- Check size of long long
-- Check size of long long - done
-- Check size of long
-- Check size of long - done
-- Check size of int
-- Check size of int - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found ZLIB: zlib (found version "1.2.3")
-- Using cmake version 3.3.2
-- Not building NDB
-- Performing Test HAVE_UNUSED_TYPEDEFS
-- Performing Test HAVE_UNUSED_TYPEDEFS - Failed
-- Performing Test HAVE_STRUCT_SOCKADDR_SA_LEN
-- Performing Test HAVE_STRUCT_SOCKADDR_SA_LEN - Failed
-- Performing Test HAVE_STRUCT_IFREQ_IFR_NAME
-- Performing Test HAVE_STRUCT_IFREQ_IFR_NAME - Failed
-- Performing Test HAVE_XDR_OPS_X_PUTINT32
-- Performing Test HAVE_XDR_OPS_X_PUTINT32 - Success
-- Performing Test HAVE_XDR_OPS_X_GETINT32
-- Performing Test HAVE_XDR_OPS_X_GETINT32 - Success
-- Performing Test HAVE___CONST
-- Performing Test HAVE___CONST - Success
-- Performing Test HAVE_RPC_INLINE_T
-- Performing Test HAVE_RPC_INLINE_T - Failed
-- Using Boost headers from h:/Work/boost_1_59_0
-- Performing Test CXX_HAVE_SIGN_COMPARE
-- Performing Test CXX_HAVE_SIGN_COMPARE - Failed
-- Performing Test CXX_HAVE_UNUSED_VARIABLE
-- Performing Test CXX_HAVE_UNUSED_VARIABLE - Failed
-- MYSQLX - Text log of protobuf messages enabled
-- Performing Test HAVE_UNUSED_PARAMETER
-- Performing Test HAVE_UNUSED_PARAMETER - Failed
-- Googletest was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automa
tically download and build required components from source.
-- If you are inside a firewall, you may need to use an https proxy: export https_proxy=http://example.com:80
-- Performing Test HAVE_MISLEADING_INDENTATION
-- Performing Test HAVE_MISLEADING_INDENTATION - Failed
-- Performing Test HAVE_NO_BUILTIN_MEMCMP
-- Performing Test HAVE_NO_BUILTIN_MEMCMP - Failed
-- executable target mysqld debug_target H:/Work/mysql/mysql-5.7.22-x64/bld-static/sql/Debug/mysqld-debug.exe
-- Library mysqlserver depends on OSLIBS ws2_32
-- MERGE_CONVENIENCE_LIBRARIES TARGET mysqlserver
-- MERGE_CONVENIENCE_LIBRARIES LIBS dbug;strings;regex;mysys;mysys_ssl;vio;zlib;yassl;taocrypt;archive_embedded;blackhol
e_embedded;csv_embedded;federated_embedded;heap_embedded;innobase;lz4_lib;myisam_embedded;myisammrg_embedded;partition_e
mbedded;ngram_parser;sql_embedded
-- MERGE_CONVENIENCE_LIBRARIES MYLIBS dbug;strings;regex;mysys;mysys_ssl;vio;zlib;yassl;taocrypt;archive_embedded;blackh
ole_embedded;csv_embedded;federated_embedded;heap_embedded;innobase;lz4_lib;myisam_embedded;myisammrg_embedded;partition
_embedded;ngram_parser;sql_embedded
-- WIX_DIR WIX_DIR-NOTFOUND path C:\Program Files (x86)/WiX Toolset V3.8
-- WIX_DIR WIX_DIR-NOTFOUND path C:\Program Files (x86)/WiX Toolset V3.8/bin
-- WIX_DIR WIX_DIR-NOTFOUND path C:\Program Files (x86)/WiX Toolset V3.8
-- WIX_DIR WIX_DIR-NOTFOUND path C:\Program Files (x86)/WiX Toolset V3.8/bin
-- WIX_DIR WIX_DIR-NOTFOUND looked at
-- Cannot find wix 3, installer project will not be generated
-- COMPILE_DEFINITIONS: _WIN32_WINNT=0x0601;WIN32_LEAN_AND_MEAN;NOGDI;NOMINMAX;HAVE_CONFIG_H;HAVE_LIBEVENT1
-- CMAKE_C_FLAGS:  /DWIN32 /D_WINDOWS /W3 /MP /wd4800 /wd4805 /wd4996
-- CMAKE_CXX_FLAGS:  /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MP /wd4800 /wd4805 /wd4996 /we4099
-- CMAKE_C_LINK_FLAGS:
-- CMAKE_CXX_LINK_FLAGS:
-- CMAKE_C_FLAGS_DEBUG: /D_DEBUG /MTd /Z7 /Ob1 /Od /RTC1 /EHsc -DENABLED_DEBUG_SYNC -DSAFE_MUTEX
-- CMAKE_CXX_FLAGS_DEBUG: /D_DEBUG /MTd /Z7 /Ob1 /Od /RTC1 /EHsc -DENABLED_DEBUG_SYNC -DSAFE_MUTEX
-- CMAKE_C_FLAGS_RELWITHDEBINFO: /MT /Z7 /O2 /Ob1 /D NDEBUG /EHsc -DDBUG_OFF
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: /MT /Z7 /O2 /Ob1 /D NDEBUG /EHsc -DDBUG_OFF
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    SIGNCODE

-- Build files have been written to: H:/Work/mysql/mysql-5.7.22-x64/bld-static

H:\Work\mysql\mysql-5.7.22-x64\bld-static>cmake --build . --config RelWithDebInfo

...
...
...

Done Building Project "H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\clientlib.vcxproj" (default targets).
PrepareForBuild:
  Creating directory "mysqlclient.dir\RelWithDebInfo\".
  Creating directory "mysqlclient.dir\RelWithDebInfo\mysqlclient.tlog\".
InitializeBuildStatus:
  Creating "mysqlclient.dir\RelWithDebInfo\mysqlclient.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
  Building Custom Rule H:/Work/mysql/mysql-5.7.22-x64/libmysql/CMakeLists.txt
  CMake does not need to re-run because H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\CMakeFiles\generate.stamp is up-to-date.
  Generating ../archive_output_directory/mysqlclient_depends.c
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /I"H:\Work\mysql\mysql-5.7.22-x64\bld-static\include" /I"H:\Work\mysql\mysql-5.7.22-x64\extra\rapidjson\include" /I"H:\Work\mysql\mysql-5.7.22-x64\bld-static\libbinlogevents\include" /I"H:\Work\mysql\mysql-5.7.22-x64\libbinlogevents\export" /I"H:\Work\mysql\mysql-5.7.22-x64\include" /I"H:\Work\mysql\mysql-5.7.22-x64\libmysql" /I"H:\Work\mysql\mysql-5.7.22-x64\regex" /I"H:\Work\mysql\mysql-5.7.22-x64\sql" /I"H:\Work\mysql\mysql-5.7.22-x64\strings" /I"H:\Work\mysql\mysql-5.7.22-x64\extra\yassl\include" /I"H:\Work\mysql\mysql-5.7.22-x64\extra\yassl\taocrypt\include" /I"H:\Work\mysql\mysql-5.7.22-x64\extra\yassl\taocrypt\mySTL" /I"H:\Work\mysql\mysql-5.7.22-x64\zlib" /Z7 /nologo /W3 /WX- /MP /O2 /Ob1 /D WIN32 /D _WINDOWS /D NDEBUG /D DBUG_OFF /D HAVE_YASSL /D YASSL_PREFIX /D HAVE_OPENSSL /D MULTI_THREADED /D CLIENT_PROTOCOL_TRACING /D _WIN32_WINNT=0x0601 /D WIN32_LEAN_AND_MEAN /D NOGDI /D NOMINMAX /D HAVE_CONFIG_H /D HAVE_LIBEVENT1 /D AUTHENTICATION_WIN /D "CMAKE_INTDIR=\"RelWithDebInfo\"" /D _MBCS /Gm- /EHsc /MT /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"mysqlclient.dir\RelWithDebInfo\\" /Fd"mysqlclient.dir\RelWithDebInfo\vc120.pdb" /Gd /TC /wd4800 /wd4805 /wd4996 /errorReport:queue "H:\Work\mysql\mysql-5.7.22-x64\bld-static\archive_output_directory\mysqlclient_depends.c"
  mysqlclient_depends.c
Lib:
  C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\Lib.exe /OUT:"H:\Work\mysql\mysql-5.7.22-x64\bld-static\archive_output_directory\RelWithDebInfo\mysqlclient.lib" /NOLOGO /MACHINE:X64 mysqlclient.dir\RelWithDebInfo\mysqlclient_depends.obj
  mysqlclient.vcxproj -> H:\Work\mysql\mysql-5.7.22-x64\bld-static\archive_output_directory\RelWithDebInfo\mysqlclient.lib
PostBuildEvent:
  Description: Merging library mysqlclient
  setlocal
  "C:\Program Files (x86)\CMake\bin\cmake.exe" -DTARGET_NAME=mysqlclient -DTARGET_LOC=H:/Work/mysql/mysql-5.7.22-x64/bld-static/archive_output_directory/RelWithDebInfo/mysqlclient.lib -DCFG_INTDIR=RelWithDebInfo -P H:/Work/mysql/mysql-5.7.22-x64/bld-static/archive_output_directory/lib_merge_mysqlclient.cmake
  if %errorlevel% neq 0 goto :cmEnd
  :cmEnd
  endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
  :cmErrorLevel
  exit /b %1
  :cmDone
  if %errorlevel% neq 0 goto :VCEnd
  :VCEnd
  -- merge_archives linker in PATH is C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/link.exe
  -- link_result is 1181
  CMake Warning at H:/Work/mysql/mysql-5.7.22-x64/bld-static/archive_output_directory/lib_merge_mysqlclient.cmake:91 (MESSAGE):
    Retrying link with C:/Program Files (x86)/Microsoft Visual Studio
    12.0/VC/bin/x86_amd64/link.exe
  
  
LINK : fatal error LNK1181: cannot open input file '' [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]
  
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: The command "setlocal [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: "C:\Program Files (x86)\CMake\bin\cmake.exe" -DTARGET_NAME=mysqlclient -DTARGET_LOC=H:/Work/mysql/mysql-5.7.22-x64/bld-static/archive_output_directory/RelWithDebInfo/mysqlclient.lib -DCFG_INTDIR=RelWithDebInfo -P H:/Work/mysql/mysql-5.7.22-x64/bld-static/archive_output_directory/lib_merge_mysqlclient.cmake [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmEnd [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmErrorLevel [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: exit /b %1 [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmDone [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :VCEnd" exited with code -1. [H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj]
Done Building Project "H:\Work\mysql\mysql-5.7.22-x64\bld-static\libmysql\mysqlclient.vcxproj" (default targets) -- FAILED.
Done Building Project "H:\Work\mysql\mysql-5.7.22-x64\bld-static\testclients\bug25714.vcxproj" (default targets) -- FAILED.
[4 May 2018 11:48] MySQL Verification Team
Thank you for the bug report. I think your issue is Visual Studio 2013 with Visual Studio 2017 I have not problems:

<CUT>

"C:\tmp\mysql-5.7.22\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\tmp\mysql-5.7.22\mysys\thr_lock.vcxproj" (default target) (177) ->
  c:\tmp\mysql-5.7.22\mysys\thr_lock.c(985): warning C4311: 'type cast': pointer truncation from 'st_thr_lock *' to 'lo
ng' [C:\tmp\mysql-5.7.22\mysys\thr_lock.vcxproj]
  c:\tmp\mysql-5.7.22\mysys\thr_lock.c(1079): warning C4311: 'type cast': pointer truncation from 'st_thr_lock *' to 'l
ong' [C:\tmp\mysql-5.7.22\mysys\thr_lock.vcxproj]
  c:\tmp\mysql-5.7.22\mysys\thr_lock.c(1237): warning C4311: 'type cast': pointer truncation from 'THR_LOCK_DATA *' to
'ulong' [C:\tmp\mysql-5.7.22\mysys\thr_lock.vcxproj]
  c:\tmp\mysql-5.7.22\mysys\thr_lock.c(1261): warning C4311: 'type cast': pointer truncation from 'THR_LOCK *' to 'ulon
g' [C:\tmp\mysql-5.7.22\mysys\thr_lock.vcxproj]

"C:\tmp\mysql-5.7.22\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\tmp\mysql-5.7.22\sql\udf_example.vcxproj" (default target) (179) ->
  c:\tmp\mysql-5.7.22\sql\udf_example.cc(1097): warning C4312: 'type cast': conversion from 'unsigned long' to 'char *'
 of greater size [C:\tmp\mysql-5.7.22\sql\udf_example.vcxproj]

"C:\tmp\mysql-5.7.22\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\tmp\mysql-5.7.22\extra\zlib_decompress.vcxproj" (default target) (182) ->
  c:\tmp\mysql-5.7.22\extra\zlib_decompress.cc(71): warning C4267: 'initializing': conversion from 'size_t' to 'int', p
ossible loss of data [C:\tmp\mysql-5.7.22\extra\zlib_decompress.vcxproj]
<CUT>

C:\tmp\mysql-5.7.22>sql\RelWithDebInfo\mysqld.exe --version
sql\RelWithDebInfo\mysqld.exe  Ver 5.7.22 for Win64 on x86_64 (MySQL Community Server (GPL))

C:\tmp\mysql-5.7.22>
[4 May 2018 11:58] Manuel Matonin
Is VS2017 standard compiler recommended for compiling MySQL 5.7 on Windows ? I don't have VS2013 build issues using MySQL build 5.7.19.