Re: Using dh causes configure to be run twice?

2019-07-10 Thread Colin Watson
On Wed, Jul 10, 2019 at 01:16:03AM -0400, Theodore Ts'o wrote:
> I tried to see how other packages work around this misfeature, and I
> see that openssh just hacks things to make the second
> dh_auto_configure a no-op:
> 
> override_dh_auto_configure-arch:
>   dh_auto_configure -Bdebian/build-deb -- $(confflags)
> ifeq ($(filter noudeb,$(DEB_BUILD_PROFILES)),)
>   dh_auto_configure -Bdebian/build-udeb -- $(confflags_udeb)
>   # Avoid libnsl linkage. Ugh.
>   perl -pi -e 's/ +-lnsl//' debian/build-udeb/config.status
>   cd debian/build-udeb && ./config.status
> endif
> 
> override_dh_auto_configure-indep:
> 
> RLY?

You've misread this, I'm afraid.  The point of the *-indep overrides in
openssh is to avoid doing unnecessary work in
architecture-independent-only builds, not to avoid duplicate configure
steps.  openssh has some Architecture: all binary packages, which
Debian's autobuilders build on separate builders that do the rough
equivalent of "sbuild --arch-all --no-arch-any", so a small amount of
time optimising this was worthwhile.

This is unrelated to the problem you're running into.

Proof: I introduced this change in
https://salsa.debian.org/ssh-team/openssh/commit/c1f965684b54bed51e8cb1e7a2f3d2003d64d341.
Aside from its commit message, you can also look at build logs from
before and after this change:

  
https://buildd.debian.org/status/fetch.php?pkg=openssh=i386=1%3A6.9p1-2=1441886711=0
  
https://buildd.debian.org/status/fetch.php?pkg=openssh=i386=1%3A6.9p1-3=1448408594=0

Both before and after this change, you can see that there's only one
dh_auto_configure pass (two actual configure runs, but that's because
there's one for deb and one for udeb).  I only started doing source-only
uploads with 1:6.9p1-3, so you can't easily see what it would have
looked like beforehand, but you can see that
https://buildd.debian.org/status/fetch.php?pkg=openssh=all=1%3A6.9p1-3=1448408071=0
is nice and short once it gets past installing build-dependencies.

-- 
Colin Watson   [cjwat...@debian.org]



Re: Using dh causes configure to be run twice?

2019-07-10 Thread Simon McVittie
On Wed, 10 Jul 2019 at 01:16:03 -0400, Theodore Ts'o wrote:
> In my attempt to convert e2fsprfogs's debian/rules to use dh, I'm
> running into yet another frustration with dh, which is that it insists
> on running the configure script twice.

This has not been my experience with other Autotools packages. dbus is
my usual example of a relatively complicated Autotools build, and it
only enters 'debian/rules override_dh_auto_configure' once (which as it
happens runs configure three times - for normal, debug and udeb builds -
but that's deliberate and dbus-specific).

  % dh build --no-act
   dh_testdir
   dh_update_autotools_config
   debian/rules override_dh_autoreconf
   debian/rules override_dh_auto_configure
   debian/rules override_dh_auto_build
   debian/rules override_dh_auto_test-arch
   debian/rules override_dh_auto_test-indep
   create-stamp debian/debhelper-build-stamp

I don't think we had that problem with glib2.0 either, although glib2.0
in stretch is old enough that it's still using cdbs, while glib2.0 in
buster is new enough that it has switched from Autotools to Meson, so I
don't have any buildd logs to provide evidence of that.

Perhaps you could share your latest version of d/rules somewhere?

> The problem is that dh is trying to use build-arch and build-indep:
> 
> % dh build --no-act
>debian/rules build-arch
>debian/rules build-indep

dbus doesn't explicitly define build, build-arch or build-indep targets,
it leaves that to dh's "%" rule. Does e2fsprogs perhaps explicitly define
those targets?

smcv



Using dh causes configure to be run twice?

2019-07-09 Thread Theodore Ts'o
In my attempt to convert e2fsprfogs's debian/rules to use dh, I'm
running into yet another frustration with dh, which is that it insists
on running the configure script twice.

The problem is that dh is trying to use build-arch and build-indep:

% dh build --no-act
   debian/rules build-arch
   debian/rules build-indep

And build-arch and build-indep both want to run configure:

% dh build-arch --no-act
   dh_testdir -a
   dh_update_autotools_config -a
   debian/rules override_dh_auto_configure
   debian/rules override_dh_auto_build
   create-stamp debian/debhelper-build-stamp

% dh build-indep --no-act
   dh_testdir -i
   dh_update_autotools_config -i
   debian/rules override_dh_auto_configure
   debian/rules override_dh_auto_build
   create-stamp debian/debhelper-build-stamp

This seems amazingly non-optimal.

I tried to see how other packages work around this misfeature, and I
see that openssh just hacks things to make the second
dh_auto_configure a no-op:

override_dh_auto_configure-arch:
dh_auto_configure -Bdebian/build-deb -- $(confflags)
ifeq ($(filter noudeb,$(DEB_BUILD_PROFILES)),)
dh_auto_configure -Bdebian/build-udeb -- $(confflags_udeb)
# Avoid libnsl linkage. Ugh.
perl -pi -e 's/ +-lnsl//' debian/build-udeb/config.status
cd debian/build-udeb && ./config.status
endif

override_dh_auto_configure-indep:

RLY?

That seems like an amazing hack.  Is there no other way to work around
what appears to be massive mis-design in dh?

If the goal is to make moving to dh a mandate, and working on Debian
to be fun, we desperately need better documentation on how to use dh
for real-world packages, and not just simple, trivial packages   :-(

  - Ted