Skip to content

Commit

Permalink
typo, move install check before download
Browse files Browse the repository at this point in the history
  • Loading branch information
rengolin committed Feb 13, 2024
1 parent e8be22e commit 20b7f71
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 13 additions & 12 deletions scripts/buildkite/build_llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ LLVM_VERSION=$(llvm_version)

echo "LLVM version: ${LLVM_VERSION}"

LLVM_INSTALL_DIR=${LLVMROOT}/${LLVM_VERSION}
LLVM_INSTALL_DIR=$(add_device_extensions ${LLVM_INSTALL_DIR} ${GPU})

# If there's another process building it, wait.
# Otherwise, make the dir quickly so others don't attempt at the same time
if [ -d ${LLVM_INSTALL_DIR} ]; then
wait_for_file ${LLVM_INSTALL_DIR} bin/mlir-opt
echo "LLVM built by another process, results in ${LLVM_INSTALL_DIR}"
exit 0
else
mkdir -p ${LLVM_INSTALL_DIR}
fi

# Destination for tar balls
if [ ! "${LLVM_TAR_DIR}" ]; then
LLVM_TAR_DIR="/tmp/tpp-llvm-tar"
Expand Down Expand Up @@ -47,18 +60,6 @@ fi
rm ${LLVM_TAR_FILE}

LLVM_PROJECT_DIR=${LLVM_TAR_DIR}/llvm-project-${LLVM_VERSION}
LLVM_INSTALL_DIR=${LLVMROOT}/${LLVM_VERSION}
LLVM_INSTALL_DIR=$(add_device_extensions ${LLVM_INSTALL_DIR} ${GPU})

# If there's another process building it, wait.
# Otherwise, make the dir quickly so others don't attempt at the same time
if [ -d ${LLVM_INSTALL_DIR} ]; then
wait_for_file ${LLVM_INSTALL_DIR} bin/mlir-opt
echo "LLVM built by another process, results in ${LLVM_INSTALL_DIR}"
exit 0
else
mkdir -p ${LLVM_INSTALL_DIR}
fi

# Environment setup
echo "--- ENVIRONMENT"
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ add_device_extensions() {
}

# Wait for a file to appear on an existing directory
waif_for_file() {
wait_for_file() {
local DIR=${1}
local FILE=$(realpath ${1}/${2})

Expand Down

0 comments on commit 20b7f71

Please sign in to comment.