diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2020-05-14 15:46:17 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2020-05-14 15:55:18 +0200 |
commit | 3bfe305c5cd678a8563f7a76d6ed59095129007e (patch) | |
tree | b8470b3a813548ed28b133bc4b0106f70d315747 /win | |
parent | 38f6c47f8a0a9bc313e4875c4676985249771c76 (diff) | |
download | mariadb-git-3bfe305c5cd678a8563f7a76d6ed59095129007e.tar.gz |
MDEV-22555 Windows, packaging: binaries depend on vcruntime140_1.dll, which is not in MSI
When server is compiled with recent VS2019, then executables,
have dependency on vcruntime140_1.dll
While we include the VC redistributable merge modules into our MSI package,
those merge modules were stale (taken from older VS version, 2017)
Since VS2019 brough new DLL dependency by introducing new exception handling
https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64
thus the old MSMs were not enough.
The fix is to change logic in win/packaging/CMakeLists.txt to look up for
the correct, new MSMs.
The bug only affects 10.4,as we compile with static CRT before 10.4,
and partly-statically(just vcruntime stub is statically linked, but not UCRT)
after 10.4
For the fix to work, it required also some changes on the build machine
(vs_installer, modify VS2019 installation, add Individual Component
"C++ 2019 Redistributable MSMs")
Diffstat (limited to 'win')
-rw-r--r-- | win/packaging/CMakeLists.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt index 280be75c6d7..a7168cbe85d 100644 --- a/win/packaging/CMakeLists.txt +++ b/win/packaging/CMakeLists.txt @@ -189,7 +189,7 @@ IF(MSVC_CRT_TYPE MATCHES "/MD") "$ENV{${ProgramFilesX86}}/Common Files/Merge Modules" "$ENV{ProgramFiles}/Common Files/Merge Modules" ) - ELSEIF(MSVC_VERSION LESS 2000) + ELSEIF(MSVC_VERSION LESS 1920) # VS2017 SET(VCREDIST_MSM_FILENAME Microsoft_VC141_CRT_${WIX_ARCH_SUFFIX}.msm) FILE(GLOB MSM_LIST "C:/Program Files*/Microsoft Visual Studio/2017/*/VC/Redist/MSVC/*/MergeModules/${VCREDIST_MSM_FILENAME}") @@ -198,9 +198,13 @@ IF(MSVC_CRT_TYPE MATCHES "/MD") LIST(GET MSM_LIST 0 VCRedist_MSM) ENDIF() ELSE() - # Post-VS2017. Needs to be ported when new VS is out - MESSAGE(WARNING - "Name of redistributable merge module not known for this version of MSVC") + # VS2019 + SET(VCREDIST_MSM_FILENAME Microsoft_VC142_CRT_${WIX_ARCH_SUFFIX}.msm) + FILE(GLOB MSM_LIST "C:/Program Files*/Microsoft Visual Studio/2019/*/VC/Redist/MSVC/*/MergeModules/${VCREDIST_MSM_FILENAME}") + LIST(LENGTH MSM_LIST LEN) + IF(LEN GREATER 0) + LIST(GET MSM_LIST 0 VCRedist_MSM) + ENDIF() ENDIF() IF (NOT VCRedist_MSM) MESSAGE(WARNING "Can't find merge module ${VCREDIST_MSM_FILENAME}") |