From 18147fda61768be2ff5b338024a5aead2163ac23 Mon Sep 17 00:00:00 2001 From: EtherealPsyche <180074435+EtherealPsyche@users.noreply.github.com> Date: Fri, 13 Mar 2026 00:20:32 +0800 Subject: [PATCH] If the `host_env` feature is enabled, then enable the `_ctypes` module on the Android platform. (#7402) --- crates/vm/Cargo.toml | 2 +- crates/vm/src/stdlib/mod.rs | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/vm/Cargo.toml b/crates/vm/Cargo.toml index 78b160867..5f7e901b8 100644 --- a/crates/vm/Cargo.toml +++ b/crates/vm/Cargo.toml @@ -104,7 +104,7 @@ which = "8" errno = "0.3" widestring = { workspace = true } -[target.'cfg(all(any(target_os = "linux", target_os = "macos", target_os = "windows"), not(any(target_env = "musl", target_env = "sgx"))))'.dependencies] +[target.'cfg(all(any(target_os = "linux", target_os = "macos", target_os = "windows", target_os = "android"), not(any(target_env = "musl", target_env = "sgx"))))'.dependencies] libffi = { workspace = true, features = ["system"] } libloading = "0.9" diff --git a/crates/vm/src/stdlib/mod.rs b/crates/vm/src/stdlib/mod.rs index 42514c46d..97fb4b372 100644 --- a/crates/vm/src/stdlib/mod.rs +++ b/crates/vm/src/stdlib/mod.rs @@ -40,7 +40,12 @@ pub mod posix; #[cfg(all( feature = "host_env", - any(target_os = "linux", target_os = "macos", target_os = "windows"), + any( + target_os = "linux", + target_os = "macos", + target_os = "windows", + target_os = "android" + ), not(any(target_env = "musl", target_env = "sgx")) ))] mod _ctypes; @@ -87,7 +92,12 @@ pub fn builtin_module_defs(ctx: &Context) -> Vec<&'static PyModuleDef> { _collections::module_def(ctx), #[cfg(all( feature = "host_env", - any(target_os = "linux", target_os = "macos", target_os = "windows"), + any( + target_os = "linux", + target_os = "macos", + target_os = "windows", + target_os = "android" + ), not(any(target_env = "musl", target_env = "sgx")) ))] _ctypes::module_def(ctx),