Skip to content

Commit

Permalink
Remove LLVM build lock on failure (#908)
Browse files Browse the repository at this point in the history
Removes install dir, that acts as a synchronization point to prevent
parallel builds of the same LLVM, on failure.

This should allow LLVM builds to be rerun after early exits in case of
errors.
  • Loading branch information
adam-smnk authored Apr 25, 2024
1 parent d9fd677 commit 3c26c4c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/buildkite/build_llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ if [ ! -f "${LLVM_TAR_FILE}" ]; then
echo_run wget -nv -P ${LLVM_TAR_DIR} https://github.com/llvm/llvm-project/archive/${LLVM_TAR_NAME}
if [ $? != 0 ]; then
echo "Failed to fetch repo"
rm -r ${LLVM_INSTALL_DIR}
exit 1
fi
fi
Expand All @@ -53,6 +54,7 @@ fi
echo_run unzip -uqn ${LLVM_TAR_FILE} -d ${LLVM_TAR_DIR}
if [ $? != 0 ]; then
echo "Failed to unpack repo"
rm -r ${LLVM_INSTALL_DIR}
exit 1
fi

Expand All @@ -78,6 +80,7 @@ elif [ "${COMPILER}" == "gcc" ]; then
CXX=g++
else
echo "Compiler "${COMPILER}" not recognized"
rm -r ${LLVM_INSTALL_DIR}
exit 1
fi

Expand Down Expand Up @@ -136,13 +139,15 @@ echo_run cmake -Wno-dev -G Ninja \
echo "--- BUILD"
echo_run ninja -C ${LLVM_BUILD_DIR} all
if [ $? != 0 ]; then
rm -r ${LLVM_INSTALL_DIR}
exit 1
fi

# Check LLVM
echo "--- CHECK"
echo_run ninja -C ${LLVM_BUILD_DIR} check-all
if [ $? != 0 ]; then
rm -r ${LLVM_INSTALL_DIR}
exit 1
fi

Expand Down

0 comments on commit 3c26c4c

Please sign in to comment.