From 0dd510dbc3a5b6e888abcc104ae8c4a4eeb1e42b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 25 Jun 2026 17:14:07 +0900 Subject: feat(shim): implement stream_select/stream_set_blocking via libc Add fcntl/select extern "C" declarations and a PhpResource::raw_fd seam so the symfony Process pipe loop can read a live child's stdout/stderr. Fix fread on a non-blocking fd (WouldBlock -> "") and the Process null-cwd default. Real subprocess output capture now works; un-ignore the process_executor tests. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe-external-packages/src/symfony/process/process.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/shirabe-external-packages/src') diff --git a/crates/shirabe-external-packages/src/symfony/process/process.rs b/crates/shirabe-external-packages/src/symfony/process/process.rs index 3550f09..1b58972 100644 --- a/crates/shirabe-external-packages/src/symfony/process/process.rs +++ b/crates/shirabe-external-packages/src/symfony/process/process.rs @@ -222,7 +222,11 @@ impl Process { this.cwd = cwd; // on Windows, if the cwd changed via chdir(), proc_open defaults to the dir where PHP was started - if this.cwd.is_none() && php::DIRECTORY_SEPARATOR == "\\" { + // PHP: null === $this->cwd && (\defined('ZEND_THREAD_SAFE') || '\\' === \DIRECTORY_SEPARATOR) + // `\defined('ZEND_THREAD_SAFE')` is unconditionally true in modern PHP (the constant always + // exists; its value merely reflects the NTS/ZTS build), so the disjunction is always true and + // the cwd is defaulted to getcwd() whenever it was null. + if this.cwd.is_none() { this.cwd = php::getcwd(); } if let Some(env) = env { -- cgit v1.3.1