|
513 | 513 | # For two-phase builds (quick parallel make first, sequential retry if failed) |
514 | 514 | # how verbose should that first phase be? Nothing, automake list of ops, CLIs? |
515 | 515 | # See build_to_only_catch_errors_target() for a consumer of this setting. |
| 516 | +# CI_PARMAKE_VERBOSITY_CPB is for "check-parallel-builds" part below. |
516 | 517 | case "${CI_PARMAKE_VERBOSITY-}" in |
517 | | - silent|quiet|verbose|default) ;; |
518 | | - *) CI_PARMAKE_VERBOSITY=silent ;; |
| 518 | + silent|quiet|verbose|default) |
| 519 | + [ -n "${CI_PARMAKE_VERBOSITY_CPB-}" ] || CI_PARMAKE_VERBOSITY_CPB="${CI_PARMAKE_VERBOSITY-}" |
| 520 | + ;; |
| 521 | + *) CI_PARMAKE_VERBOSITY=silent |
| 522 | + [ -n "${CI_PARMAKE_VERBOSITY_CPB-}" ] || CI_PARMAKE_VERBOSITY_CPB=quiet |
| 523 | + ;; |
519 | 524 | esac |
520 | 525 |
|
521 | 526 | # Set up the parallel make with reasonable limits, using several ways to |
@@ -636,6 +641,11 @@ for L in $NODE_LABELS ; do |
636 | 641 | [ -n "$CANBUILD_WITH_LIBLTDL" ] || CANBUILD_WITH_LIBLTDL=no ;; |
637 | 642 | "NUT_BUILD_CAPS=libltdl"|"NUT_BUILD_CAPS=libltdl=yes") |
638 | 643 | [ -n "$CANBUILD_WITH_LIBLTDL" ] || CANBUILD_WITH_LIBLTDL=yes ;; |
| 644 | + |
| 645 | + # For now like this; VM systems with a clock skew can have natural |
| 646 | + # problems with parallel tasks, which we can not do much about. |
| 647 | + "NUT_BUILD_CAPS=check-parallel-builds=no") |
| 648 | + [ -n "${CI_DO_CHECK_PARALLEL_BUILDS-}" ] || CI_DO_CHECK_PARALLEL_BUILDS=false ;; |
639 | 649 | esac |
640 | 650 | done |
641 | 651 |
|
@@ -1945,6 +1955,16 @@ default|default-alldrv|default-alldrv:no-distcheck|default-all-errors|default-al |
1945 | 1955 | echo "NOTE: adapted BUILD_TYPE 'default-all-errors' => '${BUILD_TYPE}'" >&2 |
1946 | 1956 | fi |
1947 | 1957 |
|
| 1958 | + if [ x"${HAVE_CCACHE-}" = xyes ] && [ x"${CI_DO_CHECK_PARALLEL_BUILDS-}" = x ] ; then |
| 1959 | + # Ideally massive-build CI recipes would set this option |
| 1960 | + # for scenarios they are interested in, e.g. once per OS |
| 1961 | + # and make implementation, not all hundreds of builds?.. |
| 1962 | + # On the other hand, catching issues (race conditions in |
| 1963 | + # recipes) is a big-numbers game... |
| 1964 | + CI_DO_CHECK_PARALLEL_BUILDS=true |
| 1965 | + echo "NOTE: we have ccache, so enabled 'make check-parallel-builds' for combos below" >&2 |
| 1966 | + fi |
| 1967 | + |
1948 | 1968 | # Try to run various build scenarios to collect build errors |
1949 | 1969 | # (no checks here) as configured further by caller's choice |
1950 | 1970 | # of BUILD_WARNFATAL and/or BUILD_WARNOPT envvars above. |
@@ -2298,6 +2318,12 @@ default|default-alldrv|default-alldrv:no-distcheck|default-all-errors|default-al |
2298 | 2318 | ;; |
2299 | 2319 | esac |
2300 | 2320 |
|
| 2321 | + # Snippet from autogen.sh: restore files required by autoconf |
| 2322 | + # for non-"foreign" projects that a deep clean in other loops |
| 2323 | + # could have destroyed: |
| 2324 | + [ -f "${SCRIPTDIR}/NEWS" ] || { echo "Please see NEWS.adoc for actual contents" > "${SCRIPTDIR}/NEWS"; } |
| 2325 | + [ -f "${SCRIPTDIR}/README" ] || { echo "Please see README.adoc for actual contents" > "${SCRIPTDIR}/README"; } |
| 2326 | + |
2301 | 2327 | configure_nut |
2302 | 2328 | ) || { |
2303 | 2329 | RES_ALLERRORS=$? |
@@ -2340,6 +2366,27 @@ default|default-alldrv|default-alldrv:no-distcheck|default-all-errors|default-al |
2340 | 2366 | fi |
2341 | 2367 | } |
2342 | 2368 |
|
| 2369 | + # Check that the current MAKE implementation deals with parallel |
| 2370 | + # recipes properly. Ideally this is sped up by ccache. At least |
| 2371 | + # privately CI_FAILFAST=true to not retry this one sequentially: |
| 2372 | + if [ x"$CI_DO_CHECK_PARALLEL_BUILDS" = xtrue ] ; then |
| 2373 | + CI_FAILFAST=true \ |
| 2374 | + CI_PARMAKE_VERBOSITY="${CI_PARMAKE_VERBOSITY_CPB-}" \ |
| 2375 | + CHECK_PARALLEL_BUILDS_REGEN=false \ |
| 2376 | + build_to_only_catch_errors_target check-parallel-builds && { |
| 2377 | + SUCCEEDED+=("TESTCOMBO=${TESTCOMBO}[check-parallel-builds]") |
| 2378 | + } || { |
| 2379 | + RES_ALLERRORS=$? |
| 2380 | + FAILED+=("TESTCOMBO=${TESTCOMBO}[check-parallel-builds]") |
| 2381 | + # Help find end of build (before cleanup noise) in logs: |
| 2382 | + echo "=== FAILED 'TESTCOMBO=${TESTCOMBO}' check-parallel-builds" |
| 2383 | + if [ "$CI_FAILFAST" = true ]; then |
| 2384 | + echo "===== Aborting because CI_FAILFAST=$CI_FAILFAST" >&2 |
| 2385 | + break |
| 2386 | + fi |
| 2387 | + } |
| 2388 | + fi |
| 2389 | + |
2343 | 2390 | # Note: when `expr` calculates a zero value below, it returns |
2344 | 2391 | # an "erroneous" `1` as exit code. Why oh why?.. |
2345 | 2392 | # (UPDATE: because expr returns boolean, and calculated 0 is false; |
|
0 commit comments