From 33c885c79f78e574c880e491cbb923344b4f6650 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 25 Oct 2026 06:27:22 +0000 Subject: [PATCH 1/4] build(deps): bump libc from 0.2.189 to 0.2.191 Bumps [libc](https://github.com/rust-lang/libc) from 0.2.189 to 0.2.191. - [Release notes](https://github.com/rust-lang/libc/releases) - [Changelog](https://github.com/rust-lang/libc/blob/0.2.191/CHANGELOG.md) - [Commits](https://github.com/rust-lang/libc/compare/0.2.189...0.2.191) --- updated-dependencies: - dependency-name: libc dependency-version: 0.2.191 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4cbb8189bf0..68ccbd19c4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2226,9 +2226,9 @@ checksum = "34b357333733e8260735ba5894eb928c02ecc69c78715f01a8019e7fa7f2db4c" [[package]] name = "libc" -version = "0.2.189" +version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" [[package]] name = "libffi" From e81961b5b9eb18ae0b47ce9d134bdb2ece2cc74d Mon Sep 17 00:00:00 2001 From: youknowdot Date: Sun, 25 Oct 2026 16:51:44 +0900 Subject: [PATCH 2/4] build(deps): fix libc 0.2.191 compatibility on iOS Pin nix to the exact upstream macOS-only API fix until it is released. Update the cfg_aliases minimum required by that revision. Assisted-by: OpenAI Codex:model version unavailable --- Cargo.lock | 7 +++---- Cargo.toml | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68ccbd19c4a..cd0f67563a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -525,9 +525,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" [[package]] name = "chacha20" @@ -2511,8 +2511,7 @@ dependencies = [ [[package]] name = "nix" version = "0.31.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" +source = "git+https://github.com/nix-rust/nix?rev=f9ba3ed0698255d93240b07ecbf39ecb05a8a5cd#f9ba3ed0698255d93240b07ecbf39ecb05a8a5cd" dependencies = [ "bitflags 2.13.2", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index 638a86a72de..023a7e4da07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -143,6 +143,8 @@ strip = true panic = "abort" [patch.crates-io] +# Keep libc 0.2.191 compatible with iOS until nix releases https://github.com/nix-rust/nix/pull/2821. +nix = { git = "https://github.com/nix-rust/nix", rev = "f9ba3ed0698255d93240b07ecbf39ecb05a8a5cd" } parking_lot_core = { git = "https://github.com/youknowone/parking_lot", branch = "rustpython" } # REDOX START, Uncomment when you want to compile/check with redoxer # REDOX END From fd8a62bac06ab1eb50755347fa30fe808a611dae Mon Sep 17 00:00:00 2001 From: youknowdot Date: Sun, 25 Oct 2026 20:06:25 +0900 Subject: [PATCH 3/4] Fix Apple platform availability for libc 0.2.191 Expose SYSPROTO_CONTROL only on macOS and omit os.system on Apple mobile targets where libc does not provide it. Keep host and Python exports consistent with the platform declarations and CPython availability. Assisted-by: OpenAI Codex:model version unavailable --- crates/host_env/src/os.rs | 10 +++++++--- crates/host_env/src/socket.rs | 5 ++++- crates/stdlib/src/socket.rs | 6 +++++- crates/vm/src/stdlib/os.rs | 16 ++++++++++++++-- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/crates/host_env/src/os.rs b/crates/host_env/src/os.rs index 71469890587..807b42411d0 100644 --- a/crates/host_env/src/os.rs +++ b/crates/host_env/src/os.rs @@ -8,8 +8,6 @@ use crate::fs; pub use crate::posix::rename; #[cfg(any(unix, target_os = "wasi"))] pub use crate::posix_unix_like::rename; -#[cfg(any(unix, windows))] -use core::ffi::CStr; use core::str::Utf8Error; #[cfg(windows)] use core::time::Duration; @@ -569,7 +567,13 @@ pub fn isatty(_fd: i32) -> bool { } #[cfg(any(unix, windows))] -pub fn system(command: &CStr) -> libc::c_int { +#[cfg(not(any( + target_os = "ios", + target_os = "tvos", + target_os = "watchos", + target_os = "visionos" +)))] +pub fn system(command: &core::ffi::CStr) -> libc::c_int { unsafe { libc::system(command.as_ptr()) } } diff --git a/crates/host_env/src/socket.rs b/crates/host_env/src/socket.rs index 4e6ba75f613..fc0d35afe53 100644 --- a/crates/host_env/src/socket.rs +++ b/crates/host_env/src/socket.rs @@ -279,9 +279,12 @@ pub use libc::{MSG_CMSG_CLOEXEC, MSG_NOSIGNAL}; pub use libc::{ AF_SYSTEM, IP_ADD_SOURCE_MEMBERSHIP, IP_BLOCK_SOURCE, IP_DROP_SOURCE_MEMBERSHIP, IP_PKTINFO, IP_RECVTTL, IP_UNBLOCK_SOURCE, IPPROTO_MAX, IPPROTO_SCTP, MSG_NOSIGNAL, PF_SYSTEM, - SYSPROTO_CONTROL, TCP_CONNECTION_INFO, TCP_KEEPALIVE, + TCP_CONNECTION_INFO, TCP_KEEPALIVE, }; +#[cfg(target_os = "macos")] +pub use libc::SYSPROTO_CONTROL; + #[cfg(target_os = "linux")] pub use libc::{ CAN_BCM, CAN_EFF_FLAG, CAN_EFF_MASK, CAN_ERR_FLAG, CAN_ERR_MASK, CAN_ISOTP, CAN_J1939, CAN_RAW, diff --git a/crates/stdlib/src/socket.rs b/crates/stdlib/src/socket.rs index 427b5d7a2b1..ee82db89862 100644 --- a/crates/stdlib/src/socket.rs +++ b/crates/stdlib/src/socket.rs @@ -180,7 +180,11 @@ mod _socket { #[cfg(target_vendor = "apple")] #[pyattr] - use host_socket::{AF_SYSTEM, PF_SYSTEM, SYSPROTO_CONTROL, TCP_KEEPALIVE}; + use host_socket::{AF_SYSTEM, PF_SYSTEM, TCP_KEEPALIVE}; + + #[cfg(target_os = "macos")] + #[pyattr] + use host_socket::SYSPROTO_CONTROL; #[cfg(target_vendor = "apple")] #[pyattr] diff --git a/crates/vm/src/stdlib/os.rs b/crates/vm/src/stdlib/os.rs index 4152bd74351..ed69b7b33a3 100644 --- a/crates/vm/src/stdlib/os.rs +++ b/crates/vm/src/stdlib/os.rs @@ -210,8 +210,6 @@ pub(super) mod _os { #[cfg(not(windows))] use crate::exceptions; use crate::host_env::fileutils::StatStruct; - #[cfg(any(unix, windows))] - use crate::utils::ToCString; use crate::{ AsObject, Py, PyObject, PyObjectRef, PyPayload, PyRef, PyResult, builtins::{ @@ -1879,6 +1877,12 @@ pub(super) mod _os { } #[cfg(any(unix, windows))] + #[cfg(not(any( + target_os = "ios", + target_os = "tvos", + target_os = "watchos", + target_os = "visionos" + )))] #[derive(FromArgs)] struct SystemArgs { #[pyarg(any)] @@ -1886,8 +1890,16 @@ pub(super) mod _os { } #[cfg(any(unix, windows))] + #[cfg(not(any( + target_os = "ios", + target_os = "tvos", + target_os = "watchos", + target_os = "visionos" + )))] #[pyfunction] fn system(command: SystemArgs, vm: &VirtualMachine) -> PyResult { + use crate::utils::ToCString; + let command = command.command; let cstr = command.to_cstring(vm)?; let x = crate::host_env::os::system(cstr.as_c_str()); From 3d6287b740a1824c0ade5a95721a62cd441ebcfa Mon Sep 17 00:00:00 2001 From: youknowdot Date: Sun, 25 Oct 2026 22:19:58 +0900 Subject: [PATCH 4/4] Sync canonical iOS Objective-C loader fallback Migrate Lib/_ios_support.py through scripts/update_lib to CPython 3.15 commit d220409a13b77de7a6c30abe16ea90db01528edc. Fall back to the bare libobjc.dylib name when find_library cannot resolve the shared-cache entry, and normalize loader OSError to ImportError. Linux default and frozen-stdlib cargo check gates are compile-only. They do not validate iOS dynamic loading, Objective-C symbols, or native runtime. Assisted-by: OpenAI Codex:model version unavailable --- Lib/_ios_support.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Lib/_ios_support.py b/Lib/_ios_support.py index 20467a7c2bc..cc51aa50491 100644 --- a/Lib/_ios_support.py +++ b/Lib/_ios_support.py @@ -10,12 +10,15 @@ else: # ctypes is available. Load the ObjC library, and wrap the objc_getClass, # sel_registerName methods - lib = util.find_library("objc") - if lib is None: - # Failed to load the objc library - raise ImportError("ObjC runtime library couldn't be loaded") + # find_library() resolves a system library through the dyld shared cache, + # which needs _dyld_shared_cache_contains_path(); that is unavailable before + # iOS 14, so fall back to the bare name, which dyld resolves by itself. + lib = util.find_library("objc") or "libobjc.dylib" - objc = cdll.LoadLibrary(lib) + try: + objc = cdll.LoadLibrary(lib) + except OSError: + raise ImportError("ObjC runtime library couldn't be loaded") objc.objc_getClass.restype = c_void_p objc.objc_getClass.argtypes = [c_char_p] objc.sel_registerName.restype = c_void_p