https://github.com/ueno/ruby-gpgme/pull/166 changed from pkg-config to gpgme-config, but if --use-system-libraries is used and PKG_CONFIG_PATH is set properly, you get this error:
[root@ece815d6fed2 tmp]# pkg-config --libs gpgme
Package gpgme was not found in the pkg-config search path.
Perhaps you should add the directory containing `gpgme.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gpgme', required by 'virtual:world', not found
https://github.com/ueno/ruby-gpgme/pull/166 changed from
pkg-config
togpgme-config
, but if--use-system-libraries
is used andPKG_CONFIG_PATH
is set properly, you get this error:The following line quietly ignores this error and includes an empty string: https://github.com/ueno/ruby-gpgme/blob/b53405ee0581661e97a3bd3fefe5f2a244b53ec0/ext/gpgme/extconf.rb#L46
This effectively causes the linker flags to omit
-lgpgme
, which causes symbol resolution errors:Originally detected in https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/7345.
Nokogiri avoids this failure mode by checking the existence of the
.pc
file in https://github.com/sparklemotion/nokogiri/blob/685a940678a8b15501f997a70693cc5e2d7008c7/ext/nokogiri/extconf.rb#L244-L259:I think we need to do something like that and fallback to
gpgme-config
otherwise.