0003-fix-parallel-build-issue.patch 2.8 KB

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