-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with building on Windows #14
Comments
Thanks for the report. I've never tried compiling this on windows. So I suspect you are paving the way. Couple of things, Second, off_t is part of the posix C std. So it's probably missing in windows? I suspect gpgme defines its own in windows for this reason. Happy with that patch, but there're a couple of other usages of off_t that should probably get converted too. It might require a little C wrapper if CGO complains too much. I'm happy to test any patches on my end |
Seems like that is the only instance of off_t preventing me from compiling it, which is quite weird. But for now, I also was compiling against the gpgme v1.6.1 which is included with msys2, not against the version shipped with the GPG 2.1 installer (which I guess might be around 1.9). |
I don't think CGO knows about typedefs in C. I pushed a quick little patch so it can compile in both windows and linux/osx. https://github.com/proglottis/gpgme/tree/windows_data_seek |
I'll try that once my libraries finish compiling :) On the
|
just as a quick feedback: your patch seems to compile fine for me |
Okay, just got it to compile against the official downloadable GnuPG binaries (>2.1). I am using vanilla MinGW now, that requires an additional change in go_gpgme.h:
Compiling can be done with this batch file - documenting this here in case anyone else wants to do this:
|
in case my change does not make real sense for you, here is the original error message:
|
Sorry, that must have been some old version I had checked out in-between. Did a clean checkout on another PC and everything works.. :) |
Okay, There are still some tests that are failing and I'm not really sure what's happening there. It would be great if you could have a look. |
Hey that's really cool! I didn't think any of those CI places would let me have gpgme. Could be coincidence but both those tests are using temp dir/file. I wonder if CI is a bit unhappy about that. The only other test to use tmp is AssuanSend but it doesn't make GPG write to it |
I guess you'll be getting a pull request that runs the tests on windows with appveyor and on linux with travis from me ;) As for the failing tests: that reflects what I'm getting locally, so it doesn't seem to be a CI thing. Even worse, the TestContext_Import sometimes just hangs until I manually quit it. |
Hi, I also try to use this library under Windows. I am a newbie in programing with go, so perhaps my question is silly ;-) could not determine kind of name for C.unsetenv Should be the library useable under Windows? Is this still a problem? I am missing something? |
just replace the C.unsetenv(v) in gpgme.go with C.putenv(v) - on MinGW, unsetenv is not available. PS: oh, and v has to be see the part about unsetenv in https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Function-Portability.html |
Hi there,
I'm trying to use this library on Windows using the msys2 mingw64.
First of all: if you want to try this yourself, you have to install the mingw gpgme library using
pacman -S mingw-w64-x86_64-gpgme
and you have to do so in the mingw64 environment.Now the problems:
For one, it complains when building the
unsetenvGPGAgentInfo
function:when I just comment this line out (as I understand the comment, it is just used for testing?), I get this error:
changing the offending line to
n, err := C.gpgme_data_seek(d.dh, C.gpgme_off_t(offset), C.int(whence))
let's me compile everything.
I still haven't come around to really using the library yet, that will be my next step. I just thought I'd report what I've encountered so far.
Thanks for the wrapper, it's really appreciated.
The text was updated successfully, but these errors were encountered: