Bug 201781

Summary: [patch] sysutils/screen parallel build can fail
Product: Ports & Packages Reporter: Don Lewis <truckman>
Component: Individual Port(s)Assignee: Cy Schubert <cy>
Status: Closed FIXED    
Severity: Affects Only Me Keywords: patch
Priority: --- Flags: bugzilla: maintainer-feedback? (cy)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to add missing dependencies to unbreak parallel build none

Description Don Lewis freebsd_committer 2015-07-23 05:34:59 UTC
Created attachment 159106 [details]
patch to add missing dependencies to unbreak parallel build

I experienced this build failure on FreeBSD 11.0-CURRENT when running a parallel build under poudriere:



=======================<phase: build          >============================
===>  Building for screen-4.3.1_1
gmake[1]: Entering directory '/wrkdirs/usr/ports/sysutils/screen/work/screen-4.3.1'
CPP="cpp -DETCSCREENRC='"/usr/local/etc/screenrc"' -DSCREENENCODINGS='"/usr/local/share/screen/utf8encodings"'" srcdir=. sh ./osdef.sh
AWK=/usr/bin/awk CC="cc -O2 -pipe  -DCOLORS256 -fstack-protector -fno-strict-aliasing" srcdir=. sh ./comm.sh
AWK=/usr/bin/awk srcdir=. sh ./term.sh
sh ./tty.sh tty.c
cc -c -I. -I.  -DETCSCREENRC='"/usr/local/etc/screenrc"' -DSCREENENCODINGS='"/usr/local/share/screen/utf8encodings"' -DHAVE_CONFIG_H -DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
     -O2 -pipe  -DCOLORS256 -fstack-protector -fno-strict-aliasing putenv.c
cc -c -I. -I.  -DETCSCREENRC='"/usr/local/etc/screenrc"' -DSCREENENCODINGS='"/usr/local/share/screen/utf8encodings"' -DHAVE_CONFIG_H -DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
     -O2 -pipe  -DCOLORS256 -fstack-protector -fno-strict-aliasing list_generic.c
cc -c -I. -I.  -DETCSCREENRC='"/usr/local/etc/screenrc"' -DSCREENENCODINGS='"/usr/local/share/screen/utf8encodings"' -DHAVE_CONFIG_H -DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
     -O2 -pipe  -DCOLORS256 -fstack-protector -fno-strict-aliasing list_display.c
cc -c -I. -I.  -DETCSCREENRC='"/usr/local/etc/screenrc"' -DSCREENENCODINGS='"/usr/local/share/screen/utf8encodings"' -DHAVE_CONFIG_H -DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
     -O2 -pipe  -DCOLORS256 -fstack-protector -fno-strict-aliasing list_window.c
cc -c -I. -I.  -DETCSCREENRC='"/usr/local/etc/screenrc"' -DSCREENENCODINGS='"/usr/local/share/screen/utf8encodings"' -DHAVE_CONFIG_H -DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
     -O2 -pipe  -DCOLORS256 -fstack-protector -fno-strict-aliasing term.c
cc -c -I. -I.  -DETCSCREENRC='"/usr/local/etc/screenrc"' -DSCREENENCODINGS='"/usr/local/share/screen/utf8encodings"' -DHAVE_CONFIG_H -DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
     -O2 -pipe  -DCOLORS256 -fstack-protector -fno-strict-aliasing kmapdef.c
list_window.c:121:12: error: use of undeclared identifier 'RC_KILL'
  act.nr = RC_KILL;
           ^
cc -c -I. -I.  -DETCSCREENRC='"/usr/local/etc/screenrc"' -DSCREENENCODINGS='"/usr/local/share/screen/utf8encodings"' -DHAVE_CONFIG_H -DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
     -O2 -pipe  -DCOLORS256 -fstack-protector -fno-strict-aliasing screen.c
cc -c -I. -I.  -DETCSCREENRC='"/usr/local/etc/screenrc"' -DSCREENENCODINGS='"/usr/local/share/screen/utf8encodings"' -DHAVE_CONFIG_H -DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
     -O2 -pipe  -DCOLORS256 -fstack-protector -fno-strict-aliasing ansi.c
1 error generated.
Makefile:82: recipe for target 'list_window.o' failed
gmake[1]: *** [list_window.o] Error 1
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory '/wrkdirs/usr/ports/sysutils/screen/work/screen-4.3.1'
===> Compilation failed unexpectedly.


The problem is that the RC_KILL symbol is defined in comm.h, but this is a generated header that is not listed as a dependency of list_window.o in the Makefile.  When doing a parallel build it is possible that list_window.c may get compiled before comm.h is fully baked.

The attached patch adds this and other missing dependencies to the Makefile.
Comment 1 commit-hook freebsd_committer 2015-11-16 16:11:03 UTC
A commit references this bug:

Author: amdmi3
Date: Mon Nov 16 16:10:35 UTC 2015
New revision: 401774
URL: https://svnweb.freebsd.org/changeset/ports/401774

Log:
  - Add missing file dependencies to fix threaded build, remove MAKE_JOBS_UNSAFE

  PR:		201781
  Submitted by:	truckman
  Approved by:	maintainer timeout (cy, 3.5 months)

Changes:
  head/sysutils/screen/Makefile
  head/sysutils/screen/files/patch-Makefile.in
Comment 2 Dmitry Marakasov freebsd_committer 2015-11-16 16:11:21 UTC
Tested by adding sleeps to targets generating .h files, works well. Committed, thank you!