Skip to content

Commit d247c8d

Browse files
committed
Add libpython3.so to python-android-dart-*.tar.gz
The abi3 stub libpython3.so forwards Limited API symbols to the version-specific libpython3.X.so. The dart-bridge repo's libdart_bridge-android-*.so links against this stub (DT_NEEDED libpython3.so), so it has to be present at runtime alongside the version-specific libpython that serious_python_android already ships in the APK's jniLibs. mobile-forge produces libpython3.so in the install tree ($install_root/android/<abi>/python-<X.Y.Z>/lib/libpython3.so); package-for-dart.sh just wasn't copying it into the tarball before nuking $build_dir/lib. Add a single cp alongside the existing libpython3.X.so copy. CI gating (temporary, marked TODO in comments): - build-{darwin,linux,windows}: skipped on dart-bridge branch so the iteration cycle for this Android-only artifact change doesn't fan out to slow Darwin/Linux/Windows rebuilds. - publish-release: extended to publish from dart-bridge branch too, and allows skipped sibling needs (won't cascade-skip if build-darwin/linux/windows are gated off). Reverts to main-branch-only publish once Android is verified end-to-end.
1 parent 923bfec commit d247c8d

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

.github/workflows/build-python-version.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ permissions:
3131
jobs:
3232
build-darwin:
3333
name: Build Python for iOS and macOS
34+
# TEMPORARY: disabled on dart-bridge branch so the Android-only re-release
35+
# (adding libpython3.so to python-android-dart tarball) doesn't fan out to
36+
# slow Darwin/Linux/Windows builds. Revert this `if:` once Android is
37+
# verified end-to-end.
38+
if: github.ref != 'refs/heads/dart-bridge'
3439
runs-on: macos-26
3540
steps:
3641
- name: Checkout
@@ -128,6 +133,7 @@ jobs:
128133

129134
build-linux:
130135
name: Build Python for Linux
136+
if: github.ref != 'refs/heads/dart-bridge' # see build-darwin note
131137
runs-on: ubuntu-latest
132138
steps:
133139
- name: Checkout
@@ -161,6 +167,7 @@ jobs:
161167

162168
build-windows:
163169
name: Build Python for Windows
170+
if: github.ref != 'refs/heads/dart-bridge' # see build-darwin note
164171
runs-on: windows-2022
165172
steps:
166173
- uses: actions/checkout@v4
@@ -193,14 +200,22 @@ jobs:
193200
publish-release:
194201
name: Publish Release Assets
195202
runs-on: ubuntu-latest
196-
# Only publish GitHub release assets from the main branch; other branches still
197-
# build (and upload per-job artifacts) but don't touch releases.
198-
if: github.ref == 'refs/heads/main'
199203
needs:
200204
- build-darwin
201205
- build-android
202206
- build-linux
203207
- build-windows
208+
# TEMPORARY: dart-bridge branch publishes an Android-only re-release
209+
# (adding libpython3.so to python-android-dart). Once verified end-to-end,
210+
# revert this `if:` (and the build-{darwin,linux,windows} `if:` skips) so
211+
# `main` is the sole publisher. Allowing the job when sibling `needs:`
212+
# are *skipped* — not just *success* — keeps the cascade from blocking us.
213+
if: |
214+
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dart-bridge')
215+
&& needs.build-android.result == 'success'
216+
&& (needs.build-darwin.result == 'success' || needs.build-darwin.result == 'skipped')
217+
&& (needs.build-linux.result == 'success' || needs.build-linux.result == 'skipped')
218+
&& (needs.build-windows.result == 'success' || needs.build-windows.result == 'skipped')
204219
permissions:
205220
contents: write
206221
steps:

android/package-for-dart.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ rm -rf $bundle_dir
114114
# copy python*.so from lib
115115
cp $build_dir/lib/libpython$python_version_short.so $build_dir
116116

117+
# abi3 stub libpython3.so — forwards Limited API symbols to the version-
118+
# specific libpython. Consumed by libdart_bridge (dart-bridge repo), whose
119+
# DT_NEEDED libpython3.so needs to resolve at runtime on the device.
120+
cp $build_dir/lib/libpython3.so $build_dir
121+
117122
# copy deps
118123
for name in crypto ssl sqlite3; do
119124
cp "$build_dir/lib/lib${name}_"python.so "$build_dir"

0 commit comments

Comments
 (0)