Repository navigation
Add Android wheels support via cibuildwheel - #283
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #283 +/- ##
=======================================
Coverage 95.29% 95.29%
=======================================
Files 1 1
Lines 638 638
=======================================
Hits 608 608
Misses 30 30 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b19f6e6 to
119d620
Compare
|
Addressed the review feedback.
|
3c648f6 to
0370d96
Compare
|
hit a blocker while getting the Android wheel to actually build: the published Android libzim binaries are reader-only, so the extension cannot link its writer bindings. Evidence (arm64 archives from
Linux/macOS archives still ship the writer headers and symbols.
Options:
|
38bd5e0 to
0370d96
Compare
|
@kelson42 any reason to have limited Android libzim builds to "reader-only"? Where should I open an issue? |
A few releases ago, we have implemented - at the libzim level - the ability to compile/distribute the libzim only with the reader part (make no sense to embedds all the stuff related to the writer... if you never use it). libzim for Android has been the first to use this feature because... there is no writter. So "yes", this is a feature and not a bug. |
|
Then we will need to work on #287 first, thank you. |
Cython cannot conditionally parse `cdef extern` blocks, so declare the writer API through a local shim header that only includes libzim's writer headers when the library was built with writer support. Guard the writer implementations (C++ wrappers, writer callbacks, Hint, Creator and the libzim.writer registration) with LIBZIM_WITHOUT_WRITER, and detect that build flag in setup.py once libzim is available. On a writer-less libzim the extension now builds and `import libzim.writer` raises ImportError, which is what Android/reader-only wheels need (openzim#283). Adds tests for lazy submodule loading and creator guards. Fixes openzim#287
Cython cannot conditionally parse `cdef extern` blocks, so declare the writer API through a local shim header that only includes libzim's writer headers when the library was built with writer support. Guard the writer implementations (C++ wrappers, writer callbacks, Hint, Creator and the libzim.writer registration) with LIBZIM_WITHOUT_WRITER, and detect that build flag in setup.py once libzim is available. On a writer-less libzim the extension now builds and `import libzim.writer` raises ImportError, which is what Android/reader-only wheels need (openzim#283). Adds tests for lazy submodule loading and creator guards. Fixes openzim#287
Cython cannot conditionally parse `cdef extern` blocks, so declare the writer API through a local shim header that only includes libzim's writer headers when the library was built with writer support. Guard the writer implementations (C++ wrappers, writer callbacks, Hint, Creator and the libzim.writer registration) with LIBZIM_WITHOUT_WRITER, and detect that build flag in setup.py once libzim is available. On a writer-less libzim the extension now builds and `import libzim.writer` raises ImportError, which is what Android/reader-only wheels need (openzim#283). The reader-only build can be forced with FORCE_LIBZIM_WITHOUT_WRITER=1 and is covered by a dedicated CI job. Adds tests for lazy submodule loading and creator guards. Fixes openzim#287
Cython cannot conditionally parse `cdef extern` blocks, so declare the writer API through a local shim header that only includes libzim's writer headers when the library was built with writer support. Guard the writer implementations (C++ wrappers, writer callbacks, Hint, Creator and the libzim.writer registration) with LIBZIM_WITHOUT_WRITER, and let the build select that path explicitly through the LIBZIM_WITHOUT_WRITER env var. On a writer-less libzim the extension now builds and `import libzim.writer` raises ImportError, which is what Android/reader-only wheels need (openzim#283). The reader-only build is covered by a dedicated CI job. Adds tests for lazy submodule loading and creator guards. Fixes openzim#287
Cython cannot conditionally parse `cdef extern` blocks, so declare the writer API through a local shim header that only includes libzim's writer headers when the library was built with writer support. Guard the writer implementations (C++ wrappers, writer callbacks, Hint, Creator and the libzim.writer registration) with LIBZIM_WITHOUT_WRITER, and let the build select that path explicitly through the LIBZIM_WITHOUT_WRITER env var. On a writer-less libzim the extension now builds and `import libzim.writer` raises ImportError, which is what Android/reader-only wheels need (openzim#283). The reader-only build is covered by a dedicated CI job. Adds tests for lazy submodule loading and creator guards. Fixes openzim#287
|
@pawank925 build on Android is still failing ... please rebase on Also please update documentation:
|
2a6cdb6 to
1daf79f
Compare
|
@benoit74 rebased on The Android job was still failing for the reason noted earlier in this thread: the published Android libzim binaries are built with The job now sets I also had to skip cibuildwheel tests for Android ( Documentation:
So Android wheels are reader-only until libzim ships Android binaries with writer support. CI runs for the squashed commit are queued and waiting for your approval, I will report back here. |
1daf79f to
c6484d3
Compare
|
@benoit74 done thanks! |
Build Android
arm64_v8aandx86_64wheels with CPython 3.13+. Download prebuilt libzim Android binaries and adjust packaging/rpaths for the Android toolchain.The libzim binaries published for Android are compiled without writer support (
-Dwithout_writer=true), so these wheels are reader-only: the Android build setsLIBZIM_WITHOUT_WRITER=1, andlibzim.writeris not available.README.md(docs index) and thelibzim.writerAPI docs mention this limitation.The Android job skips cibuildwheel tests: the Android testbed does not support the
{project}placeholder used by the shared test command, and the suite relies on the writer module plus network downloads.thanks to @benoit74 for suggestion
Closes #167