arch-dependent Ruby packages with dh_compat 12

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

arch-dependent Ruby packages with dh_compat 12

Cédric Boutillier-6
Dear team,

Has any of you tried to build an arch-dependent Ruby package with
debhelper compatibility level 12?

I tried to update ruby-oj to a new (patchlevel) version, and bumped
debhelper compat to 12, and the build failed with the following message:

┌──────────────────────────────────────────────────────────────────────────────┐
│ dh_ruby --install finished                                                   │
└──────────────────────────────────────────────────────────────────────────────┘

   dh_installdocs -O--buildsystem=ruby
   dh_ruby_fixdocs -O--buildsystem=ruby
   dh_installchangelogs -O--buildsystem=ruby
   dh_installinit -O--buildsystem=ruby
   dh_installsystemduser -O--buildsystem=ruby
   dh_perl -O--buildsystem=ruby
   dh_link -O--buildsystem=ruby
   dh_strip_nondeterminism -O--buildsystem=ruby
   dh_compress -X.rb -O--buildsystem=ruby
   dh_fixperms -O--buildsystem=ruby
   dh_missing -O--buildsystem=ruby
   dh_dwz -O--buildsystem=ruby
dwz: debian/ruby-oj/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/oj/oj.so: Found compressed .debug_aranges section, not attempting dwz compression
dh_dwz: dwz -q -- debian/ruby-oj/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/oj/oj.so returned exit code 1
make: *** [debian/rules:15: binary] Error 1
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2019-07-08T21:30:03Z

(it builds fine with compat level 11)

The dwz step seems new and causes the build to fail. I will investigate
further. In the mean time, I was wondering if someone already
encountered this, and if this should imply some changes for gem2deb if
we want to adapt it for debhelper-compat level 12.

Cheers,

Cédric


signature.asc (499 bytes) Download Attachment
dai
Reply | Threaded
Open this post in threaded view
|

Re: arch-dependent Ruby packages with dh_compat 12

dai
Hi,

On Mon, Jul 08, 2019 at 11:52:14PM +0200, Cédric Boutillier wrote:
> I tried to update ruby-oj to a new (patchlevel) version, and bumped
> debhelper compat to 12, and the build failed with the following message:

> dwz: debian/ruby-oj/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/oj/oj.so: Found compressed .debug_aranges section, not attempting dwz compression
> dh_dwz: dwz -q -- debian/ruby-oj/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/oj/oj.so returned exit code 1

I tried to update ruby-gnome2 with db compat 12 and encountered same issue.

dwz: debian/ruby-glib2/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/glib2.so: Found compressed .debug_aranges section, not attempting dwz compression
dh_dwz: dwz -q -- debian/ruby-glib2/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/glib2.so returned exit code 1

> The dwz step seems new and causes the build to fail. I will investigate
> further. In the mean time, I was wondering if someone already
> encountered this, and if this should imply some changes for gem2deb if
> we want to adapt it for debhelper-compat level 12.

I remove `-Wl,--compress-debug-sections=zlib` from RbConfig::CONFIG['DLDFLAGS'],
it has been built successfully.

I do not know any side effects, but do we need to pass
`--compress-debug-sections=no` to ruby2.5's configure for dh compat 12?

[RFE] Add support for compressed debug sections.
https://bugzilla.redhat.com/show_bug.cgi?id=1394759

Make compressed debug section optional
https://bugs.ruby-lang.org/issues/12934
--
Regards,
        dai

GPG Fingerprint = 0B29 D88E 42E6 B765 B8D8 EA50 7839 619D D439 668E

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: arch-dependent Ruby packages with dh_compat 12

Utkarsh Gupta
Hey, 

On Wed 24 Jul, 2019, 17:21 , <[hidden email]> wrote:
Hi,

On Mon, Jul 08, 2019 at 11:52:14PM +0200, Cédric Boutillier wrote:
> I tried to update ruby-oj to a new (patchlevel) version, and bumped
> debhelper compat to 12, and the build failed with the following message:

> dwz: debian/ruby-oj/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/oj/oj.so: Found compressed .debug_aranges section, not attempting dwz compression
> dh_dwz: dwz -q -- debian/ruby-oj/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/oj/oj.so returned exit code 1

I tried to update ruby-gnome2 with db compat 12 and encountered same issue.

dwz: debian/ruby-glib2/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/glib2.so: Found compressed .debug_aranges section, not attempting dwz compression
dh_dwz: dwz -q -- debian/ruby-glib2/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/glib2.so returned exit code 1

> The dwz step seems new and causes the build to fail. I will investigate
> further. In the mean time, I was wondering if someone already
> encountered this, and if this should imply some changes for gem2deb if
> we want to adapt it for debhelper-compat level 12.

I remove `-Wl,--compress-debug-sections=zlib` from RbConfig::CONFIG['DLDFLAGS'],
it has been built successfully.

I do not know any side effects, but do we need to pass
`--compress-debug-sections=no` to ruby2.5's configure for dh compat 12?

I don't know if that works, but I think disabling that would be a 2-line short patch. 
I have been meaning to do that myself, but didn't get time because of DebConf. 

Hopefully, someone would soon write a patch doing that. 

[RFE] Add support for compressed debug sections.
https://bugzilla.redhat.com/show_bug.cgi?id=1394759

Make compressed debug section optional
https://bugs.ruby-lang.org/issues/12934


Best,
Utkarsh 
dai
Reply | Threaded
Open this post in threaded view
|

Re: arch-dependent Ruby packages with dh_compat 12

dai
Hi,

On Wed, Jul 24, 2019 at 08:43:56PM +0300, Utkarsh Gupta wrote:
> I don't know if that works, but I think disabling that would be a 2-line
> short patch.
> I have been meaning to do that myself, but didn't get time because of
> DebConf.
>
> Hopefully, someone would soon write a patch doing that.

How about this one?

diff --git a/debian/rules b/debian/rules
index 30e0818e..591d80a5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -48,6 +48,9 @@ endif
 configure_options += --enable-ipv6
 configure_options += --with-dbm-type=gdbm_compat
 
+# do not compress debug sections for arch-dep Ruby packages with dh_compat 12
+configure_options += --with-compress-debug-sections=no
+
 # hardening and other standard Debian build flags
 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
 configure_options += $(shell dpkg-buildflags --export=configure)

--
Regards,
        dai

GPG Fingerprint = 0B29 D88E 42E6 B765 B8D8 EA50 7839 619D D439 668E

Reply | Threaded
Open this post in threaded view
|

Re: arch-dependent Ruby packages with dh_compat 12

Utkarsh Gupta
Hey,

On 29/07/19 9:17 am, [hidden email] wrote:

> How about this one?
>
> diff --git a/debian/rules b/debian/rules
> index 30e0818e..591d80a5 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -48,6 +48,9 @@ endif
>  configure_options += --enable-ipv6
>  configure_options += --with-dbm-type=gdbm_compat
>  
> +# do not compress debug sections for arch-dep Ruby packages with dh_compat 12
> +configure_options += --with-compress-debug-sections=no
> +
>  # hardening and other standard Debian build flags
>  export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
>  configure_options += $(shell dpkg-buildflags --export=configure)
Ah! Didn't know about that flag; TIL! :D
However, if that seems to build fine and is also working fine with
"debhelper-compat (=12)" in other packages, then I can't complain ;)


Best,
Utkarsh


signature.asc (849 bytes) Download Attachment
dai
Reply | Threaded
Open this post in threaded view
|

Re: arch-dependent Ruby packages with dh_compat 12

dai
Hi,

On Mon, Jul 29, 2019 at 09:59:07AM +0530, Utkarsh Gupta wrote:
> > +# do not compress debug sections for arch-dep Ruby packages with dh_compat 12
> > +configure_options += --with-compress-debug-sections=no

> Ah! Didn't know about that flag; TIL! :D
> However, if that seems to build fine and is also working fine with
> "debhelper-compat (=12)" in other packages, then I can't complain ;)

I built ruby2.5 with `--with-compress-debug-sections=no`.
Here is rbconfig.rb's wdiff:

@@ -44,7 +44,7 @@
  CONFIG["RUBY_SEARCH_PATH"] = ""
  CONFIG["UNIVERSAL_INTS"] = ""
  CONFIG["UNIVERSAL_ARCHNAMES"] = ""
  CONFIG["configure_args"] = " '--prefix=/usr' '--enable-multiarch' '--target=x86_64-linux-gnu' '--program-suffix=2.5' '--with-soname=ruby-2.5' '--enable-shared' '--disable-rpath' '--with-sitedir=/usr/local/lib/site_ruby' '--with-sitearchdir=/usr/local/lib/x86_64-linux-gnu/site_ruby' '--runstatedir=/var/run' '--localstatedir=/var' '--sysconfdir=/etc' '--enable-ipv6' '--with-dbm-type=gdbm_compat' {+'--with-compress-debug-sections=no'+} 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fdebug-prefix-map=/build/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security' 'FCFLAGS=-g -O2 -fdebug-prefix-map=/build/ruby2.5-2.5.5=. -fstack-protector-strong' 'FFLAGS=-g -O2 -fdebug-prefix-map=/build/ruby2.5-2.5.5=. -fstack-protector-strong' 'GCJFLAGS=-g -O2 -fdebug-prefix-map=/build/ruby2.5-2.5.5=. -fstack-protector-strong' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now' 'OBJCFLAGS=-g -O2 -fdebug-prefix-map=/build/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security' 'OBJCXXFLAGS=-g -O2 -fdebug-prefix-map=/build/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security' 'target_alias=x86_64-linux-gnu'"
  CONFIG["CONFIGURE"] = "configure"
  CONFIG["vendorarchdir"] = "$(rubysitearchprefix)/vendor_ruby/$(ruby_version)"
  CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
@@ -129,7 +129,7 @@
  CONFIG["CCDLFLAGS"] = "-fPIC"
  CONFIG["STATIC"] = ""
  CONFIG["ARCH_FLAG"] = ""
  CONFIG["DLDFLAGS"] = "-Wl,-z,relro [--Wl,-z,now -Wl,--compress-debug-sections=zlib"-] {+-Wl,-z,now"+}
  CONFIG["ALLOCA"] = ""
  CONFIG["dsymutil"] = ""
  CONFIG["codesign"] = ""

I built ruby-gnome2 with this ruby2.5 with `--with-compress-debug-sections=no`,
dh_dwz ran successfully.

I created merge request:
https://salsa.debian.org/ruby-team/ruby/merge_requests/3
--
Regards,
        dai

GPG Fingerprint = 0B29 D88E 42E6 B765 B8D8 EA50 7839 619D D439 668E

Reply | Threaded
Open this post in threaded view
|

Re: arch-dependent Ruby packages with dh_compat 12

Utkarsh Gupta
Hey,

On Mon, Jul 29, 2019 at 7:01 PM <[hidden email]> wrote:
I built ruby-gnome2 with this ruby2.5 with `--with-compress-debug-sections=no`,
dh_dwz ran successfully.

With 3 GB RAM, 18k tests killed my system 4 times while building ruby :/
But yay, everything went well! :D
I could also build Cedric's package, ruby-oj with that patch! :D

And that doesn't break anything either; thank you so much, Daisuke! :D
 
I created merge request:
https://salsa.debian.org/ruby-team/ruby/merge_requests/3

Since Antonio is the maintainer of this package, I would let him do that!
Approved it for now :D

Antonio, could you please merge, test, build and upload the same?



Best,
Utkarsh
Reply | Threaded
Open this post in threaded view
|

Re: arch-dependent Ruby packages with dh_compat 12

Antonio Terceiro-3
On Tue, Jul 30, 2019 at 09:20:01AM +0530, Utkarsh Gupta wrote:

> Hey,
>
> On Mon, Jul 29, 2019 at 7:01 PM <[hidden email]> wrote:
>
> > I built ruby-gnome2 with this ruby2.5 with
> > `--with-compress-debug-sections=no`,
> > dh_dwz ran successfully.
> >
>
> With 3 GB RAM, 18k tests killed my system 4 times while building ruby :/
> But yay, everything went well! :D
> I could also build Cedric's package, ruby-oj with that patch! :D
>
> And that doesn't break anything either; thank you so much, Daisuke! :D
>
>
> > I created merge request:
> > https://salsa.debian.org/ruby-team/ruby/merge_requests/3
> >
>
> Since Antonio is the maintainer of this package, I would let him do that!
> Approved it for now :D
>
> Antonio, could you please merge, test, build and upload the same?
Yeah, I'm building it here and will upload in a bit.

signature.asc (849 bytes) Download Attachment