-
Notifications
You must be signed in to change notification settings - Fork 349
fix(ci): correct Android release packaging for x86_64 emulators #426
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 1 commit
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 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -391,12 +391,29 @@ jobs: | |||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| mkdir -p android-combined/jniLibs | ||||||||||||||||
| for dir in dist/android-artifacts/racommons-android-*/jniLibs/*/; do | ||||||||||||||||
| if [ -d "$dir" ]; then | ||||||||||||||||
| abi=$(basename "$dir") | ||||||||||||||||
| mkdir -p "android-combined/jniLibs/${abi}" | ||||||||||||||||
| cp -r "${dir}"* "android-combined/jniLibs/${abi}/" 2>/dev/null || true | ||||||||||||||||
| echo "Copied libs for ${abi}: $(ls android-combined/jniLibs/${abi}/ 2>/dev/null | wc -l) files" | ||||||||||||||||
| # Collect .so files from all build output subdirectories (jni/, commons/, onnx/, llamacpp/, rag/) | ||||||||||||||||
| # Each artifact was built for a single ABI via the matrix strategy | ||||||||||||||||
| for artifact_dir in dist/android-artifacts/racommons-android-*/; do | ||||||||||||||||
| if [ ! -d "$artifact_dir" ]; then | ||||||||||||||||
| continue | ||||||||||||||||
| fi | ||||||||||||||||
| for sub in jni commons onnx llamacpp rag; do | ||||||||||||||||
| for abi_dir in "${artifact_dir}${sub}"/*/; do | ||||||||||||||||
| if [ -d "$abi_dir" ]; then | ||||||||||||||||
| abi=$(basename "$abi_dir") | ||||||||||||||||
| mkdir -p "android-combined/jniLibs/${abi}" | ||||||||||||||||
| cp -n "${abi_dir}"*.so "android-combined/jniLibs/${abi}/" 2>/dev/null || true | ||||||||||||||||
|
Contributor
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.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! Prompt To Fix With AIThis is a comment left during a code review.
Path: .github/workflows/commons-release.yml
Line: 405
Comment:
`cp -n` silently skips existing files without logging. If duplicate `.so` names exist across subdirectories, only the first copy succeeds. Add `-v` flag for visibility into what's being copied vs skipped.
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.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. 🧩 Analysis chain🏁 Script executed: cd .github/workflows && wc -l commons-release.ymlRepository: RunanywhereAI/runanywhere-sdks Length of output: 97 🏁 Script executed: cat -n .github/workflows/commons-release.yml | sed -n '395,415p'Repository: RunanywhereAI/runanywhere-sdks Length of output: 1191 🏁 Script executed: head -20 .github/workflows/commons-release.ymlRepository: RunanywhereAI/runanywhere-sdks Length of output: 632 🏁 Script executed: rg "nullglob|set -o" .github/workflows/commons-release.ymlRepository: RunanywhereAI/runanywhere-sdks Length of output: 56 🏁 Script executed: grep -n "#!/bin/bash\|set -e\|set -u\|set -o" .github/workflows/commons-release.yml | head -20Repository: RunanywhereAI/runanywhere-sdks Length of output: 56 🏁 Script executed: rg "2>/dev/null" .github/workflows/commons-release.ymlRepository: RunanywhereAI/runanywhere-sdks Length of output: 275 Line 405: avoid swallowing all
Suggested hardening- cp -n "${abi_dir}"*.so "android-combined/jniLibs/${abi}/" 2>/dev/null || true
+ shopt -s nullglob
+ so_files=("${abi_dir}"*.so)
+ shopt -u nullglob
+ if [ ${`#so_files`[@]} -gt 0 ]; then
+ cp -n "${so_files[@]}" "android-combined/jniLibs/${abi}/"
+ fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| fi | ||||||||||||||||
| done | ||||||||||||||||
| done | ||||||||||||||||
| done | ||||||||||||||||
| # Log what was collected per ABI | ||||||||||||||||
| for abi_dir in android-combined/jniLibs/*/; do | ||||||||||||||||
| if [ -d "$abi_dir" ]; then | ||||||||||||||||
| abi=$(basename "$abi_dir") | ||||||||||||||||
| count=$(ls "$abi_dir"/*.so 2>/dev/null | wc -l) | ||||||||||||||||
| echo "Collected ${abi}: ${count} .so files" | ||||||||||||||||
| ls -la "$abi_dir" 2>/dev/null | ||||||||||||||||
| fi | ||||||||||||||||
|
Comment on lines
+410
to
417
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. Line 410-417 should enforce ABI correctness, not only log it. This block reports counts but never fails on missing/empty ABI folders. Add required-ABI assertions (and ideally an ELF machine check for key libs like Suggested validation gate- # Log what was collected per ABI
- for abi_dir in android-combined/jniLibs/*/; do
- if [ -d "$abi_dir" ]; then
- abi=$(basename "$abi_dir")
- count=$(ls "$abi_dir"/*.so 2>/dev/null | wc -l)
- echo "Collected ${abi}: ${count} .so files"
- ls -la "$abi_dir" 2>/dev/null
- fi
- done
+ # Validate required ABIs and collected libs
+ required_abis=(arm64-v8a armeabi-v7a x86_64 x86)
+ for abi in "${required_abis[@]}"; do
+ abi_dir="android-combined/jniLibs/${abi}"
+ if [ ! -d "$abi_dir" ]; then
+ echo "❌ Missing ABI directory: ${abi}" >&2
+ exit 1
+ fi
+ count=$(find "$abi_dir" -maxdepth 1 -name '*.so' | wc -l)
+ if [ "$count" -eq 0 ]; then
+ echo "❌ No .so files collected for ABI: ${abi}" >&2
+ exit 1
+ fi
+ echo "Collected ${abi}: ${count} .so files"
+ ls -la "$abi_dir"
+ done🤖 Prompt for AI Agents |
||||||||||||||||
| done | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
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.
Consider using
for sub in jni commons onnx llamacpp rag; doinstead of listing them without quotes for better shell safety and readability.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI