From e8c03ae95ba6b7e59267b2bfe209de76a8539b69 Mon Sep 17 00:00:00 2001 From: Lauri Tirkkonen Date: Wed, 9 Jan 2019 23:46:54 +0000 Subject: [PATCH] move post-build ops from nightly.sh to tools/postbuild/Makefile this enables doing them in parallel --- tools/nightly.sh | 104 +++-------------------------------------------- tools/postbuild/Makefile | 41 +++++++++++++++++++ 2 files changed, 46 insertions(+), 99 deletions(-) create mode 100644 tools/postbuild/Makefile diff --git a/tools/nightly.sh b/tools/nightly.sh index 0ab51a30a5..0890a745be 100755 --- a/tools/nightly.sh +++ b/tools/nightly.sh @@ -180,32 +180,12 @@ function build { echo "\n==== Ended OS-Net source build at `date` ($LABEL) ====\n" - # - # Building Packages - # - if [ "$p_FLAG" = "y" -a "$this_build_ok" = "y" ]; then - if [ -d $SRC/pkg ]; then - echo "\n==== Creating $LABEL packages at `date` ====\n" - echo "Clearing out $PKGARCHIVE ..." - rm -rf $PKGARCHIVE - mkdir -p $PKGARCHIVE - - rm -f $SRC/pkg/${INSTALLOG}.out - cd $SRC/pkg - echo "\n==== dmake -C $SRC/pkg install ====\n" >&2 - if ! /bin/time $MAKE -e install; then - build_extras_ok=n - this_build_ok=n - fi - else - # - # Handle it gracefully if -p was set but there so - # no pkg directory. - # - echo "\n==== No $LABEL packages to build ====\n" + if [ "$this_build_ok" = "y" ]; then + make -C ${SRCTOP}/tools/postbuild clean obj + if ! make -j$DMAKE_MAX_JOBS -C ${SRCTOP}/tools/postbuild; then + build_extras_ok=n + this_build_ok=n fi - else - echo "\n==== Not creating $LABEL packages ====\n" fi } @@ -929,80 +909,6 @@ if [ "$build_ok" = "y" ]; then fi done fi - - if [ "$N_FLAG" != "y" -a -d $SRC/pkg ]; then - echo "\n==== Validating manifests against proto area (protocmp) ====\n" >&2 - if ! ( cd $SRC/pkg ; /bin/time $MAKE -e protocmp ROOT="$ROOT" ) >&2; then - build_extras_ok=n - fi - fi -fi - -# -# ELF verification: ABI (-A) and runtime (-r) checks -# -if [ "$build_ok" = y -a '(' "$A_FLAG" = y -o "$r_FLAG" = y ')' ]; then - # Directory ELF-data.$MACH holds the files produced by these tests. - elf_ddir=$TMPDIR/ELF-data.$MACH - mkdir -p $elf_ddir - - # Call find_elf to produce a list of the ELF objects in the proto area. - # This list is passed to check_rtime and interface_check, preventing - # them from separately calling find_elf to do the same work twice. - find_elf -fr $ROOT > $elf_ddir/object_list - - if [[ $A_FLAG = y ]]; then - echo "\n==== Check versioning and ABI information (interface_check) ====\n" >&2 - - # Produce interface description for the proto. Report errors. - /bin/time interface_check -o -w $elf_ddir -f object_list \ - -i interface -E interface.err - if [[ -s $elf_ddir/interface.err ]]; then - cat $elf_ddir/interface.err >&2 - build_extras_ok=n - fi - - fi - - if [[ $r_FLAG = y ]]; then - echo "\n==== Check ELF runtime attributes (check_rtime) ====\n" >&2 - - # If we're doing a DEBUG build the proto area will be left - # with debuggable objects, thus don't assert -s. - if [[ $D_FLAG = y ]]; then - rtime_sflag="" - else - rtime_sflag="-s" - fi - /bin/time check_rtime -i -v $rtime_sflag -o -w $elf_ddir \ - -D object_list -f object_list -E runtime.err \ - -I runtime.attr.raw - if (( $? != 0 )); then - build_extras_ok=n - fi - - # Report errors - if [[ -s $elf_ddir/runtime.err ]]; then - cat $elf_ddir/runtime.err >&2 - build_extras_ok=n - fi - fi -fi - -# "make check" begins - -if [ "$i_CMD_LINE_FLAG" = "n" -a "$C_FLAG" = "y" ]; then - # remove old check.out - rm -f $SRC/check.out - - rm -f $SRC/check-${MACH}.out - cd $SRC - echo "\n==== dmake check ====\n" >&2 - if ! /bin/time $MAKE -ek check ROOT="$ROOT"; then - build_extras_ok=n - fi -else - echo "\n==== No '$MAKE check' ====\n" fi echo "\n==== Find core files ====\n" >&2 diff --git a/tools/postbuild/Makefile b/tools/postbuild/Makefile new file mode 100644 index 0000000000..0ed1d7d157 --- /dev/null +++ b/tools/postbuild/Makefile @@ -0,0 +1,41 @@ +# this makefile handles all the post-build ops that were done serially in +# nightly.sh before. +# +# because we run dmake, this makefile is special and should only be run from +# bldenv or nightly.sh, which put in env the stuff that the dmake dirs expect. + +all: dmake_check check_rtime interface_check packages protocmp +.PHONY: dmake_check check_rtime interface_check packages protocmp clean + +.if !defined(SRC) || !defined(ROOT) || !defined(DMAKE_MODE) || !defined(PKGARCHIVE) +.error postbuild Makefile must be run from bldenv +.endif + +clean: + rm -f object_list + +object_list: + ${SRCTOP}/usr/src/tools/scripts/find_elf -fr ${ROOT} > $@ + +dmake_check: + cd ${SRCTOP}/usr/src && MAKEFLAGS= dmake -ek check ROOT=${ROOT} + +check_rtime: object_list + ${SRCTOP}/usr/src/tools/scripts/check_rtime -i -v -w ${.OBJDIR}\ + -D object_list -f object_list -I runtime.attr.raw + +interface_check: object_list + ${SRCTOP}/usr/src/tools/scripts/interface_check -o -w ${.OBJDIR}\ + -f object_list -i interface + +protocmp: + cd ${SRCTOP}/usr/src/pkg && MAKEFLAGS= dmake -e protocmp ROOT=${ROOT} + +packages: protocmp + rm -rf ${PKGARCHIVE} + mkdir -p ${PKGARCHIVE} + cd ${SRCTOP}/usr/src/pkg && MAKEFLAGS= dmake -e install + +UNLEASHED_OBJ?= /usr/obj/${MACHINE} +.include +.include -- 2.11.4.GIT