WIP/DUBIOUS: docker build script + android_logger migration (build broken)
Docker-based build pipeline (scripts/build-android-docker.sh) replacing
hcloud VMs — NOT verified working yet. Also includes android_logger
migration that may have introduced build issues. All changes after
264ef9c are suspect.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,9 +27,8 @@ libc = "0.2"
|
||||
jni = { version = "0.21", default-features = false }
|
||||
rand = { workspace = true }
|
||||
rustls = { version = "0.23", default-features = false, features = ["ring"] }
|
||||
android_logger = "0.14"
|
||||
log = "0.4"
|
||||
tracing-log = "0.2"
|
||||
|
||||
|
||||
|
||||
[build-dependencies]
|
||||
cc = "1"
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
//! JNI bridge for Android — thin layer between Kotlin and the WzpEngine.
|
||||
|
||||
// Force system allocator — Rust's default jemalloc conflicts with Android's
|
||||
// scudo allocator on Android 16 MTE devices, causing SIGSEGV in je_arena_palloc.
|
||||
#[global_allocator]
|
||||
static ALLOC: std::alloc::System = std::alloc::System;
|
||||
|
||||
use std::panic;
|
||||
use std::sync::Once;
|
||||
|
||||
@@ -34,20 +39,10 @@ static INIT_LOGGING: Once = Once::new();
|
||||
/// Initialize tracing → Android logcat (tag "wzp_android").
|
||||
/// Safe to call multiple times — only the first call takes effect.
|
||||
fn init_logging() {
|
||||
INIT_LOGGING.call_once(|| {
|
||||
// Use android_logger directly — tracing_subscriber::registry() allocates
|
||||
// a sharded_slab which causes SIGSEGV on Android 16 MTE devices.
|
||||
// android_logger is lightweight and doesn't trigger scudo crashes.
|
||||
let _ = std::panic::catch_unwind(|| {
|
||||
android_logger::init_once(
|
||||
android_logger::Config::default()
|
||||
.with_max_level(log::LevelFilter::Info)
|
||||
.with_tag("wzp"),
|
||||
);
|
||||
// Bridge tracing → log so our tracing::info! macros work
|
||||
let _ = tracing_log::LogTracer::init();
|
||||
});
|
||||
});
|
||||
// NOTE: Both tracing-android (sharded_slab SIGSEGV) and android_logger
|
||||
// (jemalloc/scudo conflict in CString::new) crash on Android 16 MTE.
|
||||
// Skip logging initialization entirely — tracing macros silently no-op.
|
||||
// Kotlin-side logging (Log.i/Log.w) still works for debugging.
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
|
||||
Reference in New Issue
Block a user