The post-build custom command to embed Vista elevation manifest into
mariadb-upgrade-wizard.exe seems to do
something nasty to the executable, perhaps it removes and recreates it.
Thus the previously created hardlink mysql_upgrade_wizard is not marked
to require elevation.
Solved by using MANIFESTUAC linker flag, rather than invoke mt.exe.
This avoids an extra post-build step that modifies mariadb-upgrade-wizard.exe
when checking for free port, use the same logic (IPv6 socket address
/ dual socket), like the server would.
Previous solution for testing whether port is free was trying to bind
IPv4 socket on INADDR_ANY.
This not work now on some reason, that attempt succeeds, even if there is
an existing IPv6-dual socket listening on 0.0.0.0:3306
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")
In main.index_merge_myisam we remove the test that was added in
commit a2d24def8c because
it duplicates the test case that was added in
commit 5af12e4635.
CMake parameter
This includes compiler-specific dependencies
- tiny part of CRT, mostly memcpy/memset in msvcr140.dll
- exception handling in msvc140_1.dll
- C++ standard library in msvcp140
not much else
CMake is smart enough to copy the dependencies into the bin directory
itself.