Processed: Re: Bug#961563: crash: Build failure due to parallel execution

2020-05-26 Thread Debian Bug Tracking System
Processing control commands:

> severity -1 normal
Bug #961563 [src:crash] crash: Build failure due to parallel execution
Severity set to 'normal' from 'serious'
> tags -1 - ftbfs
Bug #961563 [src:crash] crash: Build failure due to parallel execution
Removed tag(s) ftbfs.

-- 
961563: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961563
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#961563: crash: Build failure due to parallel execution

2020-05-26 Thread Adrian Bunk
Control: severity -1 normal
Control: tags -1 - ftbfs

On Tue, May 26, 2020 at 11:58:19AM +0900, Benjamin Poirier wrote:
> Source: crash
> Severity: serious
> Tags: upstream patch ftbfs
> Justification: fails to build from source (but built successfully in the past)
> 
> Dear Maintainer,
> 
> The crash package sometimes fails to build when dpkg-buildpackage is
> invoked with -j > 1:
> 
>   # dpkg-buildpackage -us -uc -j4
>...

You are not the first person to fall into this trap.

   -j, --jobs[=jobs|auto]
  Number  of jobs allowed to be run simultaneously, number
  of jobs matching the number of online processors if auto
  is  specified  (since dpkg 1.17.10), or unlimited number
  if jobs is not  specified,  equivalent  to  the  make(1)
  option  of the same name (since dpkg 1.14.7, long option
  since dpkg 1.18.8).  Will add itself  to  the  MAKEFLAGS
  environment  variable, which should cause all subsequent
  make invocations to inherit the option, thus forcing the
  parallel  setting  on  the  packaging  (and possibly the
  upstream build system if that uses make)  regardless  of
  their  support  for  parallel  builds, which might cause
  build failures.

-J is the correct dpkg-buildpackage option.


> This is because crash's configure rewrites Makefile via a temporary file
> (Makefile.new) and it is now getting invoked multiple times in parallel.
> This is a problem upstream.

Correct.

> It can be avoided with the following change:
> --- a/debian/rules
> +++ b/debian/rules
> @@ -12,8 +12,7 @@ include /usr/share/dpkg/buildflags.mk
>   dh $@
>  
>  override_dh_auto_build:
> - dh_auto_build
> - $(MAKE) extensions lzo snappy
> + dh_auto_build -- all extensions lzo snappy
>...

This would fix only the "dpkg-buildpackage -j1" case,
"dh $@ --parallel" would still fail due to
  make -j4 all extensions lzo snappy


The correct workaround to enable parallel building is:

%:
dh $@ --parallel

override_dh_auto_build:
$(MAKE)
$(MAKE) extensions
$(MAKE) lzo
$(MAKE) snappy


cu
Adrian



Bug#961563: crash: Build failure due to parallel execution

2020-05-25 Thread Benjamin Poirier
Source: crash
Severity: serious
Tags: upstream patch ftbfs
Justification: fails to build from source (but built successfully in the past)

Dear Maintainer,

The crash package sometimes fails to build when dpkg-buildpackage is
invoked with -j > 1:

# dpkg-buildpackage -us -uc -j4
[...]
/usr/bin/make extensions lzo snappy
make[2]: Entering directory '/tmp/x/crash-7.2.8'
mv: cannot stat 'Makefile.new': No such file or directory
Makefile: cannot create new Makefile
please copy Makefile.new to Makefile
make[2]: *** [Makefile:324: lzo] Error 1
make[2]: *** Waiting for unfinished jobs
mv: cannot stat 'Makefile.new': No such file or directory
Makefile: cannot create new Makefile
please copy Makefile.new to Makefile
make[2]: *** [Makefile:328: snappy] Error 1
make[3]: Entering directory '/tmp/x/crash-7.2.8'
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent 
make rule.
gcc -Wall -g -shared -rdynamic -o echo.so echo.c -fPIC -DX86_64  
-DGDB_7_6
eppic.so: failed to pull eppic code from git repo
gcc -Wall -g -shared -rdynamic -o trace.so trace.c -fPIC -DX86_64  
-DGDB_7_6
gcc -Wall -g -shared -rdynamic -o dminfo.so dminfo.c -fPIC -DX86_64  
-DGDB_7_6
gcc -Wall -g -I. -shared -rdynamic -o snap.so snap.c -fPIC -DX86_64  
-DGDB_7_6
make[3]: Leaving directory '/tmp/x/crash-7.2.8'
make[2]: Leaving directory '/tmp/x/crash-7.2.8'
make[1]: *** [debian/rules:16: override_dh_auto_build] Error 2
make[1]: Leaving directory '/tmp/x/crash-7.2.8'
make: *** [debian/rules:12: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2

This is because crash's configure rewrites Makefile via a temporary file
(Makefile.new) and it is now getting invoked multiple times in parallel.
This is a problem upstream.

It can be avoided with the following change:
--- a/debian/rules
+++ b/debian/rules
@@ -12,8 +12,7 @@ include /usr/share/dpkg/buildflags.mk
dh $@
 
 override_dh_auto_build:
-   dh_auto_build
-   $(MAKE) extensions lzo snappy
+   dh_auto_build -- all extensions lzo snappy
 
 override_dh_auto_clean:
cp $(CURDIR)/Makefile $(CURDIR)/debian/Makefile.ori
--

Because the package uses debian/compat level 9, dh forces -j1.