From 96fcd5ef671579b5b75e01de99bbe54d8c1e877b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 10 Aug 2026 08:30:45 +0900 Subject: refactor(symfony-console): drop the unreachable process title surface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Command::setProcessTitle has no caller: neither Composer nor the ported Symfony Console code sets a process title, so run()'s title branch could never fire. The shim it called into was unimplementable anyway — PHP rewrites its own argv block, which Rust hands out only as owned copies. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe-php-shim/src/process.rs | 12 ------- .../shirabe-symfony-console/src/command/command.rs | 40 ---------------------- 2 files changed, 52 deletions(-) (limited to 'crates') diff --git a/crates/shirabe-php-shim/src/process.rs b/crates/shirabe-php-shim/src/process.rs index 38ba9928..2b380c60 100644 --- a/crates/shirabe-php-shim/src/process.rs +++ b/crates/shirabe-php-shim/src/process.rs @@ -401,18 +401,6 @@ pub fn getmypid() -> i64 { std::process::id() as i64 } -pub fn cli_set_process_title(_title: &str) -> bool { - // TODO(phase-c): PHP rewrites the argv area so the new title shows up in ps(1)'s full command - // line. Rust hands out argv as owned copies, so the original block is not reachable; prctl's - // PR_SET_NAME only replaces the 16-byte comm field and would report a different title. - todo!() -} - -pub fn setproctitle(_title: &str) { - // TODO(phase-c): see cli_set_process_title; requires access to the process's own argv block. - todo!() -} - // No-op until real signal handling is wired up; signal registration itself is // deferred (see the TODO(plugin) notes in SignalRegistry::register). pub fn pcntl_async_signals(_enable: bool) {} diff --git a/crates/shirabe-symfony-console/src/command/command.rs b/crates/shirabe-symfony-console/src/command/command.rs index bb4d35e9..6f25595b 100644 --- a/crates/shirabe-symfony-console/src/command/command.rs +++ b/crates/shirabe-symfony-console/src/command/command.rs @@ -10,7 +10,6 @@ use crate::input::InputDefinition; use crate::input::InputInterface; use crate::input::InputOption; use crate::output::OutputInterface; -use crate::output::output_interface; use indexmap::IndexMap; use shirabe_php_shim::{PhpMixed, php_regex}; use std::cell::{Cell, Ref}; @@ -30,7 +29,6 @@ use std::cell::{Cell, Ref}; pub struct CommandData { application: std::cell::RefCell>>>, name: std::cell::RefCell>, - process_title: std::cell::RefCell>, aliases: std::cell::RefCell>, definition: std::cell::RefCell>, hidden: Cell, @@ -63,7 +61,6 @@ impl CommandData { let this = CommandData { application: std::cell::RefCell::new(None), name: std::cell::RefCell::new(None), - process_title: std::cell::RefCell::new(None), aliases: std::cell::RefCell::new(Vec::new()), definition: std::cell::RefCell::new(Some( InputDefinition::new(Vec::new()).expect("an empty InputDefinition cannot fail"), @@ -279,8 +276,6 @@ macro_rules! delegate_command_trait_impls_to_inner { $crate::delegate_to_inner!($field, fn get_native_definition(&self) -> std::cell::Ref<'_, $crate::input::InputDefinition>); $crate::delegate_to_inner!($field, fn set_name(&self, name: &str) -> anyhow::Result<()>); $crate::delegate_to_inner!($field, fn get_name(&self) -> Option); - $crate::delegate_to_inner!($field, fn set_process_title(&self, title: &str)); - $crate::delegate_to_inner!($field, fn get_process_title(&self) -> Option); $crate::delegate_to_inner!($field, fn set_hidden(&self, hidden: bool)); $crate::delegate_to_inner!($field, fn is_hidden(&self) -> bool); $crate::delegate_to_inner!($field, fn set_description(&self, description: &str)); @@ -402,29 +397,6 @@ pub trait Command: std::fmt::Debug + shirabe_php_shim::AsAny + shirabe_php_shim: self.initialize(input.clone(), output.clone())?; - if let Some(process_title) = self.get_process_title() { - // TODO(phase-c): PHP probes for cli_set_process_title / setproctitle availability. - if shirabe_php_shim::function_exists("cli_set_process_title") { - if !shirabe_php_shim::cli_set_process_title(&process_title) { - if shirabe_php_shim::PHP_OS == "Darwin" { - output.borrow_mut().writeln( - &["Running \"cli_set_process_title\" as an unprivileged user is not supported on MacOS.".to_string()], - output_interface::VERBOSITY_VERY_VERBOSE, - ); - } else { - shirabe_php_shim::cli_set_process_title(&process_title); - } - } - } else if shirabe_php_shim::function_exists("setproctitle") { - shirabe_php_shim::setproctitle(&process_title); - } else if output.borrow().get_verbosity() == output_interface::VERBOSITY_VERY_VERBOSE { - output.borrow_mut().writeln( - &["Install the proctitle PECL to be able to change the process title.".to_string()], - output_interface::OUTPUT_NORMAL, - ); - } - } - if input.borrow().is_interactive() { self.interact(input.clone(), output.clone()); } @@ -483,10 +455,6 @@ pub trait Command: std::fmt::Debug + shirabe_php_shim::AsAny + shirabe_php_shim: fn get_name(&self) -> Option; - fn set_process_title(&self, title: &str); - - fn get_process_title(&self) -> Option; - fn set_hidden(&self, hidden: bool); fn is_hidden(&self) -> bool; @@ -684,14 +652,6 @@ impl Command for CommandData { self.name.borrow().clone() } - fn set_process_title(&self, title: &str) { - *self.process_title.borrow_mut() = Some(title.to_string()); - } - - fn get_process_title(&self) -> Option { - self.process_title.borrow().clone() - } - fn set_hidden(&self, hidden: bool) { self.hidden.set(hidden); } -- cgit v1.3.1-4-g156e