Fix errors being ignored in many phases of the build since the bmake integration.

Say it with me, "I will not chain commands with && in Makefiles"

This was originally fixed and explained quite well by bde@ in r36074.  The
initial bmake integration caused 'set -e' to stop being used which lead to
r252419.  Later 'set -e' expectations were fixed with bmake in r254980.

Because of the && here, errors would be ignored when building in parallel and
a dependency failed.  Such as bootstrap-tools since it builds everything in
parallel.  If any tool failed in obj/depend/all, it would just ignore the error
and continue to build.  This later would result in cascaded errors that only
confused the real issue.  This could also cause commands after the failed
command to still execute, leading to more confusion.

This should be fine if the command is in a sub-shell such as: (cmd1 && cmd2)

This reverts r252419.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Bryan Drewery 2015-12-01 19:00:43 +00:00
parent 4910373ca8
commit b67490a3b0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=291605
3 changed files with 59 additions and 67 deletions

View File

@ -323,21 +323,21 @@ bmake: .PHONY
@echo ">>> Building an up-to-date ${.TARGET}(1)" @echo ">>> Building an up-to-date ${.TARGET}(1)"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
${_+_}@cd ${.CURDIR}/usr.bin/${.TARGET}; \ ${_+_}@cd ${.CURDIR}/usr.bin/${.TARGET}; \
${MMAKE} obj && \ ${MMAKE} obj; \
${MMAKE} depend && \ ${MMAKE} depend; \
${MMAKE} all && \ ${MMAKE} all; \
${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR=
tinderbox toolchains kernel-toolchains: upgrade_checks tinderbox toolchains kernel-toolchains: upgrade_checks
tinderbox: tinderbox:
@cd ${.CURDIR} && ${SUB_MAKE} DOING_TINDERBOX=YES universe @cd ${.CURDIR}; ${SUB_MAKE} DOING_TINDERBOX=YES universe
toolchains: toolchains:
@cd ${.CURDIR} && ${SUB_MAKE} UNIVERSE_TARGET=toolchain universe @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=toolchain universe
kernel-toolchains: kernel-toolchains:
@cd ${.CURDIR} && ${SUB_MAKE} UNIVERSE_TARGET=kernel-toolchain universe @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=kernel-toolchain universe
# #
# universe # universe
@ -435,7 +435,7 @@ universe_${target}_kernels: universe_${target}_prologue .MAKE
(echo "${target} 'make LINT' failed," \ (echo "${target} 'make LINT' failed," \
"check _.${target}.makeLINT for details"| ${MAKEFAIL})) "check _.${target}.makeLINT for details"| ${MAKEFAIL}))
.endif .endif
@cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ @cd ${.CURDIR}; ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \
universe_kernels universe_kernels
.endif # !MAKE_JUST_WORLDS .endif # !MAKE_JUST_WORLDS

View File

@ -1283,7 +1283,7 @@ doxygen: .PHONY
echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \ echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
exit 1; \ exit 1; \
fi fi
${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all ${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys; ${MAKE} obj all
# #
# update # update
@ -1303,7 +1303,7 @@ update:
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> Updating ${.CURDIR} using Subversion" @echo ">>> Updating ${.CURDIR} using Subversion"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS}) @(cd ${.CURDIR}; ${SVN} update ${SVNFLAGS})
.endif .endif
# #
@ -1336,11 +1336,11 @@ legacy:
.endif .endif
.for _tool in tools/build ${_elftoolchain_libs} .for _tool in tools/build ${_elftoolchain_libs}
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \ ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \
cd ${.CURDIR}/${_tool} && \ cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj && \ ${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes && \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
${MAKE} DIRPRFX=${_tool}/ depend && \ ${MAKE} DIRPRFX=${_tool}/ depend; \
${MAKE} DIRPRFX=${_tool}/ all && \ ${MAKE} DIRPRFX=${_tool}/ all; \
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
.endfor .endfor
@ -1489,10 +1489,10 @@ bootstrap-tools: .PHONY
usr.bin/localedef usr.bin/localedef
${_bt}-${_tool}: .PHONY .MAKE ${_bt}-${_tool}: .PHONY .MAKE
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
cd ${.CURDIR}/${_tool} && \ cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj && \ ${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ depend && \ ${MAKE} DIRPRFX=${_tool}/ depend; \
${MAKE} DIRPRFX=${_tool}/ all && \ ${MAKE} DIRPRFX=${_tool}/ all; \
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
bootstrap-tools: ${_bt}-${_tool} bootstrap-tools: ${_bt}-${_tool}
@ -1529,8 +1529,8 @@ _rescue=rescue/rescue
usr.bin/vi/catalog usr.bin/vi/catalog
build-tools_${_tool}: .PHONY build-tools_${_tool}: .PHONY
${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \ ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
cd ${.CURDIR}/${_tool} && \ cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj && \ ${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ build-tools ${MAKE} DIRPRFX=${_tool}/ build-tools
build-tools: build-tools_${_tool} build-tools: build-tools_${_tool}
.endfor .endfor
@ -1538,9 +1538,9 @@ build-tools: build-tools_${_tool}
${_gcc_tools} ${_gcc_tools}
build-tools_${_tool}: .PHONY build-tools_${_tool}: .PHONY
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \
cd ${.CURDIR}/${_tool} && \ cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj && \ ${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ depend && \ ${MAKE} DIRPRFX=${_tool}/ depend; \
${MAKE} DIRPRFX=${_tool}/ all ${MAKE} DIRPRFX=${_tool}/ all
build-tools: build-tools_${_tool} build-tools: build-tools_${_tool}
.endfor .endfor
@ -1620,10 +1620,10 @@ cross-tools: .MAKE .PHONY
${_crunchide} \ ${_crunchide} \
${_usb_tools} ${_usb_tools}
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
cd ${.CURDIR}/${_tool} && \ cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj && \ ${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ depend && \ ${MAKE} DIRPRFX=${_tool}/ depend; \
${MAKE} DIRPRFX=${_tool}/ all && \ ${MAKE} DIRPRFX=${_tool}/ all; \
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
.endfor .endfor
@ -1652,10 +1652,10 @@ native-xtools: .PHONY
.if ${MK_GCC_BOOTSTRAP} != "no" .if ${MK_GCC_BOOTSTRAP} != "no"
mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin
${_+_}@${ECHODIR} "===> ${_gperf} (obj,depend,all,install)"; \ ${_+_}@${ECHODIR} "===> ${_gperf} (obj,depend,all,install)"; \
cd ${.CURDIR}/${_gperf} && \ cd ${.CURDIR}/${_gperf}; \
${NXBMAKE} DIRPRFX=${_gperf}/ obj && \ ${NXBMAKE} DIRPRFX=${_gperf}/ obj; \
${NXBMAKE} DIRPRFX=${_gperf}/ depend && \ ${NXBMAKE} DIRPRFX=${_gperf}/ depend; \
${NXBMAKE} DIRPRFX=${_gperf}/ all && \ ${NXBMAKE} DIRPRFX=${_gperf}/ all; \
${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install ${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install
.endif .endif
mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
@ -1727,10 +1727,10 @@ native-xtools: .PHONY
usr.bin/yacc \ usr.bin/yacc \
usr.sbin/chown usr.sbin/chown
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
cd ${.CURDIR}/${_tool} && \ cd ${.CURDIR}/${_tool}; \
${NXBMAKE} DIRPRFX=${_tool}/ obj && \ ${NXBMAKE} DIRPRFX=${_tool}/ obj; \
${NXBMAKE} DIRPRFX=${_tool}/ depend && \ ${NXBMAKE} DIRPRFX=${_tool}/ depend; \
${NXBMAKE} DIRPRFX=${_tool}/ all && \ ${NXBMAKE} DIRPRFX=${_tool}/ all; \
${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install ${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install
.endfor .endfor
@ -1738,7 +1738,7 @@ native-xtools: .PHONY
# hierarchy - ensure that all the needed directories are present # hierarchy - ensure that all the needed directories are present
# #
hierarchy hier: .MAKE .PHONY hierarchy hier: .MAKE .PHONY
${_+_}cd ${.CURDIR}/etc && ${HMAKE} distrib-dirs ${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs
# #
# libraries - build all libraries, and install them under ${DESTDIR}. # libraries - build all libraries, and install them under ${DESTDIR}.
@ -1748,10 +1748,10 @@ hierarchy hier: .MAKE .PHONY
# ${.CURDIR}/tools/make_libdeps.sh script. # ${.CURDIR}/tools/make_libdeps.sh script.
# #
libraries: .MAKE .PHONY libraries: .MAKE .PHONY
${_+_}cd ${.CURDIR} && \ ${_+_}cd ${.CURDIR}; \
${MAKE} -f Makefile.inc1 _prereq_libs && \ ${MAKE} -f Makefile.inc1 _prereq_libs; \
${MAKE} -f Makefile.inc1 _startup_libs && \ ${MAKE} -f Makefile.inc1 _startup_libs; \
${MAKE} -f Makefile.inc1 _prebuild_libs && \ ${MAKE} -f Makefile.inc1 _prebuild_libs; \
${MAKE} -f Makefile.inc1 _generic_libs ${MAKE} -f Makefile.inc1 _generic_libs
# #
@ -1957,11 +1957,11 @@ gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L
${_lib}__PL: .PHONY .MAKE ${_lib}__PL: .PHONY .MAKE
.if exists(${.CURDIR}/${_lib}) .if exists(${.CURDIR}/${_lib})
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
cd ${.CURDIR}/${_lib} && \ cd ${.CURDIR}/${_lib}; \
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj && \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend && \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; \
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
DIRPRFX=${_lib}/ all && \ DIRPRFX=${_lib}/ all; \
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
DIRPRFX=${_lib}/ install DIRPRFX=${_lib}/ install
.endif .endif
@ -1971,10 +1971,10 @@ ${_lib}__PL: .PHONY .MAKE
${_lib}__L: .PHONY .MAKE ${_lib}__L: .PHONY .MAKE
.if exists(${.CURDIR}/${_lib}) .if exists(${.CURDIR}/${_lib})
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
cd ${.CURDIR}/${_lib} && \ cd ${.CURDIR}/${_lib}; \
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj && \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend && \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; \
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all && \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all; \
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install
.endif .endif
.endfor .endfor
@ -1984,11 +1984,11 @@ ${_lib}__L: .PHONY .MAKE
# modules. # modules.
lib/libpam__L: .PHONY .MAKE lib/libpam__L: .PHONY .MAKE
${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
cd ${.CURDIR}/lib/libpam && \ cd ${.CURDIR}/lib/libpam; \
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj && \ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj; \
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend && \ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend; \
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
-D_NO_LIBPAM_SO_YET all && \ -D_NO_LIBPAM_SO_YET all; \
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
-D_NO_LIBPAM_SO_YET install -D_NO_LIBPAM_SO_YET install
@ -2283,10 +2283,10 @@ _xb-bootstrap-tools: .PHONY
${_clang_tblgen} \ ${_clang_tblgen} \
${_gperf} ${_gperf}
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
cd ${.CURDIR}/${_tool} && \ cd ${.CURDIR}/${_tool}; \
${CDMAKE} DIRPRFX=${_tool}/ obj && \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \
${CDMAKE} DIRPRFX=${_tool}/ depend && \ ${CDMAKE} DIRPRFX=${_tool}/ depend; \
${CDMAKE} DIRPRFX=${_tool}/ all && \ ${CDMAKE} DIRPRFX=${_tool}/ all; \
${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install ${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install
.endfor .endfor
@ -2303,9 +2303,9 @@ _xb-cross-tools: .PHONY
${_clang} \ ${_clang} \
${_cc} ${_cc}
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \
cd ${.CURDIR}/${_tool} && \ cd ${.CURDIR}/${_tool}; \
${CDMAKE} DIRPRFX=${_tool}/ obj && \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \
${CDMAKE} DIRPRFX=${_tool}/ depend && \ ${CDMAKE} DIRPRFX=${_tool}/ depend; \
${CDMAKE} DIRPRFX=${_tool}/ all ${CDMAKE} DIRPRFX=${_tool}/ all
.endfor .endfor

View File

@ -849,14 +849,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
keep 64-bits counters. Thus all tools, that work with networking keep 64-bits counters. Thus all tools, that work with networking
statistics, must be rebuilt (netstat(1), bsnmpd(1), etc.) statistics, must be rebuilt (netstat(1), bsnmpd(1), etc.)
20130629:
Fix targets that run multiple make's to use && rather than ;
so that subsequent steps depend on success of previous.
NOTE: if building 'universe' with -j* on stable/8 or stable/9
it would be better to start the build using bmake, to avoid
overloading the machine.
20130618: 20130618:
Fix a bug that allowed a tracing process (e.g. gdb) to write Fix a bug that allowed a tracing process (e.g. gdb) to write
to a memory-mapped file in the traced process's address space to a memory-mapped file in the traced process's address space