Package: odpic
Version: 26.0.0-1
Severity: normal
Tags: patch

Dear maintainer,

odpic 26.0.0-1 fails to build from source on armhf in Ubuntu's build
farm (the same source built fine on Debian's buildd). The failure is a race
in
"make install" under parallel make:

  make[2]: *** No rule to make target
'/<<PKGBUILDDIR>>/debian/tmp/usr/share/odpi',
  needed by 'install'.  Stop.
  dh_auto_install: error: make -j8 install DESTDIR=... PREFIX=/usr returned
exit code 2

The "install" target lists $(INSTALL_SHARE_DIR) (via INSTALL_TARGETS),
but the Makefile has no rule to create that directory. It only exists
as a side effect of the mkdir -p rules for the samples/sql and
test/sql subdirectories. With make -j, make can look at the parent
directory before those rules have run, and then fails because the
file doesn't exist and has no rule. Whether this happens depends on
scheduling. Debian's own armhf build log of 26.0.0-1 used the same
setup (DEB_BUILD_OPTIONS=parallel=8, make -j8 install, armhf chroot on
an arm64 host) and passed only because the two mkdir -p commands
happened to run before make looked at usr/share/odpi. In Ubuntu's build
that order was different, and retrying the build five times failed each
time on armhf.

A simple workaround in debian/rules is to install serially:

 override_dh_auto_install:
- dh_auto_install -- PREFIX=/usr
+ dh_auto_install --no-parallel -- PREFIX=/usr

With that change the build passes on armhf in an Ubuntu PPA.

A cleaner fix would be upstream: add a rule that creates the directory
and make it an order-only prerequisite of the install targets, e.g.

 $(INSTALL_SHARE_DIR):
  mkdir -p $@
 $(INSTALL_SHARE_DIR)/%: % | $(INSTALL_SHARE_DIR)
  ...

Thanks,
Sebastien Bacher

Reply via email to