From b67490a3b064f5c3b59c786ddd1073c648ad4ac4 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 19:00:43 +0000 Subject: [PATCH] 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 --- Makefile | 14 +++---- Makefile.inc1 | 104 +++++++++++++++++++++++++------------------------- UPDATING | 8 ---- 3 files changed, 59 insertions(+), 67 deletions(-) diff --git a/Makefile b/Makefile index 981e002f93b0..d4d5aa2951f8 100644 --- a/Makefile +++ b/Makefile @@ -323,21 +323,21 @@ bmake: .PHONY @echo ">>> Building an up-to-date ${.TARGET}(1)" @echo "--------------------------------------------------------------" ${_+_}@cd ${.CURDIR}/usr.bin/${.TARGET}; \ - ${MMAKE} obj && \ - ${MMAKE} depend && \ - ${MMAKE} all && \ + ${MMAKE} obj; \ + ${MMAKE} depend; \ + ${MMAKE} all; \ ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= tinderbox toolchains kernel-toolchains: upgrade_checks tinderbox: - @cd ${.CURDIR} && ${SUB_MAKE} DOING_TINDERBOX=YES universe + @cd ${.CURDIR}; ${SUB_MAKE} DOING_TINDERBOX=YES universe toolchains: - @cd ${.CURDIR} && ${SUB_MAKE} UNIVERSE_TARGET=toolchain universe + @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=toolchain universe kernel-toolchains: - @cd ${.CURDIR} && ${SUB_MAKE} UNIVERSE_TARGET=kernel-toolchain universe + @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=kernel-toolchain universe # # universe @@ -435,7 +435,7 @@ universe_${target}_kernels: universe_${target}_prologue .MAKE (echo "${target} 'make LINT' failed," \ "check _.${target}.makeLINT for details"| ${MAKEFAIL})) .endif - @cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ + @cd ${.CURDIR}; ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ universe_kernels .endif # !MAKE_JUST_WORLDS diff --git a/Makefile.inc1 b/Makefile.inc1 index d5ce5bca754d..3ee55bce17ca 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1283,7 +1283,7 @@ doxygen: .PHONY echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \ exit 1; \ fi - ${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all + ${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys; ${MAKE} obj all # # update @@ -1303,7 +1303,7 @@ update: @echo "--------------------------------------------------------------" @echo ">>> Updating ${.CURDIR} using Subversion" @echo "--------------------------------------------------------------" - @(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS}) + @(cd ${.CURDIR}; ${SVN} update ${SVNFLAGS}) .endif # @@ -1336,11 +1336,11 @@ legacy: .endif .for _tool in tools/build ${_elftoolchain_libs} ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \ - cd ${.CURDIR}/${_tool} && \ - ${MAKE} DIRPRFX=${_tool}/ obj && \ - ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes && \ - ${MAKE} DIRPRFX=${_tool}/ depend && \ - ${MAKE} DIRPRFX=${_tool}/ all && \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ + ${MAKE} DIRPRFX=${_tool}/ depend; \ + ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install .endfor @@ -1489,10 +1489,10 @@ bootstrap-tools: .PHONY usr.bin/localedef ${_bt}-${_tool}: .PHONY .MAKE ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool} && \ - ${MAKE} DIRPRFX=${_tool}/ obj && \ - ${MAKE} DIRPRFX=${_tool}/ depend && \ - ${MAKE} DIRPRFX=${_tool}/ all && \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ depend; \ + ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install bootstrap-tools: ${_bt}-${_tool} @@ -1529,8 +1529,8 @@ _rescue=rescue/rescue usr.bin/vi/catalog build-tools_${_tool}: .PHONY ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \ - cd ${.CURDIR}/${_tool} && \ - ${MAKE} DIRPRFX=${_tool}/ obj && \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ build-tools build-tools: build-tools_${_tool} .endfor @@ -1538,9 +1538,9 @@ build-tools: build-tools_${_tool} ${_gcc_tools} build-tools_${_tool}: .PHONY ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ - cd ${.CURDIR}/${_tool} && \ - ${MAKE} DIRPRFX=${_tool}/ obj && \ - ${MAKE} DIRPRFX=${_tool}/ depend && \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ depend; \ ${MAKE} DIRPRFX=${_tool}/ all build-tools: build-tools_${_tool} .endfor @@ -1620,10 +1620,10 @@ cross-tools: .MAKE .PHONY ${_crunchide} \ ${_usb_tools} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool} && \ - ${MAKE} DIRPRFX=${_tool}/ obj && \ - ${MAKE} DIRPRFX=${_tool}/ depend && \ - ${MAKE} DIRPRFX=${_tool}/ all && \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ depend; \ + ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install .endfor @@ -1652,10 +1652,10 @@ native-xtools: .PHONY .if ${MK_GCC_BOOTSTRAP} != "no" mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin ${_+_}@${ECHODIR} "===> ${_gperf} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_gperf} && \ - ${NXBMAKE} DIRPRFX=${_gperf}/ obj && \ - ${NXBMAKE} DIRPRFX=${_gperf}/ depend && \ - ${NXBMAKE} DIRPRFX=${_gperf}/ all && \ + cd ${.CURDIR}/${_gperf}; \ + ${NXBMAKE} DIRPRFX=${_gperf}/ obj; \ + ${NXBMAKE} DIRPRFX=${_gperf}/ depend; \ + ${NXBMAKE} DIRPRFX=${_gperf}/ all; \ ${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install .endif mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr @@ -1727,10 +1727,10 @@ native-xtools: .PHONY usr.bin/yacc \ usr.sbin/chown ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool} && \ - ${NXBMAKE} DIRPRFX=${_tool}/ obj && \ - ${NXBMAKE} DIRPRFX=${_tool}/ depend && \ - ${NXBMAKE} DIRPRFX=${_tool}/ all && \ + cd ${.CURDIR}/${_tool}; \ + ${NXBMAKE} DIRPRFX=${_tool}/ obj; \ + ${NXBMAKE} DIRPRFX=${_tool}/ depend; \ + ${NXBMAKE} DIRPRFX=${_tool}/ all; \ ${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install .endfor @@ -1738,7 +1738,7 @@ native-xtools: .PHONY # hierarchy - ensure that all the needed directories are present # 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}. @@ -1748,10 +1748,10 @@ hierarchy hier: .MAKE .PHONY # ${.CURDIR}/tools/make_libdeps.sh script. # libraries: .MAKE .PHONY - ${_+_}cd ${.CURDIR} && \ - ${MAKE} -f Makefile.inc1 _prereq_libs && \ - ${MAKE} -f Makefile.inc1 _startup_libs && \ - ${MAKE} -f Makefile.inc1 _prebuild_libs && \ + ${_+_}cd ${.CURDIR}; \ + ${MAKE} -f Makefile.inc1 _prereq_libs; \ + ${MAKE} -f Makefile.inc1 _startup_libs; \ + ${MAKE} -f Makefile.inc1 _prebuild_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 .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_lib} && \ - ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj && \ - ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend && \ + cd ${.CURDIR}/${_lib}; \ + ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \ + ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; \ ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ - DIRPRFX=${_lib}/ all && \ + DIRPRFX=${_lib}/ all; \ ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ DIRPRFX=${_lib}/ install .endif @@ -1971,10 +1971,10 @@ ${_lib}__PL: .PHONY .MAKE ${_lib}__L: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_lib} && \ - ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj && \ - ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend && \ - ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all && \ + cd ${.CURDIR}/${_lib}; \ + ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \ + ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; \ + ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all; \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install .endif .endfor @@ -1984,11 +1984,11 @@ ${_lib}__L: .PHONY .MAKE # modules. lib/libpam__L: .PHONY .MAKE ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ - cd ${.CURDIR}/lib/libpam && \ - ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj && \ - ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend && \ + cd ${.CURDIR}/lib/libpam; \ + ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj; \ + ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend; \ ${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/ \ -D_NO_LIBPAM_SO_YET install @@ -2283,10 +2283,10 @@ _xb-bootstrap-tools: .PHONY ${_clang_tblgen} \ ${_gperf} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool} && \ - ${CDMAKE} DIRPRFX=${_tool}/ obj && \ - ${CDMAKE} DIRPRFX=${_tool}/ depend && \ - ${CDMAKE} DIRPRFX=${_tool}/ all && \ + cd ${.CURDIR}/${_tool}; \ + ${CDMAKE} DIRPRFX=${_tool}/ obj; \ + ${CDMAKE} DIRPRFX=${_tool}/ depend; \ + ${CDMAKE} DIRPRFX=${_tool}/ all; \ ${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install .endfor @@ -2303,9 +2303,9 @@ _xb-cross-tools: .PHONY ${_clang} \ ${_cc} ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ - cd ${.CURDIR}/${_tool} && \ - ${CDMAKE} DIRPRFX=${_tool}/ obj && \ - ${CDMAKE} DIRPRFX=${_tool}/ depend && \ + cd ${.CURDIR}/${_tool}; \ + ${CDMAKE} DIRPRFX=${_tool}/ obj; \ + ${CDMAKE} DIRPRFX=${_tool}/ depend; \ ${CDMAKE} DIRPRFX=${_tool}/ all .endfor diff --git a/UPDATING b/UPDATING index 1c90c2c3a13e..4169a10c156a 100644 --- a/UPDATING +++ b/UPDATING @@ -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 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: 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