[DRE-maint] Bug#972702: ruby-bundler: dependency resolution fails for compiled gems

Antonio Terceiro terceiro at debian.org
Thu Oct 29 02:17:55 GMT 2020


On Wed, Oct 28, 2020 at 07:02:06PM -0300, Lucas Kanashiro wrote:
> Thanks to David Rodriguez (our dear bundler upstream maintainer :) I was
> able to workaround the bug locally and understand a bit better what is going
> on.
> 
> The source of this problem is this commit:
> 
> https://github.com/rubygems/rubygems/commit/226ec115fe503bcc93bffdf5cd3e8a668890b4d8
> 
> Quoting David:
> 
> "Anyways, the actual check making bundler believe the ffi gem is missing
> extensions is `File.exist?(gem_build_complete_path)`. I believe the idea of
> this check is that bundler/rubygems are not able to know which artifacts an
> extension will generate, so what rubygems does is generating this dummy file
> at a well known path after a successful extension compilation, so that it
> can later check the existence of this path when it needs to know whether a
> gem is missing extensions."
> 
> There are 2 workarounds to fix this issue:
> 
> 1) Create this dummy file.
> 
> $ mkdir -p /usr/share/rubygems-integration/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.12.2/
> 
> $ touch /usr/share/rubygems-integration/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.12.2/gem.build_complete
> 
> 
> After that 'bundle --local' will find the ffi gem.
> 
> 2) Remove the extension from gemspec.
> 
> $ sed -i.bak -e 3d
> /usr/share/rubygems-integration/2.7.0/specifications/ffi-1.12.2.gemspec
> 
> After removing the header line containing "# stub: ext/ffi_c/extconf.rb",
> 'bundler --local' also works fine and find the ffi gem.
> 
> I think the second approach is what we want, and the proper fix would be to
> not include extensions in our gemspecs. We could try to achieve that via
> gem2deb. Any thoughts?

I think we should diverge less, not more, from upstream. So I would go
for 1).

We already use the Rubygems classes that do builds, but it seems that
this new feature was added around the method we use. I think we should
change gem2deb to include that file, ideally reusing more of the code
from rubygems.

The relevant code is lib/rubygems/ext/builder.rb in rubygems, and
lib/gem2deb/extension_builder.rb in gem2deb.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-ruby-extras-maintainers/attachments/20201028/db6ebb4d/attachment-0001.sig>


More information about the Pkg-ruby-extras-maintainers mailing list