Skip to content

Refactor Android build workflow: explicit SDK setup, unified /opt/android-deps prefix#21

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/refactor-android-sdk-setup
Draft

Refactor Android build workflow: explicit SDK setup, unified /opt/android-deps prefix#21
Copilot wants to merge 2 commits intomainfrom
copilot/refactor-android-sdk-setup

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 25, 2026

The build workflow lacked an explicit Android SDK/NDK download step and cross-compiled libraries were scattered across /tmp with library-specific paths. This refactor structures each Android build job into four clear phases: SDK download → cross-compile deps → build wheels → upload.

Changes

Android SDK download step (wheels.yml)

Added to all three build jobs (build_dependency_packages, build_independent_packages, build_dependent_packages). Runs only on Linux (Android targets):

- name: Download Android SDK
  if: steps.check-skip.outputs.skip != 'true' && runner.os == 'Linux'
  run: |
    sudo apt-get install -y unzip cmake ninja-build gcc wget curl autoconf automake libtool pkg-config meson
    wget -O ndk.zip https://dl.google.com/android/repository/android-ndk-r29-linux.zip
    sudo unzip ndk.zip -d /opt/Android/Sdk/ndk
    ...
    echo "ANDROID_NDK_ROOT=/opt/Android/Sdk/ndk/android-ndk-r29" >> "$GITHUB_ENV"

Unified cross-compile prefix for Android deps

All three library build scripts now install to /opt/android-deps/${ANDROID_ABI} instead of per-library paths under /tmp:

  • build_libjpeg.sh: /tmp/libjpeg-install-${ABI}/opt/android-deps/${ABI}
  • build_zlib.sh: /tmp/zlib-install-${ABI}/opt/android-deps/${ABI}
  • build_libtiff.sh: /tmp/libtiff-install-${ABI}/opt/android-deps/${ABI}

Updated library discovery

  • cross_compile_libs_detect.patch: replaced three separate /tmp/*-install-*/include globs with a single glob('/opt/android-deps/*/include') that covers all libs per ABI in one pass
  • setup_cross_compile_env.sh: added /opt/android-deps/* as a primary search location

cibuildwheel env passthrough

CIBW_ENVIRONMENT_PASS_LINUX in all three jobs now includes ANDROID_SDK_ROOT ANDROID_HOME ANDROID_NDK_ROOT so the SDK paths are available inside the cibuildwheel build environment.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ps prefix for cross-compiled libs

Co-authored-by: Creeper19472 <38857196+Creeper19472@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor Android SDK setup workflow Refactor Android build workflow: explicit SDK setup, unified /opt/android-deps prefix Feb 25, 2026
Copilot AI requested a review from Creeper19472 February 25, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants