From 1255af1e9c80de468cf9f09c094824718d69c9f9 Mon Sep 17 00:00:00 2001 From: Ian Chua Date: Fri, 2 Oct 2026 19:37:29 +0800 Subject: [PATCH] Bundle uv in Windows ARM64 builds (#16070) * fix: include bundled UV binary for arm64 * fix: update unit test CI * Install unit-test numpy only with the bundled uv * Simplify the unit-test script's uv lookup --------- Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com> Co-authored-by: SoftFever --- .github/workflows/unit_tests.yml | 8 -------- CMakeLists.txt | 6 +++++- scripts/run_unit_tests.sh | 8 ++++---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 41ef0b1f4b..f5850d9fd7 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -44,14 +44,6 @@ jobs: uses: actions/download-artifact@v8 with: name: ${{ inputs.artifact }} - # run_unit_tests.sh installs the plugin tests' numpy with the uv the build stages - # beside them; the Windows arm64 build bundles none, so put one on PATH there. - - name: Install uv - if: runner.os == 'Windows' && runner.arch == 'ARM64' - uses: astral-sh/setup-uv@v10.2.0 - with: - version: "0.11.21" # ORCA_UV_VERSION in CMakeLists.txt - enable-cache: false - uses: lukka/get-cmake@latest with: cmakeVersion: "~4.3.0" # use most recent 4.3.x version diff --git a/CMakeLists.txt b/CMakeLists.txt index 8607a33242..821d7e40c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,6 +135,7 @@ set(ORCA_UV_SHA256_aarch64-apple-darwin "1f921d491ba5ffeea774eb04d6681ecee3 set(ORCA_UV_SHA256_x86_64-apple-darwin "f3c8e5708a84b920c18b691214d54d2b0da6b984789caae95d47c95120cb7765") set(ORCA_UV_SHA256_aarch64-unknown-linux-gnu "88e800834007cc5efd4675f166eb2a51e7e3ad19876d85fa8805a6fb5c922397") set(ORCA_UV_SHA256_x86_64-unknown-linux-gnu "8c88519b0ef0af9801fcdee419bbb12116bd9e6b18e162ae093c932d8b264050") +set(ORCA_UV_SHA256_aarch64-pc-windows-msvc "74e443f8004022dde57a1bd0d10c097830f9ea8feb4ec927db52cd5d805c2f48") set(ORCA_UV_SHA256_x86_64-pc-windows-msvc "ace861f360c6de2babedc1607d0f454b6b09a820dbc8182dc15af927e4df9589") # Version-scoped cache dir so a version bump invalidates the cached binary. @@ -173,7 +174,10 @@ if(NOT ORCA_BUNDLED_UV_EXECUTABLE) set(ORCA_UV_ARCH "x86_64-unknown-linux-gnu") endif() elseif(_orca_uv_proc MATCHES "aarch64|arm64|ARM64") - if(APPLE) + if(WIN32) + set(ORCA_UV_ARCH "aarch64-pc-windows-msvc") + set(ORCA_UV_EXT "zip") + elseif(APPLE) set(ORCA_UV_ARCH "aarch64-apple-darwin") else() set(ORCA_UV_ARCH "aarch64-unknown-linux-gnu") diff --git a/scripts/run_unit_tests.sh b/scripts/run_unit_tests.sh index c4433df04d..5d2bd2b31d 100755 --- a/scripts/run_unit_tests.sh +++ b/scripts/run_unit_tests.sh @@ -53,12 +53,12 @@ python_exe="$(find "${find_args[@]}" -print -quit 2>/dev/null)" if [ -z "${python_exe}" ]; then numpy_unavailable "no bundled Python under ${TEST_DIR}" elif ! has_pinned_numpy; then + # Git Bash resolves this to uv.exe on Windows. Never fall back to a uv on PATH: + # the app only runs its bundled uv, so the tests must too. uv_exe="${python_exe%/python/*}/tools/uv/uv" - # Builds that bundle no uv (Windows arm64) fall back to one on PATH. - [ -x "${uv_exe}" ] || uv_exe="$(command -v uv)" echo "Installing numpy ${NUMPY_VERSION} into the embedded test interpreter (${python_exe})..." - if [ -z "${uv_exe}" ]; then - numpy_unavailable "no uv staged beside the tests or on PATH" + if [ ! -x "${uv_exe}" ]; then + numpy_unavailable "no uv staged beside the tests" elif ! "${uv_exe}" pip install --python "${python_exe}" --only-binary :all: "numpy==${NUMPY_VERSION}" \ || ! has_pinned_numpy; then numpy_unavailable "could not install numpy ${NUMPY_VERSION} into ${python_exe}"