In CI, we're using gpg bundled with git which suddenly started refusing
the GNUPGHOME directory we've had to create. It does works with relative
paths using forward slash path separators.
Additionally tested using a Windows VM with gpg4win.
If the default home directory ~/.gnupg does not exist, GnuPG creates
this directory and a common.conf file with "use-keyboxd". If the option
use-keyboxd is enabled in common.conf, no keyrings are used at all and
keys are all maintained by the keyboxd process in its own database. This
seemingly includes any keyring specified via the --keyring option and
this breaks our signature verification of dependencies that we download
in our Windows pipelines.
Since v1.3, zlib advertises compatibility with CMake 3.15 which
introduced policy CMP0091 [1]. The NEW behavior is to to leave
the MSVC runtime library selection flags out of the default
CMAKE_<LANG>_FLAGS_<CONFIG> values and instead offer a first-class
abstraction: MSVC_RUNTIME_LIBRARY [2].
CMP0091 is documented to default to the OLD behavior and not warn when
unset. The zlib CMakeLists.txt does not set this policy. However, when
building libfido2 as a static library targeting Win32, linking fails
because our runtime selection flags for zlib have been replaced from
under our feet (the MSVC_RUNTIME_LIBRARY property defaults to the
dynamically linked runtime).
Setting -DCMAKE_POLICY_DEFAULT_CMP0091=OLD [3] on the command line has
no effect and CMake instead warns that the variable has been ignored.
Manually modifying zlib's CMakeLists.txt to set the policy to OLD issues
a deprecation warning but fixes our linking issues.
The only remaining possibility that does not modify external files,
is to explicitly set -DCMAKE_MSVC_RUNTIME_LIBRARY=... [4] on the
command line. Setting it to an empty value does not work (Visual Studio
generators may supposedly also override with _another_ default). Setting
it to one of the allowed values corresponding to the selected build type
resolves our linking issues.
[1] https://cmake.org/cmake/help/latest/policy/CMP0091.html
[2] https://cmake.org/cmake/help/latest/prop_tgt/MSVC_RUNTIME_LIBRARY.html
[3] https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_DEFAULT_CMPNNNN.html
[4] https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html