Package: debhelper
Version: 13.2
Severity: normal

Hello,

Since debhelper compat 10, "The dh command will no longer use log files
to track which commands have been run.  The dh command still keeps track
of whether it already ran the "build" sequence and skip it if it did."

How does it keep track now? In some file or only live? Is there a way to
get back to a file-tracking? Only by creating timestamps ourself?

My concern is that it seems to be thus running ./configure each time
I invoke dpkg-buildpackage, and thus the packaging system basically
rebuilds everything. The problem comes when there is a build failure at
some point, and I want to run dpkg-buildpackage -nc to resume building
the package after fixing the build failureĀ ; since ./configure is
invoked again, the build system rebuilds everything! This can be
extremely time-consuming for very big packages, basically making
debhelper compat 10 unusable for packages with big build time.

I have attached a test case:


$ dpkg-buildpackage -b
[...]
   dh_auto_configure -O--no-parallel
        ./configure --build=x86_64-linux-gnu --prefix=/usr [...]
[...]
   dh_auto_build -O--no-parallel
[...]
sleep 2s
touch build
false
make[1]: *** [Makefile:7: build2] Error 1


$ dpkg-buildpackage -b -nc
[...]
   dh_auto_configure -O--no-parallel
        ./configure --build=x86_64-linux-gnu --prefix=/usr [...]
[...]
sleep 2s
touch build
false
make[1]: *** [Makefile:7: build2] Error 1


where "sleep 2s" represents the long build time before the actual build
failure. Because ./configure is run again, the Makefile is regenerated
and the build runs from start again.

Run again with 10 put in debian/compat:


$ dpkg-buildpackage -b
[...]
   dh_auto_configure -O--no-parallel
        ./configure --build=x86_64-linux-gnu --prefix=/usr [...]
[...]
   dh_auto_build -O--no-parallel
[...]
sleep 2s
touch build
false
make[1]: *** [Makefile:7: build2] Error 1


$ dpkg-buildpackage -b -nc
[...]
[ no dh_auto_configure ]
[...]
[ no sleep 2s ]
false
make[1]: *** [Makefile:7: build2] Error 1


We directly get to the build point we were at previously.


Yes, ideally upstream's ./configure would be idempotent and be cautious
with timestamps of identically-generated files, and thus not actually
trigger a rebuild, but I believe it's far from being a general case
for upstream source, and getting this "rebuild-from-start" behavior by
default is painful.

I for instance got hit by this while fixing build issues of the samba
package, the complete rebuild helped warming up my room.

Note: in the particular example case shown above it is the dh_auto_build
step that fails. We could run make to re-run the build without being
afraid of a spurious ./configure, and be fine. But when the build
failure is within some dh_install step or such, we fall down again in
the same issue. In the example demo-1.0, replace false with true in
configure, and the problem will hit again the same with the dh_install
issue introduced in debian/rules.

Samuel

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (500, 
'proposed-updates'), (500, 'oldoldstable'), (500, 'buildd-unstable'), (500, 
'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental-debug'), 
(1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.7.0-1-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages debhelper depends on:
ii  autotools-dev            20180224.1
ii  dh-autoreconf            19
ii  dh-strip-nondeterminism  1.9.0-1
ii  dpkg                     1.19.7
ii  dpkg-dev                 1.19.7
ii  dwz                      0.13-5
ii  file                     1:5.38-5
ii  libdebhelper-perl        13.2
ii  libdpkg-perl             1.19.7
ii  man-db                   2.9.3-2
ii  perl                     5.30.3-4
ii  po-debconf               1.0.21

debhelper recommends no packages.

Versions of packages debhelper suggests:
ii  dh-make  2.202001

-- no debconf information

Attachment: demo-1.0.tgz
Description: application/gtar-compressed

Reply via email to