Skip to content

Commit 7a23d6f

Browse files
zhmiaoCopilot
andcommitted
ci(rp-4): Windows CLI — install zip via choco + as_posix() on ORT_CAPI
build-cli-windows v0.1.7 (CI run 26522212284) still failed at 'Package zip' despite the bsdtar fallback in package_cli_tarball.sh. Root cause: Git Bash on windows-latest shadows the Windows-native tar.exe (bsdtar) with its own GNU /usr/bin/tar, so the bsdtar-detection branch never fires, and the standalone zip binary is also absent from default PATH. Fixes: - Stage ORT runtime: emit ORT_STAGE_DIR with .as_posix() so the path uses forward slashes consistently; mixed slashes from default pathlib repr (C:\foo\bar) caused the script's bash tests to behave inconsistently under MSYS. - New step 'Install zip via choco' before the packaging step. choco is pre-installed on windows-latest runners; the zip package wraps the standard Info-ZIP build. Once zip is on PATH, the existing script branch picks it up. This is belt-and-suspenders: even if bsdtar detection had worked, having zip available is the more portable answer (matches what the macOS / Linux jobs implicitly assume — that their packaging primitive is on PATH). Recovery: cut v0.1.8 from this HEAD to validate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8b1ea96 commit 7a23d6f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,9 +723,17 @@ jobs:
723723
rm -rf "$ORT_VENV"
724724
python3 -m venv "$ORT_VENV"
725725
"$ORT_VENV/Scripts/pip" install --quiet "onnxruntime>=1.25.1,<1.26"
726-
ORT_CAPI=$("$ORT_VENV/Scripts/python" -c "import onnxruntime, pathlib; print(pathlib.Path(onnxruntime.__file__).parent / 'capi')")
726+
# `.as_posix()` so the path uses forward slashes even on Windows
727+
# (default pathlib repr is `C:\foo\bar`). The packaging script's
728+
# bash path tests (`[[ -d $ort_capi ]]`) and command substitutions
729+
# are more reliable with forward slashes under Git Bash + MSYS.
730+
ORT_CAPI=$("$ORT_VENV/Scripts/python" -c "import onnxruntime, pathlib; print((pathlib.Path(onnxruntime.__file__).parent / 'capi').as_posix())")
727731
echo "ORT_STAGE_DIR=$ORT_CAPI" >> "$GITHUB_ENV"
728732
733+
- name: Install zip (MSYS Git Bash does not ship it by default)
734+
shell: pwsh
735+
run: choco install zip -y --no-progress --no-color
736+
729737
- name: Build spe.exe (release, CPU flavor, Windows x86_64)
730738
working-directory: sparrow-engine
731739
shell: bash

0 commit comments

Comments
 (0)