Skip to content

Commit 5ef19cb

Browse files
fix(ci): unblock first PR run — sherpa Linux URL, CMake bump, RAG include path
Three pre-existing C++/script bugs surfaced when adding Linux/Windows/Web to the matrix for the first time: 1. sherpa-onnx Linux x64 URL — script used the aarch64 naming pattern (`-shared-cpu`) for x64; the actual filename is `-shared` (no `-cpu` suffix) for x64. Also added a download-size sanity check so a 9-byte 404 page can no longer slip past curl into bzip2. 2. CMake version bump 3.22 → 3.27. cmake/FetchONNXRuntime.cmake uses the DOWNLOAD_EXTRACT_TIMESTAMP keyword which was added in 3.24, so 3.22 mis-parses it as part of the URL list and fails with "At least one entry of URL is a path". CMakeLists.txt's cmake_minimum_required(3.22) stays as documentation; CI installs 3.27. 3. RAG CMakeLists used ${CMAKE_SOURCE_DIR}/include for commons headers, which is wrong when commons is pulled in via add_subdirectory() from another project (e.g. sdk/runanywhere-web/wasm/). Switched to CMAKE_CURRENT_SOURCE_DIR-relative path that walks up to commons/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f66850f commit 5ef19cb

3 files changed

Lines changed: 27 additions & 7 deletions

File tree

sdk/runanywhere-commons/VERSIONS

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ JAVA_VERSION=17
4646
# Gradle wrapper version baseline
4747
GRADLE_VERSION=8.11.1
4848

49-
# CMake minimum version (matches sdk/runanywhere-commons/CMakeLists.txt:1)
50-
CMAKE_VERSION=3.22
49+
# CMake version installed in CI. Must be >= 3.24 because
50+
# cmake/FetchONNXRuntime.cmake uses the DOWNLOAD_EXTRACT_TIMESTAMP keyword
51+
# which was added in CMake 3.24. (The repo's CMakeLists.txt advertises
52+
# cmake_minimum_required(3.22) for build-system documentation, but the
53+
# toolchain installed in CI has to be 3.24+ to actually run the build.)
54+
CMAKE_VERSION=3.27
5155

5256
# =============================================================================
5357
# ONNX Runtime

sdk/runanywhere-commons/scripts/linux/download-sherpa-onnx.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ if [ "$ARCH" = "aarch64" ]; then
8787
URL="https://github.com/k2-fsa/sherpa-onnx/releases/download/v${VERSION}/sherpa-onnx-v${VERSION}-linux-aarch64-shared-cpu.tar.bz2"
8888
ARCHIVE_NAME="sherpa-onnx-v${VERSION}-linux-aarch64-shared-cpu"
8989
elif [ "$ARCH" = "x86_64" ]; then
90-
URL="https://github.com/k2-fsa/sherpa-onnx/releases/download/v${VERSION}/sherpa-onnx-v${VERSION}-linux-x64-shared-cpu.tar.bz2"
91-
ARCHIVE_NAME="sherpa-onnx-v${VERSION}-linux-x64-shared-cpu"
90+
# Note: sherpa-onnx publishes Linux x64 as `-shared` (no `-cpu` suffix);
91+
# aarch64 keeps the `-shared-cpu` suffix.
92+
URL="https://github.com/k2-fsa/sherpa-onnx/releases/download/v${VERSION}/sherpa-onnx-v${VERSION}-linux-x64-shared.tar.bz2"
93+
ARCHIVE_NAME="sherpa-onnx-v${VERSION}-linux-x64-shared"
9294
else
9395
print_error "Unsupported architecture: $ARCH"
9496
echo "Supported architectures: x86_64, aarch64"
@@ -121,7 +123,17 @@ TEMP_DIR=$(mktemp -d)
121123
trap "rm -rf ${TEMP_DIR}" EXIT
122124

123125
print_step "Downloading Sherpa-ONNX v${VERSION}..."
124-
curl -L -o "${TEMP_DIR}/sherpa-onnx.tar.bz2" "${URL}"
126+
# `--fail` makes curl exit non-zero on HTTP 4xx/5xx so a 404 page doesn't end
127+
# up being passed to tar/bzip2 below as a 9-byte "Not Found" file.
128+
curl -L --fail -o "${TEMP_DIR}/sherpa-onnx.tar.bz2" "${URL}"
129+
130+
# Sanity-check the archive size — anything under 1 MB is almost certainly an
131+
# error page that slipped past --fail (e.g. proxy-mediated redirect).
132+
DL_SIZE=$(stat -c%s "${TEMP_DIR}/sherpa-onnx.tar.bz2" 2>/dev/null || stat -f%z "${TEMP_DIR}/sherpa-onnx.tar.bz2")
133+
if [ "${DL_SIZE}" -lt 1048576 ]; then
134+
print_error "Downloaded file is suspiciously small (${DL_SIZE} bytes). URL may be wrong: ${URL}"
135+
exit 1
136+
fi
125137

126138
print_step "Extracting archive..."
127139
mkdir -p "${DEST_DIR}"

sdk/runanywhere-commons/src/features/rag/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ add_library(rac_backend_rag OBJECT ${RAG_PIPELINE_SOURCES} ${RAG_PIPELINE_HEADER
8181

8282
target_include_directories(rac_backend_rag PUBLIC
8383
${CMAKE_CURRENT_SOURCE_DIR}
84-
${CMAKE_SOURCE_DIR}/include
85-
${CMAKE_SOURCE_DIR}/include/rac/backends
84+
# Walk up from src/features/rag/ to commons/, then into include/. Uses
85+
# CMAKE_CURRENT_SOURCE_DIR (not CMAKE_SOURCE_DIR) so the path is correct
86+
# whether commons is the top-level CMake project or pulled in via
87+
# add_subdirectory() from another project (e.g., the Web/WASM build).
88+
${CMAKE_CURRENT_SOURCE_DIR}/../../../include
89+
${CMAKE_CURRENT_SOURCE_DIR}/../../../include/rac/backends
8690
${usearch_SOURCE_DIR}/include
8791
)
8892

0 commit comments

Comments
 (0)