0

I am using debuild to build my debian packages. When building one of them (which contains quite a lot of php files), I get the following error:

   dh_installdocs
   dh_installchangelogs
   dh_perl
   dh_link
   dh_compress
   dh_fixperms
   dh_installdeb
   dh_gencontrol
dpkg-gencontrol: warning: package amazing-php: unused substitution variable ${perl:Depends}
   dh_md5sums
Can't exec "/bin/sh": Argument list too long at /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm line 241.
dh_md5sums: (cd debian/amazing-php >/dev/null ; find . -type f ! -path "./etc/apache2/sites-available/amazing-php.conf" ! -path "./etc/amazing-php/extensions/Arrays/arrayLoopsInteractionParserTests.txt" ! < A LONG LIST OF FILES >

When looking at the file using vi /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm +241 you can find

system(join(" ", @_)) == 0

which launches a subshell with a list of files (which is too long). This seems like a bug to me?

Is there a workaround or something?

Jonas Gröger
  • 1,558
  • 2
  • 21
  • 35

1 Answers1

1

Edit: So apparently this was a bug in the debhelper package until (excluding) 11.4. So in anything >=11.4 this should no longer be an issue.

Thanks @axel-beckert for mentioning it.


I fixed it by adding dh_override_md5sums to our debian/rules file:

#!/usr/bin/make -f

# Empty target: https://www.gnu.org/software/make/manual/html_node/Empty-Recipes.html
override_dh_md5sums: ;

%:
    dh $@
Jonas Gröger
  • 1,558
  • 2
  • 21
  • 35
  • 1
    Well, this is rather a workaround then a fix as it removes one feature from the built package: Checksums. What you ran into is actually [a bug in debhelper. It has been filed today](https://bugs.debian.org/864182) by someone who stumbled upon this SO question. IMHO the correct "solution" would have been to file a bug report in the Debian Bug Tracking System instead of "reporting" this only outside Debian. – Axel Beckert Jun 04 '17 at 21:28