summaryrefslogtreecommitdiffstats
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:55:25 +0100
commit563448a7a3ca87cc07528c18f8047913e0468e7a (patch)
tree0df99eee22b1cc437e9d4daacfbf89326bbd5be4
parentbe913284bb34ebf4a71770646044603a2a27d01b (diff)
downloadopenembedded-core-563448a7a3ca87cc07528c18f8047913e0468e7a.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. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-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() {
# the ICECC_VERSION generation step must be locked by a mutex
# in order to prevent race conditions
- if flock -n "${ICECC_VERSION}.lock" \
- ${ICECC_ENV_EXEC} ${ICECC_ENV_DEBUG} "${ICECC_CC}" "${ICECC_CXX}" "${ICECC_AS}" "${ICECC_VERSION}"
- then
+ exit_code=0
+ flock -n -E 10 "${ICECC_VERSION}.lock" \
+ ${ICECC_ENV_EXEC} ${ICECC_ENV_DEBUG} "${ICECC_CC}" "${ICECC_CXX}" "${ICECC_AS}" "${ICECC_VERSION}" || exit_code=$?
+ if [ "$exit_code" -eq 0 ]; then
+ touch "${ICECC_VERSION}.done"
+ elif [ "$exit_code" -eq "10" ]; then
+ if [ ! wait_for_file "${ICECC_VERSION}.done" 30 ]; then
+ # locking failed so wait for ${ICECC_VERSION}.done to appear
+ bbwarn "Timeout waiting for ${ICECC_VERSION}.done"
+ return
+ fi
+ else
+ bbwarn "Could not create icecc environment: $exit_code"
touch "${ICECC_VERSION}.done"
- elif [ ! wait_for_file "${ICECC_VERSION}.done" 30 ]
- then
- # locking failed so wait for ${ICECC_VERSION}.done to appear
- bbwarn "Timeout waiting for ${ICECC_VERSION}.done"
return
fi
fi