v0.1.0-U (vc=8): Phase U-1 + U-2 — Rust core + rustypipe search
NewPipeExtractor (Java) → strawcore (Rust) migration begins. Phase U:
- U-1: Rust toolchain + UniFFI smoke test
- U-2: rustypipe search via uniffi suspend fun, SearchViewModel swapped
What landed:
- rust/strawcore — UniFFI-exported Rust crate using proc-macros.
Builds for arm64-v8a + armeabi-v7a + x86 + x86_64 via cargo-ndk.
Tokio multi-thread runtime singleton drives rustypipe's async API.
- strawApp/build.gradle.kts — cargoBuildHost + cargoBuild + uniffiBindgen
Gradle Exec tasks chained into the Android build. Generated Kotlin
bindings land in src/main/java/uniffi/strawcore/ (gitignored).
- SearchViewModel.kt — calls uniffi.strawcore.search(query) directly.
NewPipeExtractor still in deps for VideoDetail/Player/Channel paths;
those move to Rust in U-3 / U-4.
- Build chain quirks beat:
* cargo absolute path in Exec tasks (PATH wasn't propagating)
* uniffi-bindgen needs UNSTRIPPED host .so — separate cargoBuildHost
builds a debug-profile host lib to read metadata from
* rustypipe rustls-tls-webpki-roots avoids the openssl-sys
cross-compile tarpit
* rquickjs-sys 'bindgen' feature opted in (no prebuilt Android
bindings ship; crafting-table has libclang 14)
- crafting-table runtime install (until Dockerfile catches up):
rustup + 4 Android targets + cargo-ndk + NDK r27c. Persists in
/caches/cargo + /caches/android-sdk via the volume mount.
APK size: 22MB (U-1) → 37MB (U-2). libstrawcore.so 3-5MB per ABI carries
rustypipe + reqwest + tokio + rustls + rquickjs. NewPipeExtractor still
in for now (still drives detail + player + channel + feed), so the
Java half is doubled up. U-5 removes it.
This commit is contained in:
parent
9550b207ab
commit
7ff5ac79e5
14 changed files with 432 additions and 29 deletions
30
rust/Cargo.toml
Normal file
30
rust/Cargo.toml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Straw Rust core — workspace.
|
||||
# Hosts the JNI/UniFFI-exported library that replaces NewPipeExtractor.
|
||||
#
|
||||
# Builds via cargo-ndk for the four Android ABIs (arm64-v8a, armeabi-v7a,
|
||||
# x86, x86_64). The Mozilla rust-android-gradle plugin wires this into the
|
||||
# strawApp Gradle build so `./gradlew assembleDebug` produces a single APK
|
||||
# with the .so files packed inside.
|
||||
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["strawcore"]
|
||||
|
||||
[workspace.package]
|
||||
edition = "2021"
|
||||
license = "GPL-3.0-or-later"
|
||||
authors = ["Sulkta-Coop"]
|
||||
repository = "http://192.168.0.5:3001/Sulkta-Coop/straw"
|
||||
|
||||
[profile.release]
|
||||
# Strip debug info, run thin LTO. APK size matters more than build time here.
|
||||
strip = true
|
||||
lto = "thin"
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
opt-level = "z"
|
||||
|
||||
[profile.dev]
|
||||
# Keep debug builds fast — we're rebuilding constantly during U-1..U-5.
|
||||
opt-level = 0
|
||||
debug = 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue