From d931ab843e03bcde94676c6111a75c9f86561b4b Mon Sep 17 00:00:00 2001 From: Anthony Shoumikhin Date: Thu, 22 Oct 2026 23:16:36 -0700 Subject: [PATCH] Drop the unused LLVM download from setup-qnn-deps.sh setup-qnn-deps.sh calls setup_libcpp, which downloads a 575 MB LLVM release from GitHub. A connection reset during that download fails QNN CI jobs, but nothing uses what it installs: - Every workflow runs setup-qnn-deps.sh with bash, so the paths setup_libcpp exports are gone when the script exits, and nothing else reads its install folder. - Its copy step does not even pick up libc++. The libc++ libraries sit in a subfolder its glob does not reach. - The QNN backend test jobs never call it and pass. The CI image gets libc++ from the system package. Remove the call and the function, which nothing else uses. This fixes the flaky download and saves about half a minute per QNN job. --- .ci/scripts/setup-qnn-deps.sh | 1 - backends/qualcomm/scripts/install_qnn_sdk.sh | 65 -------------------- 2 files changed, 66 deletions(-) diff --git a/.ci/scripts/setup-qnn-deps.sh b/.ci/scripts/setup-qnn-deps.sh index 8b1afecd47a..ca555f507f3 100644 --- a/.ci/scripts/setup-qnn-deps.sh +++ b/.ci/scripts/setup-qnn-deps.sh @@ -9,7 +9,6 @@ set -ex source "$(dirname "${BASH_SOURCE[0]}")/../../backends/qualcomm/scripts/install_qnn_sdk.sh" -setup_libcpp 12 setup_android_ndk install_qnn pip install -r backends/qualcomm/requirements.txt \ No newline at end of file diff --git a/backends/qualcomm/scripts/install_qnn_sdk.sh b/backends/qualcomm/scripts/install_qnn_sdk.sh index a7a9e3ba5e5..0d5516bf567 100644 --- a/backends/qualcomm/scripts/install_qnn_sdk.sh +++ b/backends/qualcomm/scripts/install_qnn_sdk.sh @@ -203,68 +203,3 @@ install_hexagon_sdk() { echo "Set HEXAGON_SDK_ROOT=${HEXAGON_SDK_ROOT}" echo "Set HEXAGON_TOOLS_ROOT=${HEXAGON_TOOLS_ROOT}" } - -setup_libcpp() { - clang_version=$1 - LLVM_VERSION="14.0.0" - INSTALL_DIR="/tmp/libcxx-${LLVM_VERSION}" - - # Check if we already have a local installation - if [ -d "${INSTALL_DIR}/include" ] && [ -d "${INSTALL_DIR}/lib" ]; then - echo "Local libc++ already installed at ${INSTALL_DIR} - skipping" - # Set environment variables - export CPLUS_INCLUDE_PATH="${INSTALL_DIR}/include:$CPLUS_INCLUDE_PATH" - export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:$LD_LIBRARY_PATH" - export LIBRARY_PATH="${INSTALL_DIR}/lib:$LIBRARY_PATH" - return - fi - - echo "Installing libc++ manually to ${INSTALL_DIR}" - - # Create temporary directory - TEMP_DIR=$(mktemp -d) - # Ensure cleanup on exit or return - trap 'rm -rf "$TEMP_DIR"' RETURN - - pushd "${TEMP_DIR}" >/dev/null - - BASE_NAME="clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-18.04" - LLVM_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${BASE_NAME}.tar.xz" - - echo "Downloading LLVM from ${LLVM_URL}" - curl --retry 3 -fLO "${LLVM_URL}" || { - echo "Error: Failed to download LLVM" - exit 1 - } - - echo "Extracting ${BASE_NAME}.tar.xz" - tar -xf "${BASE_NAME}.tar.xz" || { - echo "Error: Failed to extract LLVM archive" - exit 1 - } - - # Create installation directory - mkdir -p "${INSTALL_DIR}/include" - mkdir -p "${INSTALL_DIR}/lib" - - # Copy libc++ headers and libraries - cp -r "${BASE_NAME}/include/c++/v1/"* "${INSTALL_DIR}/include/" - cp -r "${BASE_NAME}/lib/"*.so* "${INSTALL_DIR}/lib/" - - popd >/dev/null - - # Create necessary symlinks locally - pushd "${INSTALL_DIR}/lib" >/dev/null - ln -sf libc++.so.1.0 libc++.so.1 - ln -sf libc++.so.1 libc++.so - ln -sf libc++abi.so.1.0 libc++abi.so.1 - ln -sf libc++abi.so.1 libc++abi.so - popd >/dev/null - - # Set environment variables - export CPLUS_INCLUDE_PATH="${INSTALL_DIR}/include:${CPLUS_INCLUDE_PATH:-}" - export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:${LD_LIBRARY_PATH:-}" - export LIBRARY_PATH="${INSTALL_DIR}/lib:${LIBRARY_PATH:-}" - - echo "libc++ installed to ${INSTALL_DIR}" -}