From 203960a0fd851927457afb975e0b2e9abdf795af Mon Sep 17 00:00:00 2001 From: Wildan M Date: Wed, 26 Nov 2025 20:44:43 -0800 Subject: [PATCH] Update rustpython to fix i586 build --- config/i586/desktop.toml | 1 - recipes/dev/rustpython/recipe.toml | 8 +++++--- recipes/dev/rustpython/redox.patch | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 recipes/dev/rustpython/redox.patch diff --git a/config/i586/desktop.toml b/config/i586/desktop.toml index bb2ae9b81..e4e9fa6bc 100644 --- a/config/i586/desktop.toml +++ b/config/i586/desktop.toml @@ -12,4 +12,3 @@ include = ["../desktop.toml"] # Package settings [packages] # example = {} -rustpython = "ignore" # https://github.com/Alexhuszagh/rust-lexical/issues/218 \ No newline at end of file diff --git a/recipes/dev/rustpython/recipe.toml b/recipes/dev/rustpython/recipe.toml index 608dfcafc..2390d3ae4 100644 --- a/recipes/dev/rustpython/recipe.toml +++ b/recipes/dev/rustpython/recipe.toml @@ -1,8 +1,10 @@ [source] git = "https://github.com/RustPython/RustPython" -# requires https://github.com/rust-lang/rust/pull/137319 -# since https://github.com/RustPython/RustPython/pull/5858 -rev = "e41d7f523a74c36b9f360d992ce0a9eb7e604c2b" +# newer rev requires TLS 1.3 (openssl3) and 'bits/libc-header-start.h' for bindgen +rev = "2025-10-13-main-51" +patches = [ + "redox.patch" +] [build] dependencies = [ diff --git a/recipes/dev/rustpython/redox.patch b/recipes/dev/rustpython/redox.patch new file mode 100644 index 000000000..5edecdeae --- /dev/null +++ b/recipes/dev/rustpython/redox.patch @@ -0,0 +1,22 @@ +diff --git a/stdlib/src/posixsubprocess.rs b/stdlib/src/posixsubprocess.rs +index 7f418c899..4da6a6858 100644 +--- a/stdlib/src/posixsubprocess.rs ++++ b/stdlib/src/posixsubprocess.rs +@@ -441,15 +441,14 @@ fn close_dir_fds(keep: KeepFds<'_>) -> nix::Result<()> { + fn close_filetable_fds(keep: KeepFds<'_>) -> nix::Result<()> { + use nix::fcntl; + use std::os::fd::{FromRawFd, OwnedFd}; +- let fd = fcntl::open( ++ let filetable = fcntl::open( + c"/scheme/thisproc/current/filetable", + fcntl::OFlag::O_RDONLY, + nix::sys::stat::Mode::empty(), + )?; +- let filetable = unsafe { OwnedFd::from_raw_fd(fd) }; + let read_one = || -> nix::Result<_> { + let mut byte = 0; +- let n = nix::unistd::read(filetable.as_raw_fd(), std::slice::from_mut(&mut byte))?; ++ let n = nix::unistd::read(&filetable, std::slice::from_mut(&mut byte))?; + Ok((n > 0).then_some(byte)) + }; + while let Some(c) = read_one()? {