1fix parallel build issue 2 3Build randomly fails since December 2017 on buildroot 4(http://autobuild.buildroot.org/?reason=ecryptfs-utils-111): 5 6make[5]: Entering directory '/home/buildroot/autobuild/instance-2/output-1/build/ecryptfs-utils-111/src/utils' 7 /bin/mkdir -p '/home/buildroot/autobuild/instance-2/output-1/target/sbin' 8 /bin/bash ../../libtool --mode=install /usr/bin/install -c mount.ecryptfs umount.ecryptfs mount.ecryptfs_private '/home/buildroot/autobuild/instance-2/output-1/target/sbin' 9libtool: install: /usr/bin/install -c mount.ecryptfs /home/buildroot/autobuild/instance-2/output-1/target/sbin/mount.ecryptfs 10/usr/bin/install: cannot create regular file '/home/buildroot/autobuild/instance-2/output-1/target/sbin/mount.ecryptfs': File exists 11Makefile:832: recipe for target 'install-rootsbinPROGRAMS' failed 12make[5]: *** [install-rootsbinPROGRAMS] Error 1 13 14As spotted by Thomas Petazzoni, build failure happens because of the 15following line in src/utils/Makefile.am: 16 17install-exec-hook: install-rootsbinPROGRAMS 18 -rm -f "$(DESTDIR)/$(rootsbindir)/umount.ecryptfs_private" 19 $(LN_S) "mount.ecryptfs_private" "$(DESTDIR)/$(rootsbindir)/umount.ecryptfs_private" 20 21The install-exec-hook target should not have a dependency on 22install-rootsbinPROGRAMS. 23 24From https://www.gnu.org/software/automake/manual/html_node/Extending.html#Extending: 25 26""" 27In contrast, some rules also have a way to run another rule, called a 28hook; hooks are always executed after the main rule’s work is done. The 29hook is named after the principal target, with ‘-hook’ appended. The 30targets allowing hooks are install-data, install-exec, uninstall, dist, 31and distcheck. 32 33For instance, here is how to create a hard link to an installed program: 34 35install-exec-hook: 36 ln $(DESTDIR)$(bindir)/program$(EXEEXT) \ 37 $(DESTDIR)$(bindir)/proglink$(EXEEXT) 38 39""" 40 41So, they explicitly say that these hooks are run after the main rule 42work is done, which means the dependency on install-rootsbinPROGRAMS is 43not needed. And the example they use to illustrate is *exactly* the 44situation of ecryptfs-utils: creating a link to a program that was 45installed. 46 47Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 48[Upstream status: https://bugs.launchpad.net/ecryptfs/+bug/1857622] 49 50diff -Nuar ecryptfs-utils-111-orig/src/utils/Makefile.in ecryptfs-utils-111/src/utils/Makefile.in 51--- ecryptfs-utils-111-orig/src/utils/Makefile.in 2019-12-26 15:14:16.656146065 +0100 52+++ ecryptfs-utils-111/src/utils/Makefile.in 2019-12-26 17:36:07.108496164 +0100 53@@ -1522,7 +1522,7 @@ 54 .PRECIOUS: Makefile 55 56 57-install-exec-hook: install-rootsbinPROGRAMS 58+install-exec-hook: 59 -rm -f "$(DESTDIR)/$(rootsbindir)/umount.ecryptfs_private" 60 $(LN_S) "mount.ecryptfs_private" "$(DESTDIR)/$(rootsbindir)/umount.ecryptfs_private" 61 62