gpg-rs / gpgme

GPGme bindings for Rust
GNU Lesser General Public License v2.1
83 stars 13 forks source link

Windows Support #31

Open johnschug opened 4 years ago

johnschug commented 4 years ago

There is now preliminary support for building on windows with some limitations. The build script will automatically detect an installed version of Gpg4win/GnuPG via the registry and attempt to use the provided libraries. However, the Gpg4win project only provides 32-bit versions of those libraries, requiring any rust project that wishes to use them to use the i686-pc-windows-gnu target. There is a windows dockerfile demonstrating the necessary setup.

It should also be possible to use alternative builds of the libraries (e.g., msys maybe) by setting the appropriate environment variables as specified in the README. However static linking with the upstream gpgme library is not supported as it needs to be built and installed alongside the gpg executable.

NOTE: For whatever reason, the gnupg installer does not seem to work correctly on github's CI runners, either it hangs or it silently doesn't install anything.

NOTE 2: When running the test suite on windows the tests may crash with a STATUS_ACCESS_VIOLATION (probably a bug in gpgme). Setting the GPGME_DEBUG environment variable (e.g., $env:GPGME_DEBUG=9 in powershell) before running the tests seems to prevent this.