summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2018-04-10 21:21:59 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-04-13 16:58:07 +0100
commitb28114cf1e58643bd233bc0c83d6d8138952b7ac (patch)
tree94c63951ae2a6946d4e2ef6e9c014850ca7e70ee /meta/classes
parent089cd3bf550fba896d1cff446d885149db4f9d26 (diff)
downloadpoky-b28114cf1e58643bd233bc0c83d6d8138952b7ac.tar.gz
icecc.bbclass: Improve error reporting
Improve reporting when the icecream environment cannot be created by assigning the flock call a specific error number when the lock fails so it can be distinguished from environment creation errors. (From OE-Core rev: 563448a7a3ca87cc07528c18f8047913e0468e7a) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/icecc.bbclass20
1 files changed, 13 insertions, 7 deletions
diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index aea1095f5f..1b58d1f5e5 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -366,14 +366,20 @@ set_icecc_env() {
366 366
367 # the ICECC_VERSION generation step must be locked by a mutex 367 # the ICECC_VERSION generation step must be locked by a mutex
368 # in order to prevent race conditions 368 # in order to prevent race conditions
369 if flock -n "${ICECC_VERSION}.lock" \ 369 exit_code=0
370 ${ICECC_ENV_EXEC} ${ICECC_ENV_DEBUG} "${ICECC_CC}" "${ICECC_CXX}" "${ICECC_AS}" "${ICECC_VERSION}" 370 flock -n -E 10 "${ICECC_VERSION}.lock" \
371 then 371 ${ICECC_ENV_EXEC} ${ICECC_ENV_DEBUG} "${ICECC_CC}" "${ICECC_CXX}" "${ICECC_AS}" "${ICECC_VERSION}" || exit_code=$?
372 if [ "$exit_code" -eq 0 ]; then
373 touch "${ICECC_VERSION}.done"
374 elif [ "$exit_code" -eq "10" ]; then
375 if [ ! wait_for_file "${ICECC_VERSION}.done" 30 ]; then
376 # locking failed so wait for ${ICECC_VERSION}.done to appear
377 bbwarn "Timeout waiting for ${ICECC_VERSION}.done"
378 return
379 fi
380 else
381 bbwarn "Could not create icecc environment: $exit_code"
372 touch "${ICECC_VERSION}.done" 382 touch "${ICECC_VERSION}.done"
373 elif [ ! wait_for_file "${ICECC_VERSION}.done" 30 ]
374 then
375 # locking failed so wait for ${ICECC_VERSION}.done to appear
376 bbwarn "Timeout waiting for ${ICECC_VERSION}.done"
377 return 383 return
378 fi 384 fi
379 fi 385 fi