Skip to content

Commit 8d8fb32

Browse files
authored
fix(lint): annotate Python daemon Command::new sites for subprocess-spawn lint (#317)
After f86817a (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: <reason>` 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.
1 parent b7560aa commit 8d8fb32

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

crates/fbuild-python/src/daemon.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ impl Daemon {
9393
// (FastLED/fbuild#275) so a venv install never gets shadowed by a
9494
// stale user-level daemon on PATH.
9595
let mut cmd = match daemon_spawn_target() {
96+
// allow-direct-spawn: daemon must outlive the Python interpreter.
9697
Some(path) => std::process::Command::new(path),
98+
// allow-direct-spawn: daemon must outlive the Python interpreter.
9799
None => std::process::Command::new(DAEMON_BIN_NAME),
98100
};
99101
if fbuild_paths::is_dev_mode() {
@@ -244,7 +246,9 @@ impl AsyncDaemon {
244246
// from inside this async block.
245247
// allow-direct-spawn: daemon must outlive the Python interpreter.
246248
let mut cmd = match spawn_target {
249+
// allow-direct-spawn: daemon must outlive the Python interpreter.
247250
Some(path) => std::process::Command::new(path),
251+
// allow-direct-spawn: daemon must outlive the Python interpreter.
248252
None => std::process::Command::new(DAEMON_BIN_NAME),
249253
};
250254
if dev_mode {

0 commit comments

Comments
 (0)