[DRE-maint] Bug#982887: libruby2.7: separate rbconfig.rb for cross building

Nilesh Patra nilesh at debian.org
Sat Jul 9 20:09:11 BST 2022


Hi Antonio / Ruby Team,

You had a patch ready for this here[1] (before bullseye) or somewhere else, right?
If possible could you make an upload?
This would help ruby ext cross build, which would be pretty cool.


[1]: https://salsa.debian.org/ruby-team/ruby-defaults/-/tree/crossbuild

On Mon, 15 Feb 2021 21:20:23 +0100 Helmut Grohne <helmut at subdivi.de> wrote:
> Package: libruby2.7
> Version: 2.7.2-4
> User: debian-cross at lists.debian.org
> Usertags: ftcbfs
> Control: affects -1 + src:ruby-json
> 
> ruby-json (and many others) fail to cross build from source in the same
> way. dh_ruby runs ruby ... extconf.rb, which configures for the build
> architecture and then some dependency (usually ruby/config.h) goes
> missing as it is only installed for the host architecture.
> 
> As far as I can tell, the root cause is the extconf.rb invocation. For
> cross compiling, one should pass -I /somepath to ruby such that
> /somepath contains the host's rbconfig.rb. Unfortunately, we cannot just
> pass -I /usr/lib/<triplet>/ruby/2.7.0 here, because doing so results in
> ruby attempting to load foreign extension modules. We need a different
> path here.
> 
> Let me give a little excursion into other ecosystems to give you a
> better idea what is needed here:
> 
> Perl has a file that is similar to rbconfig.rb and it is simply called
> Config.pm. It normally resides in /usr/lib/x86_64-linux-gnu/perl-base.
> Using this path would have the same issue. Therefore, there also is
> /usr/lib/x86_64-linux-gnu/perl/5.32.1 containing a symlink.
> 
> Python has a similar file _sysconfigdata.py. Rather than disambiguating
> the containing directory, Python renames it and arrives at things like
> _sysconfigdata__x86_64-linux-gnu.py. Rather than specifying a directory
> to to search for modules, a separate environment variable can specify
> its location.
> 
> The Ruby way is like Perl. I suggest copying this approach. To that end,
> I request that ruby2.7-dev adds a new, architecture-dependent directory
> that contains a symlink to the matching rbconfig.rb. Then dh_ruby can
> pass that directory via -I and things should work.
> 
> Does that sound good to you? Do you have any preference on the naming?
> 
> No, this is not meant for bullseye.
> 
> Helmut
> 
> 
> 

-- 
Best,
Nilesh
-------------- 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/20220710/8491a208/attachment.sig>


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