From d8222ee981f3616ea1e93c73b32cea4d1fd7005e Mon Sep 17 00:00:00 2001 From: zackees Date: Sat, 30 May 2026 13:28:00 -0700 Subject: [PATCH] fix(lint): annotate Python daemon Command::new sites for subprocess-spawn lint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After f86817a9 (refactor lib.rs → submodules) the four std::process::Command::new sites in fbuild-python/daemon.rs ended up inside `match` arms two lines below their `allow-direct-spawn:` comment. The detector in ci/find_direct_subprocess.py only looks at "same line or the line immediately above", so the annotation no longer covered the actual call sites and CI started reporting: NEW direct spawns without an `allow-direct-spawn: ` marker: crates/fbuild-python/src/daemon.rs:96 crates/fbuild-python/src/daemon.rs:97 crates/fbuild-python/src/daemon.rs:247 crates/fbuild-python/src/daemon.rs:248 This blocks every PR's "Lint subprocess spawns" check (e.g. #306 for fbuild#304, which is the actual FastLED-vs-PIO size regression we need to land). Fix: add an inline `// allow-direct-spawn:` annotation immediately above each of the four arms. Behavior unchanged. --- crates/fbuild-python/src/daemon.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/fbuild-python/src/daemon.rs b/crates/fbuild-python/src/daemon.rs index 1e8ce211..5b7bcb31 100644 --- a/crates/fbuild-python/src/daemon.rs +++ b/crates/fbuild-python/src/daemon.rs @@ -93,7 +93,9 @@ impl Daemon { // (FastLED/fbuild#275) so a venv install never gets shadowed by a // stale user-level daemon on PATH. let mut cmd = match daemon_spawn_target() { + // allow-direct-spawn: daemon must outlive the Python interpreter. Some(path) => std::process::Command::new(path), + // allow-direct-spawn: daemon must outlive the Python interpreter. None => std::process::Command::new(DAEMON_BIN_NAME), }; if fbuild_paths::is_dev_mode() { @@ -244,7 +246,9 @@ impl AsyncDaemon { // from inside this async block. // allow-direct-spawn: daemon must outlive the Python interpreter. let mut cmd = match spawn_target { + // allow-direct-spawn: daemon must outlive the Python interpreter. Some(path) => std::process::Command::new(path), + // allow-direct-spawn: daemon must outlive the Python interpreter. None => std::process::Command::new(DAEMON_BIN_NAME), }; if dev_mode {