You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more or less a FYI, I can’t think of a good fix at the level of this package:
Before GPGME 1.8.0, the default library was not thread-safe; instead of locking data structures, there was basically only an assertion (sanity check) that there is no concurrent user of the data. The users had to explicitly opt in to a thread-safe library, by using the
gpgme-config --thread=pthread --libs --cflags
instead of
gpgme-config --libs --cflags
to get the right flags; in practice (at least on recent Fedora-based systems), this amounts to using -lgpgme-pthread instead of -lgpgme.
Given how Go encourages multi-threading, this should basically be done all the time, for the pre-1.8.0 versions.
Unfortunately, more recent versions of GPGME don’t provide the gpgme-pthread library, so we can’t just change the hard-coded library name, that would break everyone using recent versions.
All the discussions about possible fixes from #6 apply similarly here: a simple go build can’t do this automatically. We could, possibly, add a build tag to let the user have a choice (requiring the final top-level executable to know about that build tag), but it’s even worse than #6 in that for #6, a user that doesn’t need the new symbols can just always use the old-symbol version without any environment-dependent logic. In this case, the decision is based not on how the gpgme bindings are used, but on the surrounding environment, so every single top-level caller needs infrastructure to correctly choose the right binding.
Given that GPGME 1.8.0 is over 3 years old at this point, I’m not at all sure how much it is worth building any kind of infrastructure (build tags, detection scripts) for helping support this.
Note to self: CGo does not work with build tags the usual way, one file per build tag choice (in that case the build tags are ignored and all LDFLAGS directives are concatenated, even from build-tag-deactivated .go files).
This is more or less a FYI, I can’t think of a good fix at the level of this package:
Before GPGME 1.8.0, the default library was not thread-safe; instead of locking data structures, there was basically only an assertion (sanity check) that there is no concurrent user of the data. The users had to explicitly opt in to a thread-safe library, by using the
instead of
to get the right flags; in practice (at least on recent Fedora-based systems), this amounts to using
-lgpgme-pthread
instead of-lgpgme
.Given how Go encourages multi-threading, this should basically be done all the time, for the pre-1.8.0 versions.
Unfortunately, more recent versions of GPGME don’t provide the
gpgme-pthread
library, so we can’t just change the hard-coded library name, that would break everyone using recent versions.All the discussions about possible fixes from #6 apply similarly here: a simple
go build
can’t do this automatically. We could, possibly, add a build tag to let the user have a choice (requiring the final top-level executable to know about that build tag), but it’s even worse than #6 in that for #6, a user that doesn’t need the new symbols can just always use the old-symbol version without any environment-dependent logic. In this case, the decision is based not on how thegpgme
bindings are used, but on the surrounding environment, so every single top-level caller needs infrastructure to correctly choose the right binding.Given that GPGME 1.8.0 is over 3 years old at this point, I’m not at all sure how much it is worth building any kind of infrastructure (build tags, detection scripts) for helping support this.
Thanks to Ulrich Obergfell uobergfe@redhat.com for diagnosing this.
The text was updated successfully, but these errors were encountered: