-
Notifications
You must be signed in to change notification settings - Fork 371
fix(release): kit sha256 sidecars must be basenames #787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2d43c49
2bb2091
98a3ec5
94480fc
b12d07b
065c8da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -80,6 +80,14 @@ on: | |||||||||||||||||||||||||||||||||
| run's kit artifacts with this run's. | ||||||||||||||||||||||||||||||||||
| type: boolean | ||||||||||||||||||||||||||||||||||
| default: false | ||||||||||||||||||||||||||||||||||
| reuse_cpp_desktop_run_id: | ||||||||||||||||||||||||||||||||||
| description: >- | ||||||||||||||||||||||||||||||||||
| Run id whose cpp-desktop-* artifacts to attach instead of rebuilding kits | ||||||||||||||||||||||||||||||||||
| (skips the five kit/overlay jobs). Use with publish_from_run_id when a | ||||||||||||||||||||||||||||||||||
| prior rebuild_cpp_desktop run already packaged routable kits but publish | ||||||||||||||||||||||||||||||||||
| itself failed (e.g. sidecar path prefix). | ||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||
| default: '' | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||
|
|
@@ -411,7 +419,7 @@ jobs: | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| native_cpp_desktop_macos: | ||||||||||||||||||||||||||||||||||
| needs: validate | ||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.publish_from_run_id || inputs.rebuild_cpp_desktop }} | ||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.publish_from_run_id || (inputs.rebuild_cpp_desktop && inputs.reuse_cpp_desktop_run_id == '') }} | ||||||||||||||||||||||||||||||||||
| runs-on: macos-14 | ||||||||||||||||||||||||||||||||||
| timeout-minutes: 90 | ||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
|
|
@@ -432,8 +440,13 @@ jobs: | |||||||||||||||||||||||||||||||||
| ls -la dist/RunAnywhere-cpp-desktop-macos-arm64-v*.tar.gz | ||||||||||||||||||||||||||||||||||
| tar=$(echo dist/RunAnywhere-cpp-desktop-macos-arm64-v*.tar.gz) | ||||||||||||||||||||||||||||||||||
| python3 scripts/ci/verify_cpp_desktop_kit.py "$tar" --source-root . --forbid-private-engines | ||||||||||||||||||||||||||||||||||
| shasum -a 256 dist/RunAnywhere-cpp-desktop-macos-arm64-v*.tar.gz \ | ||||||||||||||||||||||||||||||||||
| | tee "dist/RunAnywhere-cpp-desktop-macos-arm64-v$(tr -d '[:space:]' < core/VERSION).tar.gz.sha256" | ||||||||||||||||||||||||||||||||||
| # Basename only — `sha256sum -c` in publish runs inside release-flat. | ||||||||||||||||||||||||||||||||||
| # `shasum dist/foo.tar.gz` writes `dist/foo.tar.gz` and fails there. | ||||||||||||||||||||||||||||||||||
| ( | ||||||||||||||||||||||||||||||||||
| cd dist | ||||||||||||||||||||||||||||||||||
| name="RunAnywhere-cpp-desktop-macos-arm64-v$(tr -d '[:space:]' < ../core/VERSION).tar.gz" | ||||||||||||||||||||||||||||||||||
| shasum -a 256 "$name" | tee "$name.sha256" | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| - uses: actions/upload-artifact@v7 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| name: cpp-desktop-macos | ||||||||||||||||||||||||||||||||||
|
|
@@ -445,7 +458,7 @@ jobs: | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| native_cpp_desktop_windows: | ||||||||||||||||||||||||||||||||||
| needs: validate | ||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.publish_from_run_id || inputs.rebuild_cpp_desktop }} | ||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.publish_from_run_id || (inputs.rebuild_cpp_desktop && inputs.reuse_cpp_desktop_run_id == '') }} | ||||||||||||||||||||||||||||||||||
| runs-on: windows-2022 | ||||||||||||||||||||||||||||||||||
| timeout-minutes: 120 | ||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
|
|
@@ -490,7 +503,7 @@ jobs: | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| native_cpp_desktop_windows_arm64: | ||||||||||||||||||||||||||||||||||
| needs: validate | ||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.publish_from_run_id || inputs.rebuild_cpp_desktop }} | ||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.publish_from_run_id || (inputs.rebuild_cpp_desktop && inputs.reuse_cpp_desktop_run_id == '') }} | ||||||||||||||||||||||||||||||||||
| runs-on: windows-11-arm | ||||||||||||||||||||||||||||||||||
| timeout-minutes: 90 | ||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
|
|
@@ -541,7 +554,7 @@ jobs: | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| native_cpp_desktop_macos_neurt_private: | ||||||||||||||||||||||||||||||||||
| needs: validate | ||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.publish_from_run_id || inputs.rebuild_cpp_desktop }} | ||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.publish_from_run_id || (inputs.rebuild_cpp_desktop && inputs.reuse_cpp_desktop_run_id == '') }} | ||||||||||||||||||||||||||||||||||
| runs-on: macos-14 | ||||||||||||||||||||||||||||||||||
| timeout-minutes: 90 | ||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
|
|
@@ -582,7 +595,7 @@ jobs: | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| native_cpp_desktop_windows_qhexrt_private: | ||||||||||||||||||||||||||||||||||
| needs: validate | ||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.publish_from_run_id || inputs.rebuild_cpp_desktop }} | ||||||||||||||||||||||||||||||||||
| if: ${{ !inputs.publish_from_run_id || (inputs.rebuild_cpp_desktop && inputs.reuse_cpp_desktop_run_id == '') }} | ||||||||||||||||||||||||||||||||||
| runs-on: windows-11-arm | ||||||||||||||||||||||||||||||||||
| timeout-minutes: 120 | ||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
|
|
@@ -2045,18 +2058,18 @@ jobs: | |||||||||||||||||||||||||||||||||
| run-id: ${{ inputs.reuse_native_web_run_id }} | ||||||||||||||||||||||||||||||||||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||
| # Stub kits from the reused candidate must not ship. Drop them, then | ||||||||||||||||||||||||||||||||||
| # take this run's rebuilt tarballs (same artifact names). | ||||||||||||||||||||||||||||||||||
| # take rebuilt tarballs (this run, or reuse_cpp_desktop_run_id). | ||||||||||||||||||||||||||||||||||
| - name: Drop stub C++ desktop kits from the reused run | ||||||||||||||||||||||||||||||||||
| if: ${{ inputs.publish_from_run_id != '' && inputs.rebuild_cpp_desktop }} | ||||||||||||||||||||||||||||||||||
| if: ${{ inputs.publish_from_run_id != '' && (inputs.rebuild_cpp_desktop || inputs.reuse_cpp_desktop_run_id != '') }} | ||||||||||||||||||||||||||||||||||
| run: rm -rf release-artifacts/cpp-desktop-* | ||||||||||||||||||||||||||||||||||
| - name: Replace C++ desktop kits from this run | ||||||||||||||||||||||||||||||||||
| if: ${{ inputs.publish_from_run_id != '' && inputs.rebuild_cpp_desktop }} | ||||||||||||||||||||||||||||||||||
| if: ${{ inputs.publish_from_run_id != '' && (inputs.rebuild_cpp_desktop || inputs.reuse_cpp_desktop_run_id != '') }} | ||||||||||||||||||||||||||||||||||
| uses: actions/download-artifact@v8 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| pattern: cpp-desktop-* | ||||||||||||||||||||||||||||||||||
| path: release-artifacts | ||||||||||||||||||||||||||||||||||
| merge-multiple: false | ||||||||||||||||||||||||||||||||||
| run-id: ${{ github.run_id }} | ||||||||||||||||||||||||||||||||||
| run-id: ${{ inputs.reuse_cpp_desktop_run_id || github.run_id }} | ||||||||||||||||||||||||||||||||||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||
| - name: Flatten + index assets | ||||||||||||||||||||||||||||||||||
| # Collision-detecting flatten. The previous `find ... -exec cp` form | ||||||||||||||||||||||||||||||||||
|
|
@@ -2209,6 +2222,15 @@ jobs: | |||||||||||||||||||||||||||||||||
| ( | ||||||||||||||||||||||||||||||||||
| cd release-flat | ||||||||||||||||||||||||||||||||||
| for checksum in *.sha256; do | ||||||||||||||||||||||||||||||||||
| # Sidecars must name the basename in this directory. macOS kit | ||||||||||||||||||||||||||||||||||
| # jobs used to write `dist/foo.tar.gz`; rewrite so -c succeeds | ||||||||||||||||||||||||||||||||||
| # and the published sidecar is consumer-usable. | ||||||||||||||||||||||||||||||||||
| # macOS kit sidecars used to name dist/foo.tar.gz. Strip a | ||||||||||||||||||||||||||||||||||
| # directory prefix only — GNU sha256sum binary lines are | ||||||||||||||||||||||||||||||||||
| # `hash *file` and must keep the asterisk. | ||||||||||||||||||||||||||||||||||
| if grep -q ' .*/' "$checksum"; then | ||||||||||||||||||||||||||||||||||
| sed -i -E 's| .+/| |' "$checksum" | ||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+2225
to
+2233
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- workflow context ---'
sed -n '2180,2260p' .github/workflows/release.yml
printf '%s\n' '--- checksum-related workflow references ---'
rg -n -C 3 'checksum|sha256sum|release-flat|publish_from_run_id' .github/workflows/release.yml
printf '%s\n' '--- tracked workflow files ---'
git ls-files '.github/workflows/*'Repository: RunanywhereAI/runanywhere-sdks Length of output: 28108 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- C++ kit checksum generation ---'
sed -n '420,470p' .github/workflows/release.yml
sed -n '459,525p' .github/workflows/release.yml
sed -n '550,620p' .github/workflows/release.yml
printf '%s\n' '--- checksum-producing commands in tracked files ---'
rg -n -C 2 '(^|[[:space:]])(sha256sum|shasum)([[:space:]]|$)|\\.sha256|checksum' --glob '!*.lock' .
printf '%s\n' '--- GNU checksum output and current/proposed normalization ---'
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
printf 'payload\n' > "$tmpdir/file"
digest="$(sha256sum "$tmpdir/file" | cut -d' ' -f1)"
printf '%s\n' "$digest dist/file" > "$tmpdir/text.sha256"
printf '%s\n' "$digest *dist/file" > "$tmpdir/binary.sha256"
for f in "$tmpdir/text.sha256" "$tmpdir/binary.sha256"; do
printf 'before %s: ' "$(basename "$f")"
sed -n l "$f"
if grep -q ' .*/' "$f"; then
sed -i -E 's| .+/| |' "$f"
fi
printf 'current %s: ' "$(basename "$f")"
sed -n l "$f"
done
printf '%s\n' "$digest *dist/file" > "$tmpdir/proposed.sha256"
sed -i -E 's|^([0-9a-fA-F]{64}[[:space:]]+\*?)[^/]*/|\1|' "$tmpdir/proposed.sha256"
printf 'proposed binary: '
sed -n l "$tmpdir/proposed.sha256"Repository: RunanywhereAI/runanywhere-sdks Length of output: 50387 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- C++ kit checksum generation ---'
sed -n '420,470p' .github/workflows/release.yml
sed -n '459,525p' .github/workflows/release.yml
sed -n '550,620p' .github/workflows/release.yml
printf '%s\n' '--- checksum-producing commands in workflow and release scripts ---'
rg -n -C 2 'sha256sum|shasum|\\.sha256' .github/workflows scripts bindings --glob '*.yml' --glob '*.yaml' --glob '*.sh' --glob '*.bat' --glob '*.ps1' 2>/dev/null | head -n 300
printf '%s\n' '--- GNU checksum output and normalization behavior ---'
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
printf 'payload\n' > "$tmpdir/file"
digest="$(sha256sum "$tmpdir/file" | cut -d' ' -f1)"
printf '%s\n' "$digest dist/file" > "$tmpdir/text.sha256"
printf '%s\n' "$digest *dist/file" > "$tmpdir/binary.sha256"
for f in "$tmpdir/text.sha256" "$tmpdir/binary.sha256"; do
printf 'before %s: ' "$(basename "$f")"
sed -n l "$f"
if grep -q ' .*/' "$f"; then
sed -i -E 's| .+/| |' "$f"
fi
printf 'current %s: ' "$(basename "$f")"
sed -n l "$f"
done
printf '%s\n' "$digest *dist/file" > "$tmpdir/proposed.sha256"
sed -i -E 's|^([0-9a-fA-F]{64}[[:space:]]+\*?)[^/]*/|\1|' "$tmpdir/proposed.sha256"
printf 'proposed binary: '
sed -n l "$tmpdir/proposed.sha256"Repository: RunanywhereAI/runanywhere-sdks Length of output: 24939 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
mkdir -p "$tmpdir/release-flat"
printf 'payload\n' > "$tmpdir/release-flat/file"
digest="$(sha256sum "$tmpdir/release-flat/file" | awk '{print $1}')"
printf '%s *dist/file\n' "$digest" > "$tmpdir/release-flat/file.sha256"
printf '%s\n' '--- current workflow behavior ---'
(
cd "$tmpdir/release-flat"
if grep -q ' .*/' file.sha256; then
sed -i -E 's| .+/| |' file.sha256
fi
sha256sum --check file.sha256
) && current_status=0 || current_status=$?
printf 'current_status=%s\n' "$current_status"
printf 'current_sidecar='
sed -n l "$tmpdir/release-flat/file.sha256"
printf '%s\n' '--- proposed normalization behavior ---'
printf '%s *dist/file\n' "$digest" > "$tmpdir/release-flat/file.sha256"
sed -i -E 's|^([0-9a-fA-F]{64}[[:space:]]+\*?)[^/]*/|\1|' "$tmpdir/release-flat/file.sha256"
(
cd "$tmpdir/release-flat"
sha256sum --check file.sha256
)
printf 'proposed_sidecar='
sed -n l "$tmpdir/release-flat/file.sha256"
printf '%s\n' '--- native formatter shapes ---'
printf 'shasum: '
if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$tmpdir/release-flat/file"; else echo unavailable; fi
printf 'sha256sum: '
sha256sum "$tmpdir/release-flat/file"
printf 'sha256sum -b: '
sha256sum -b "$tmpdir/release-flat/file"Repository: RunanywhereAI/runanywhere-sdks Length of output: 872 Normalize binary-marked checksum paths. When a sidecar contains - if grep -q ' .*/' "$checksum"; then
- sed -i -E 's| .+/| |' "$checksum"
- fi
+ sed -i -E 's|^([0-9a-fA-F]{64}[[:space:]]+\*?)[^/]*/|\1|' "$checksum"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| sha256sum --check "$checksum" | ||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,6 +86,16 @@ if(NOT TARGET RunAnywhere::commons) | |
| endif() | ||
| endif() | ||
| endforeach() | ||
| # Transitive SHARED deps of whole-archived backends must follow them on | ||
| # MSVC (one-pass). Apple ld is more forgiving but the same order is correct. | ||
| if(WIN32) | ||
| file(GLOB _sherpa_implibs "${RunAnywhere_LIBRARY_DIR}/sherpa-onnx*.lib") | ||
| list(APPEND _runanywhere_kit_extra ${_sherpa_implibs}) | ||
| endif() | ||
| if(APPLE AND EXISTS "${RunAnywhere_LIBRARY_DIR}/libonnxruntime.a") | ||
| list(APPEND _runanywhere_kit_extra | ||
| "${RunAnywhere_LIBRARY_DIR}/libonnxruntime.a") | ||
| endif() | ||
|
Comment on lines
+95
to
+98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
# Run on macOS with a produced macOS desktop-kit tarball as $1.
set -euo pipefail
tarball="${1:?usage: $0 path/to/RunAnywhere-cpp-desktop-macos-*.tar.gz}"
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
tar -xzf "$tarball" -C "$tmp"
prefix="$(find "$tmp" -mindepth 1 -maxdepth 1 -type d -print -quit)"
mkdir -p "$tmp/consumer"
cat >"$tmp/consumer/CMakeLists.txt" <<'EOF'
cmake_minimum_required(VERSION 3.24)
project(runanywhere_kit_link LANGUAGES CXX)
find_package(RunAnywhere CONFIG REQUIRED)
add_executable(consumer main.cpp)
target_link_libraries(consumer PRIVATE RunAnywhere::commons)
EOF
printf 'int main() { return 0; }\n' >"$tmp/consumer/main.cpp"
cmake -S "$tmp/consumer" -B "$tmp/build" -DCMAKE_PREFIX_PATH="$prefix"
cmake --build "$tmp/build" --verboseRepository: RunanywhereAI/runanywhere-sdks Length of output: 244 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- target file ---'
nl -ba cmake/RunAnywhereConfig.cmake.in | sed -n '45,110p'
printf '%s\n' '--- extra-library definitions and consumers ---'
rg -n -C 4 'RUNANYWHERE_KIT_EXTRA_LIBS|_runanywhere_kit_extra|libsherpa-onnx-c-api|librac_backend_sherpa|libonnxruntime' cmake CMakeLists.txt 2>/dev/null || true
printf '%s\n' '--- tracked archive-related CMake files ---'
git ls-files | rg '(^|/)(CMakeLists\.txt|.*\.cmake(\.in)?)$' | sed -n '1,160p'Repository: RunanywhereAI/runanywhere-sdks Length of output: 228 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- target file ---'
sed -n '45,110p' cmake/RunAnywhereConfig.cmake.in
printf '%s\n' '--- extra-library definitions and consumers ---'
rg -n -C 4 'RUNANYWHERE_KIT_EXTRA_LIBS|_runanywhere_kit_extra|libsherpa-onnx-c-api|librac_backend_sherpa|libonnxruntime' cmake CMakeLists.txt 2>/dev/null || true
printf '%s\n' '--- tracked archive-related CMake files ---'
git ls-files | rg '(^|/)(CMakeLists\.txt|.*\.cmake(\.in)?)$' | sed -n '1,160p'Repository: RunanywhereAI/runanywhere-sdks Length of output: 15534 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- PackageCppDesktop extra-link construction ---'
sed -n '80,145p' cmake/PackageCppDesktop.cmake
sed -n '214,305p' cmake/PackageCppDesktop.cmake
sed -n '305,342p' cmake/PackageCppDesktop.cmake
printf '%s\n' '--- Sherpa build/link declarations ---'
rg -n -C 6 'sherpa-onnx-c-api|rac_backend_sherpa|target_link_libraries|WHOLE_ARCHIVE|force_load' engines/sherpa cmake core CMakeLists.txtRepository: RunanywhereAI/runanywhere-sdks Length of output: 50387 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- kit archive list generation ---'
rg -n -C 8 'RAC_KIT_LIBS_FILE|_kit_genex|RUNANYWHERE_KIT_EXTRA_LIBS|file\(GLOB .*sherpa|_sherpa_as' cmake/CppDesktopKit.cmake cmake/PackageCppDesktop.cmake
printf '%s\n' '--- focused Sherpa and ONNX declarations ---'
rg -n -C 5 'sherpa-onnx-c-api|SHERPA_ONNX|Fetch.*Sherpa|rac_add_engine_plugin' engines/sherpa engines/onnx cmake CMakeLists.txt | sed -n '1,260p'
printf '%s\n' '--- available standalone linker tools ---'
command -v cc || true
command -v clang || true
command -v ar || true
command -v ld || trueRepository: RunanywhereAI/runanywhere-sdks Length of output: 30033 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
cd "$tmp"
cat > main.c <<'EOF'
extern void backend_entry(void);
int main(void) { backend_entry(); return 0; }
EOF
cat > backend.c <<'EOF'
extern void sherpa_api(void);
void backend_entry(void) { sherpa_api(); }
EOF
cat > capi.c <<'EOF'
extern void ort(void);
void sherpa_api(void) { ort(); }
EOF
cat > ort.c <<'EOF'
void ort(void) {}
EOF
cc -c main.c backend.c capi.c ort.c
ar rcs libbackend.a backend.o
ar rcs libcapi.a capi.o
ar rcs libort.a ort.o
printf '%s\n' '--- lazy C API before whole-archived backend, then ORT ---'
if cc main.o libcapi.a -Wl,--whole-archive libbackend.a -Wl,--no-whole-archive libort.a -o broken 2>"$tmp/broken.err"; then
echo 'unexpected link success'
else
echo 'link failed as expected'
sed -n '1,8p' "$tmp/broken.err"
fi
printf '%s\n' '--- C API repeated after whole-archived backend, then ORT ---'
cc main.o libcapi.a -Wl,--whole-archive libbackend.a -Wl,--no-whole-archive libcapi.a libort.a -o fixed
echo 'link succeeded'Repository: RunanywhereAI/runanywhere-sdks Length of output: 497 Append
🤖 Prompt for AI Agents |
||
| # Unix: link the unversioned ORT dylib. Versioned copies | ||
| # (libonnxruntime.1.dylib) are Mach-O stubs and fail to load. | ||
| # Windows: never pass onnxruntime.dll to link.exe (LNK1107). The import | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -186,8 +186,19 @@ def main() -> int: | |||||||||||||||||||||||||||||||||
| if args.windows: | ||||||||||||||||||||||||||||||||||
| if not any("sherpa-onnx-c-api.dll" in n.replace("\\", "/") for n in canon): | ||||||||||||||||||||||||||||||||||
| missing.append("third_party/sherpa-onnx-c-api.dll") | ||||||||||||||||||||||||||||||||||
| elif not any(n.replace("\\", "/").endswith("libsherpa-onnx-c-api.a") for n in canon): | ||||||||||||||||||||||||||||||||||
| missing.append("lib/libsherpa-onnx-c-api.a") | ||||||||||||||||||||||||||||||||||
| if not any(n.replace("\\", "/").endswith("sherpa-onnx-c-api.lib") for n in canon): | ||||||||||||||||||||||||||||||||||
| missing.append("lib/sherpa-onnx-c-api.lib") | ||||||||||||||||||||||||||||||||||
| # Windows Sherpa-ONNX is SHARED: ORT is onnxruntime.dll + | ||||||||||||||||||||||||||||||||||
| # onnxruntime.lib (checked above), never libonnxruntime.a. | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+189
to
+192
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Require ONNX Runtime when the kit contains a Windows Sherpa backend. When If Proposed fix if args.windows:
if not any("sherpa-onnx-c-api.dll" in n.replace("\\", "/") for n in canon):
missing.append("third_party/sherpa-onnx-c-api.dll")
if not any(n.replace("\\", "/").endswith("sherpa-onnx-c-api.lib") for n in canon):
missing.append("lib/sherpa-onnx-c-api.lib")
+ if args.allow_missing_onnxruntime:
+ if not any(n.endswith("onnxruntime.lib") for n in names):
+ missing.append("lib/onnxruntime.lib")
+ if not any(
+ n.replace("\\", "/").endswith("third_party/onnxruntime.dll")
+ for n in names
+ ):
+ missing.append("third_party/onnxruntime.dll")
# Windows Sherpa-ONNX is SHARED: ORT is onnxruntime.dll +
# onnxruntime.lib (checked above), never libonnxruntime.a.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||||
| if not any(n.replace("\\", "/").endswith("libsherpa-onnx-c-api.a") for n in canon): | ||||||||||||||||||||||||||||||||||
| missing.append("lib/libsherpa-onnx-c-api.a") | ||||||||||||||||||||||||||||||||||
| if not any( | ||||||||||||||||||||||||||||||||||
| n.replace("\\", "/").endswith("libonnxruntime.a") | ||||||||||||||||||||||||||||||||||
| or n.replace("\\", "/").endswith("third_party/libonnxruntime.dylib") | ||||||||||||||||||||||||||||||||||
| for n in canon | ||||||||||||||||||||||||||||||||||
| ): | ||||||||||||||||||||||||||||||||||
| missing.append("lib/libonnxruntime.a (or third_party/libonnxruntime.dylib)") | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| private_hits = [n for n in canon if "neurt" in n.lower() or "qhexrt" in n.lower()] | ||||||||||||||||||||||||||||||||||
| if args.forbid_private_engines and private_hits: | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: RunanywhereAI/runanywhere-sdks
Length of output: 17562
🏁 Script executed:
Repository: RunanywhereAI/runanywhere-sdks
Length of output: 36280
Handle the conflicting C++ desktop inputs.
When
rebuild_cpp_desktopistrueandreuse_cpp_desktop_run_idis non-empty, the five C++ jobs are skipped, butpublishstill requires all five results to besuccess. Allow the reuse ID to bypass this gate, or reject this input combination during validation.🤖 Prompt for AI Agents
Source: MCP tools