Skip to content

Commit 1119ebb

Browse files
authored
Drop the unused LLVM download from setup-qnn-deps.sh (#24098)
## Problem `.ci/scripts/setup-qnn-deps.sh` calls `setup_libcpp`, which downloads a 575 MB LLVM release from GitHub. A connection reset in the middle of that download fails the job: ``` curl: (56) OpenSSL SSL_read: Connection reset by peer, errno 104 Error: Failed to download LLVM ``` But nothing uses what `setup_libcpp` installs: - Every workflow runs `setup-qnn-deps.sh` with `bash`, not `source`. So the `LD_LIBRARY_PATH`, `LIBRARY_PATH` and `CPLUS_INCLUDE_PATH` values it exports are gone when the script exits, and nothing else reads its install folder. - Its copy step does not pick up libc++ at all. The libc++ libraries are in a subfolder its `lib/*.so*` glob does not reach. - The QNN backend test jobs never call it, and they pass. The CI image gets libc++ from the system package. ## Fix Remove the `setup_libcpp 12` call and the `setup_libcpp` function, which nothing else uses. This fixes the flaky download and saves about half a minute of download and extraction per QNN job. The Python setup path (`_stage_libcxx` in `download_qnn_sdk.py`) downloads the same archive for users who have not set `QNN_SDK_ROOT`. It is separate and not changed here. ## Testing Shell syntax check on both scripts. The QNN CI jobs on this pull request are the real test, since they run `setup-qnn-deps.sh` without the download. cc @cbilgin @psiddh
1 parent ea34866 commit 1119ebb

2 files changed

Lines changed: 0 additions & 66 deletions

File tree

‎.ci/scripts/setup-qnn-deps.sh‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ set -ex
99

1010
source "$(dirname "${BASH_SOURCE[0]}")/../../backends/qualcomm/scripts/install_qnn_sdk.sh"
1111

12-
setup_libcpp 12
1312
setup_android_ndk
1413
install_qnn
1514
pip install -r backends/qualcomm/requirements.txt

‎backends/qualcomm/scripts/install_qnn_sdk.sh‎

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -203,68 +203,3 @@ install_hexagon_sdk() {
203203
echo "Set HEXAGON_SDK_ROOT=${HEXAGON_SDK_ROOT}"
204204
echo "Set HEXAGON_TOOLS_ROOT=${HEXAGON_TOOLS_ROOT}"
205205
}
206-
207-
setup_libcpp() {
208-
clang_version=$1
209-
LLVM_VERSION="14.0.0"
210-
INSTALL_DIR="/tmp/libcxx-${LLVM_VERSION}"
211-
212-
# Check if we already have a local installation
213-
if [ -d "${INSTALL_DIR}/include" ] && [ -d "${INSTALL_DIR}/lib" ]; then
214-
echo "Local libc++ already installed at ${INSTALL_DIR} - skipping"
215-
# Set environment variables
216-
export CPLUS_INCLUDE_PATH="${INSTALL_DIR}/include:$CPLUS_INCLUDE_PATH"
217-
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:$LD_LIBRARY_PATH"
218-
export LIBRARY_PATH="${INSTALL_DIR}/lib:$LIBRARY_PATH"
219-
return
220-
fi
221-
222-
echo "Installing libc++ manually to ${INSTALL_DIR}"
223-
224-
# Create temporary directory
225-
TEMP_DIR=$(mktemp -d)
226-
# Ensure cleanup on exit or return
227-
trap 'rm -rf "$TEMP_DIR"' RETURN
228-
229-
pushd "${TEMP_DIR}" >/dev/null
230-
231-
BASE_NAME="clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-18.04"
232-
LLVM_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${BASE_NAME}.tar.xz"
233-
234-
echo "Downloading LLVM from ${LLVM_URL}"
235-
curl --retry 3 -fLO "${LLVM_URL}" || {
236-
echo "Error: Failed to download LLVM"
237-
exit 1
238-
}
239-
240-
echo "Extracting ${BASE_NAME}.tar.xz"
241-
tar -xf "${BASE_NAME}.tar.xz" || {
242-
echo "Error: Failed to extract LLVM archive"
243-
exit 1
244-
}
245-
246-
# Create installation directory
247-
mkdir -p "${INSTALL_DIR}/include"
248-
mkdir -p "${INSTALL_DIR}/lib"
249-
250-
# Copy libc++ headers and libraries
251-
cp -r "${BASE_NAME}/include/c++/v1/"* "${INSTALL_DIR}/include/"
252-
cp -r "${BASE_NAME}/lib/"*.so* "${INSTALL_DIR}/lib/"
253-
254-
popd >/dev/null
255-
256-
# Create necessary symlinks locally
257-
pushd "${INSTALL_DIR}/lib" >/dev/null
258-
ln -sf libc++.so.1.0 libc++.so.1
259-
ln -sf libc++.so.1 libc++.so
260-
ln -sf libc++abi.so.1.0 libc++abi.so.1
261-
ln -sf libc++abi.so.1 libc++abi.so
262-
popd >/dev/null
263-
264-
# Set environment variables
265-
export CPLUS_INCLUDE_PATH="${INSTALL_DIR}/include:${CPLUS_INCLUDE_PATH:-}"
266-
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:${LD_LIBRARY_PATH:-}"
267-
export LIBRARY_PATH="${INSTALL_DIR}/lib:${LIBRARY_PATH:-}"
268-
269-
echo "libc++ installed to ${INSTALL_DIR}"
270-
}

0 commit comments

Comments
 (0)