[DRE-maint] Bug#1018217: gem2deb: fails to cross build to i386

Helmut Grohne helmut at subdivi.de
Sat Aug 27 09:37:18 BST 2022


Package: gem2deb
Version: 2.0.3
Tags: patch
User: debian-cross at lists.debian.org
Usertags: ftcbfs
Control: affects -1 + src:ruby-json

Hi Antonio,

many thanks for finalizing the cross build integration. It mostly just
works except for i386. This triplet value is actually two things. It's
"multiarch" (which is what we use for filesystem locations) and it is
the "gnu type" (which is the toolchain prefix). Those are equal almost
everywhere except for i386 (and any-i386) where the multiarch value is
i386-linux-gnu and the gnu triplet has been bumped to i686-linux-gnu.
You happen to apply the multiarch value to the toolchain and that fails.

Here's a patch for your convenience.

Note that we cannot just repurpose the def host_arch for gnu type,
because it actually is used for constructing multiarch paths.

Helmut
-------------- next part --------------
diff --minimal -Nru gem2deb-2.0.3/debian/changelog gem2deb-2.0.3+nmu1/debian/changelog
--- gem2deb-2.0.3/debian/changelog	2022-07-31 01:44:54.000000000 +0200
+++ gem2deb-2.0.3+nmu1/debian/changelog	2022-08-27 10:31:42.000000000 +0200
@@ -1,3 +1,10 @@
+gem2deb (2.0.3+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix cross building to i386. (Closes: #-1)
+
+ -- Helmut Grohne <helmut at subdivi.de>  Sat, 27 Aug 2022 10:31:42 +0200
+
 gem2deb (2.0.3) unstable; urgency=medium
 
   * Gem2Deb::YAML: fix loading more metadata.yml files.
diff --minimal -Nru gem2deb-2.0.3/lib/gem2deb.rb gem2deb-2.0.3+nmu1/lib/gem2deb.rb
--- gem2deb-2.0.3/lib/gem2deb.rb	2022-07-31 01:44:54.000000000 +0200
+++ gem2deb-2.0.3+nmu1/lib/gem2deb.rb	2022-08-27 10:31:42.000000000 +0200
@@ -102,6 +102,10 @@
     @host_arch ||= `dpkg-architecture -qDEB_HOST_MULTIARCH`.strip
   end
 
+  def host_arch_gnu
+    @host_arch_gnu ||= `dpkg-architecture -qDEB_HOST_GNU_TYPE`.strip
+  end
+
   def cross_building?
     build_arch != host_arch
   end
@@ -110,7 +114,7 @@
     @default_compiler ||= {}
     @default_compiler[name] ||=
       if cross_building?
-        "#{host_arch}-#{name}"
+        "#{host_arch_gnu}-#{name}"
       else
         name
       end


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