ueno / ruby-gpgme

a ruby interface to GnuPG Made Easy (GPGME).
GNU Lesser General Public License v2.1
232 stars 99 forks source link

Install error with v2.0.17 #124

Closed hmarr closed 6 years ago

hmarr commented 6 years ago

The latest version of ruby-gpgme is failing to install for us. We're seeing gpg: can't connect to the agent: File name too long while compiling the native libraries, which could be the culprit.

For now, we're working around the issue by installing with --use-system-libraries, but I figured I'd report this anyway as it may affect others. Here are the full logs from the CI build. I've included an excerpt below, too.

Install logs ``` Fetching gpgme 2.0.17 Installing gpgme 2.0.17 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/gpgme-2.0.17/ext/gpgme /usr/bin/ruby2.5 -r ./siteconf20181122-80-kk3jon.rb extconf.rb ************************************************************************ IMPORTANT! gpgme gem uses locally built versions of required C libraries, namely libgpg-error, libassuan, and gpgme. If this is a concern for you and you want to use the system library instead, abort this installation process and reinstall gpgme gem as follows: gem install gpgme -- --use-system-libraries ************************************************************************ Downloading Downloading libgpg-error-1.32.tar.bz2 ( 0%) [SNIP] Downloading Downloading libgpg-error-1.32.tar.bz2 (100%) Extracting libgpg-error-1.32.tar.bz2 into tmp/x86_64-linux-gnu/ports/libgpg-error/1.32... OK Running 'configure' for libgpg-error 1.32... OK Running 'compile' for libgpg-error 1.32... OK Running 'install' for libgpg-error 1.32... OK Activating libgpg-error 1.32 (from /root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/gpgme-2.0.17/ports/x86_64-linux-gnu/libgpg-error/1.32)... Downloading libassuan-2.5.1.tar.bz2 Downloading Downloading libassuan-2.5.1.tar.bz2 ( 2%) Downloading libassuan-2.5.1.tar.bz2 [SNIP] Downloading libassuan-2.5.1.tar.bz2 ( 97%) Downloading libassuan-2.5.1.tar.bz2 Downloading libassuan-2.5.1.tar.bz2 (100%) Extracting libassuan-2.5.1.tar.bz2 into tmp/x86_64-linux-gnu/ports/libassuan/2.5.1... OK Running 'configure' for libassuan 2.5.1... OK Running 'compile' for libassuan 2.5.1... OK Running 'install' for libassuan 2.5.1... OK Activating libassuan 2.5.1 (from /root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/gpgme-2.0.17/ports/x86_64-linux-gnu/libassuan/2.5.1)... Downloading gpgme-1.12.0.tar.bz2 ( 11%) [SNIP] Downloading gpgme-1.12.0.tar.bz2 (100%) Extracting gpgme-1.12.0.tar.bz2 into tmp/x86_64-linux-gnu/ports/gpgme/1.12.0... OK Running 'configure' for gpgme 1.12.0... OK Running 'compile' for gpgme 1.12.0... ERROR, review '/root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/gpgme-2.0.17/ext/gpgme/tmp/x86_64-linux-gnu/ports/gpgme/1.12.0/compile.log' to see what happened. Last lines are: ======================================================================== gpg: key 47AF4B6961F04784: public key "Victor Test (demo key) " imported gpg: can't connect to the agent: File name too long gpg: key DEF0F7B8EC67DBDE: public key "Whisky Test (demo key) " imported gpg: can't connect to the agent: File name too long gpg: key 8979A6C5567FB34A: public key "XRay Test (demo key) " imported gpg: can't connect to the agent: File name too long gpg: key 9EEF34CD4B11B25F: public key "Yankee Test (demo key) " imported gpg: can't connect to the agent: File name too long gpg: key 6BC4778054ACD246: public key "Zulu Test (demo key) " imported gpg: can't connect to the agent: File name too long gpg: Total number processed: 26 gpg: imported: 26 Makefile:1107: recipe for target 'pubring-stamp' failed make[2]: *** [pubring-stamp] Error 2 make[2]: Leaving directory '/root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/gpgme-2.0.17/ext/gpgme/tmp/x86_64-linux-gnu/ports/gpgme/1.12.0/gpgme-1.12.0/tests/gpg' Makefile:694: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/gpgme-2.0.17/ext/gpgme/tmp/x86_64-linux-gnu/ports/gpgme/1.12.0/gpgme-1.12.0/tests' Makefile:520: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 ======================================================================== *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/$(RUBY_BASE_NAME)2.5 --clean --use-system-libraries /root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:402:in `block in execute': Failed to complete compile task (RuntimeError) from /root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:373:in `chdir' from /root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:373:in `execute' from /root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:115:in `compile' from /root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:154:in `cook' from extconf.rb:126:in `block in
' from extconf.rb:105:in `tap' from extconf.rb:105:in `
' extconf failed, exit code 1 Gem files will remain installed in /root/dependabot-core/vendor/bundle/ruby/2.5.0/gems/gpgme-2.0.17 for inspection. Results logged to /root/dependabot-core/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/gpgme-2.0.17/gem_make.out An error occurred while installing gpgme (2.0.17), and Bundler cannot continue. Make sure that `gem install gpgme -v '2.0.17' --source 'https://rubygems.org/'` succeeds before bundling. ```
dansketcher commented 6 years ago

Hey @hmarr thanks for the report - what arch are you building/CI on?

hmarr commented 6 years ago

I've seen this both on my Mac (darwin x86_64) and in an Ubuntu Docker container (linux x86_64).

dansketcher commented 6 years ago

I just ran through clean installs on Darwin for Ruby 2.3.3, 2.4.5, 2.5.0, and 2.5.3, and all installed cleanly. Hate that :(

hmarr commented 6 years ago

Gah, that's frustrating. I'll see if I can get a more minimal reproduction of it.

dansketcher commented 6 years ago

There's a new PR #125 that removes some tests, I'll have a look at that

hmarr commented 6 years ago

Ah, great - that looks hopeful!

dansketcher commented 6 years ago

Hey @hmarr what version of gpg are you running out of interest?

hmarr commented 6 years ago

I've used both 2.2.4 and 2.2.10. I haven't tried with 1.x, though.

dansketcher commented 6 years ago

Ah. I run 1.4 because of the gpg-agent stuff. Version bump incoming

hmarr commented 6 years ago

Thanks for jumping on this so quickly 🙌

dbussink commented 6 years ago

There's a new PR #125 that removes some tests, I'll have a look at that

@dansketcher @hmarr Yeah, I wrote that PR to specifically address this issue :smile:.

dansketcher commented 6 years ago

https://rubygems.org/gems/gpgme/versions/2.0.18

dansketcher commented 6 years ago

@dbussink are you also on GPG 2.x?

hmarr commented 6 years ago

I reran a CI build that was failing with v2.0.17 and it's now successfully getting past the bundle install phase with v2.0.18 so it looks like this has done the job.

Thanks again @dansketcher and @dbussink!

dansketcher commented 6 years ago

Thanks @hmarr for the report, and @dbussink for the PR 💯

dbussink commented 6 years ago

@dbussink are you also on GPG 2.x?

Confirming for posterity that I also use 2.x.