[DRE-maint] Bug#1019397: gem2deb: fails to cross build with gem_installer.rb

Helmut Grohne helmut at subdivi.de
Thu Sep 8 17:32:52 BST 2022


Package: gem2deb
Version: 2.0.3
User: debian-cross at lists.debian.org
Usertags: ftcbfs
Control: affects -1 + src:ruby-oj
X-Debbugs-Cc: debian-cross at lists.debian.org

Hi Antonio,

thank you for the past work in making ruby and gem2deb support cross
building. I happen to have found another issue. Again, I believe it to
be of generic nature rather than specific to a particular extension
package. An example package is ruby-oj:

https://crossqa.debian.net/build/ruby-oj_3.13.21-1_ppc64el_20220830150857.log

As a first observation, I note that the build log looks much different
from the extensions that built successfully after your changes. A common
theme among the succeeding ones is this:

    /usr/bin/ruby3.0 /usr/lib/ruby/vendor_ruby/gem2deb/extension_builder.rb ...

Notably, that's not found in ruby-oj. Instead, I see this:

    /usr/bin/ruby3.0 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/ruby-oj/usr/lib/x86_64-linux-gnu/rubygems-integration/3.0.0 /tmp/d20220907-2098396-1rsfxr/oj-3.13.21.gem

As far as I understand this, we have multiple extension build systems
for ruby. The former one has been fixed, but the one in
"gem_installer.rb" hasn't.

That leads to the question of what actually is wrong. One relatively
obvious thing to be wrong (once you know that my host architecture was
armel) is the x86-64-linux-gnu part in there. It comes from
lib/gem2deb/gem_installer.rb and is computed by
rubygems_integration_target. There ist uses RbConfig::CONFIG['arch'],
which presumably uses the build architectures rbconfig.rb rather than
the host architecture one. Do you happen to know how to fix this aspect?

However this is not what ultimately made the build fail. Later, we are
instructed to check mkmf.log to see the actual failure. Unfortunately,
mkmf.log is not part of the build log. Another build with keeping the
build tree later, one can see that it used the build architecture
compiler, which happened to fail to find the host architecture ruby
header. Again, this seems to be rooted in using the wrong rbconfig.rb.
I suppose that RUBYLIB is not augmented in the right way for running gem
install in gem_installer.rb. Does that make sense to you?

I'd appreciate a response indicating whether I'm looking in the right
direction.

Thanks in advance

Helmut



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