Bug#889176: bc: Exhausts process table during build

2018-03-21 Thread Steve Langasek
Control: severity -1 serious
Control: tags -1 + patch

This bug is constistently reproducible.  I'm not sure what has changed
between the time bc successfully built, and now, to regress the behavior
(there have been no changes to the make-dfsg package in this timeframe);
however, I also can't see how the existing package was ever expected to
build, when this definitely looks like a circular dependency that's being
hidden from make.  

The attached patch fixes the issue and I have uploaded it to Ubuntu to fix
the build failure there.

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developerhttp://www.debian.org/
slanga...@ubuntu.com vor...@debian.org
diff -Nru bc-1.07.1/debian/patches/no-make-circular-dependencies.patch bc-1.07.1/debian/patches/no-make-circular-dependencies.patch
--- bc-1.07.1/debian/patches/no-make-circular-dependencies.patch	1969-12-31 16:00:00.0 -0800
+++ bc-1.07.1/debian/patches/no-make-circular-dependencies.patch	2018-03-21 19:47:50.0 -0700
@@ -0,0 +1,43 @@
+Description: fix circular dependency in makefile
+ The upstream makefile is unhelpfully relying on make to allow it to break
+ target dependency loops in a particular manner.  Instead, be explicit about
+ the relationship between the targets.
+Author: Steve Langasek 
+Last-Modified: 2018-03-21
+Bug-Debian: https://bugs.debian.org/889176
+
+Index: bc-1.07.1/bc/Makefile.am
+===
+--- bc-1.07.1.orig/bc/Makefile.am
 bc-1.07.1/bc/Makefile.am
+@@ -8,7 +8,7 @@
+  sbc.y
+ noinst_HEADERS = libmath.h
+ 
+-DISTCLEANFILES = sbc sbc.c sbc.h libmath.h
++DISTCLEANFILES = sbc sbc.c sbc.h libmath.h global_foo.c
+ 
+ MAINTAINERCLEANFILES = Makefile.in bc.c bc.h scan.c \
+ 	bc.y bcdefs.h const.h execute.c fix-libmath_h \
+@@ -28,16 +28,18 @@
+ 
+ scan.o: bc.h
+ global.o: libmath.h
++global_foo.c: global.c
++	cp -a global.c global_foo.c
+ 
+ fbcOBJ = main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o
+ 
+ libmath.h: libmath.b $(fbcOBJ) $(LIBBC)
+ 	echo '{0}' > libmath.h
+-	$(MAKE) global.o
+-	$(LINK) -o fbc $(fbcOBJ) global.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS)
++	$(MAKE) global_foo.o
++	$(LINK) -o fbc $(fbcOBJ) global_foo.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS)
+ 	./fbc -c $(srcdir)/libmath.b libmath.h
+ 	$(srcdir)/fix-libmath_h
+-	rm -f ./fbc ./global.o
++	rm -f ./fbc ./global_foo.o
+ 
+ sbcOBJ = main.o sbc.o scan.o execute.o global.o load.o storage.o util.o \
+  warranty.o
diff -Nru bc-1.07.1/debian/patches/series bc-1.07.1/debian/patches/series
--- bc-1.07.1/debian/patches/series	2017-07-24 12:05:43.0 -0700
+++ bc-1.07.1/debian/patches/series	2018-03-21 19:44:36.0 -0700
@@ -4,3 +4,4 @@
 05_notice_read_write_errors.diff
 06_read_dcrc.diff
 07_bc_man.diff
+no-make-circular-dependencies.patch


signature.asc
Description: PGP signature


Bug#889176: bc: Exhausts process table during build

2018-02-02 Thread Daniel Schepler
Source: bc
Version: 1.07.1-1
Severity: important

I just noticed that on building bc, it hangs for quite a while at the
point where it's calling "dh_auto_install".  Top shows that eventually
it's creating an infinite chain of processes "make global.o" and the
build only succeeds once these processes have filled the process
table.  Given that, it probably makes sense to just skip trying to run
"dh_auto_install", and instead provide an "override_dh_auto_install"
which runs the "make install" manually.  (Unless you can determine
that there's a bug in either the bc Makefile, or in dh_auto_install,
that you can fix.)
-- 
Daniel Schepler