Oh my, I didn't expect that.

Turns out "dh_ruby test" doesn't do anything... Oh my.
I updated the patch to compensate. It works now for both the full build (in
pbuilder) and with nocheck (and qunit-selenium not getting installed).

Cheers,
Sven

Am Mi., 2. Dez. 2020 um 00:09 Uhr schrieb Antonio Terceiro <
terce...@debian.org>:

> On Mon, Nov 09, 2020 at 03:40:15PM +0100, Sven Mueller wrote:
> > Package: rails
> > Version: 2:6.0.3.4+dfsg-1
> > Tags: patch
> >
> > Turns out that this isn't needed and pulls in a lot of dependencies if
> the
> > build is done without tests.
> >
> > The attached patch moves the start of the redis server (only needed for
> > tests) inside the override_dh_auto_test section in debian/rules (I
> suspect
> > that the redis server was also only pulled in via the qunit-selenium
> > dependency? - without this move, the resulting build failed). The
> > dependency on qunit-selenium is marked as <!nocheck> so it is now only
> > pulled in if tests are enabled.
> >
> > Please consider merging this. The change is trivial and I don't believe
> it
> > would create any copyright concerns, but just in case a license would
> > actually be required, I license this under the Expat license or CC-BY 3.0
> > or CC-BY-SA-4.0, the choice of license is left to the receiver of the
> > license and should  be fully compatible with the Debian packaging as well
> > as upstream (though this only affects the packaging, so I doubt they
> care).
>
> > diff --git a/debian/control b/debian/control
> > index 59d14bfe..3d067e13 100644
> > --- a/debian/control
> > +++ b/debian/control
> > @@ -18,7 +18,7 @@ Build-Depends: debhelper-compat (= 12),
> >                 ruby-byebug,
> >  # Ruby packages - from Gemfile
> >                 puma (>= 4.1~),
> > -               qunit-selenium,
> > +               qunit-selenium <!nocheck>,
> >                 racc (>= 1.4.6),
> >                 rake (>= 11.1),
> >                 ruby-bcrypt (<< 3.2),
> > diff --git a/debian/rules b/debian/rules
> > index d3747fee..41bfe45a 100755
> > --- a/debian/rules
> > +++ b/debian/rules
> > @@ -20,17 +20,17 @@ override_dh_clean:
> >       debian/stop-redis-server.sh || true
> >
> >  override_dh_auto_install:
> > -     # start redis server for tests
> > -     debian/start-redis-server.sh
> >       # auto install
> >       dh_auto_install -O--buildsystem=ruby
> > -     # kill redis server used for tests
> > -     debian/stop-redis-server.sh
> >       $(RM) debian/ruby-activesupport/usr/bin/generate_tables
> >       $(RM) debian/*/usr/bin/test
> >       rmdir debian/*/usr/bin || true
> >
> >  override_dh_auto_test:
> >  ifeq ($(filter nocheck,$(DEB_BUILD_PROFILES)),)
> > +     # start redis server for tests
> > +     debian/start-redis-server.sh
> >       dh_auto_test
> > +     # kill redis server used for tests
> > +     debian/stop-redis-server.sh
> >  endif
>
> Did you test this on a full build? gem2deb has a limitation/bug that
> causes the tests to be executed during the install target, and not the
> test one.
>
Description: Allow build with "nocheck" build profile to skip selenium dep
 Selenium is only needed to run tests, so only depend on it when the "nocheck"
 build profile is NOT given. To allow this, move the - anyhow testing only -
 start of redis server start into override_dh_auto_test.
Author: Sven Mueller <s...@google.com>
Bug-Debian: https://bugs.debian.org/974065
Last-Update: 2020-12-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: rails-6.0.3.4+dfsg/debian/control
===================================================================
--- rails-6.0.3.4+dfsg.orig/debian/control
+++ rails-6.0.3.4+dfsg/debian/control
@@ -18,7 +18,7 @@ Build-Depends: debhelper-compat (= 12),
                ruby-byebug,
 # Ruby packages - from Gemfile
                puma (>= 4.1~),
-               qunit-selenium,
+               qunit-selenium <!nocheck>,
                racc (>= 1.4.6),
                rake (>= 11.1),
                ruby-bcrypt (<< 3.2),
Index: rails-6.0.3.4+dfsg/debian/rules
===================================================================
--- rails-6.0.3.4+dfsg.orig/debian/rules
+++ rails-6.0.3.4+dfsg/debian/rules
@@ -20,12 +20,16 @@ override_dh_clean:
 	debian/stop-redis-server.sh || true
 	
 override_dh_auto_install:
-	# start redis server for tests
+ifeq ($(filter nocheck,$(DEB_BUILD_PROFILES)),)
+	# start redis server for tests (gem2deb runs test during install)
 	debian/start-redis-server.sh
+endif
 	# auto install
 	dh_auto_install -O--buildsystem=ruby
+ifeq ($(filter nocheck,$(DEB_BUILD_PROFILES)),)
 	# kill redis server used for tests
 	debian/stop-redis-server.sh	
+endif
 	$(RM) debian/ruby-activesupport/usr/bin/generate_tables
 	$(RM) debian/*/usr/bin/test
 	rmdir debian/*/usr/bin || true

Reply via email to