Skip to content

Commit a409c4c

Browse files
committed
fix(symbols): annotate c++filt direct spawn for find_direct_subprocess.py
PR #424's "Lint subprocess spawns" CI runs both a dylint rule (file- level allowlist, already added) AND a separate Python script `ci/find_direct_subprocess.py` that scans for `Command::new(...)` and requires an inline `// allow-direct-spawn: <reason>` comment on the line above each call. The dylint allowlist alone is not enough — both gates must pass independently. Add the inline annotation above the c++filt spawn in `fbuild-build::symbol_analyzer::demangle_batch` matching the format used elsewhere in the tree (see e.g. fbuild-cli/src/daemon_client.rs). Same rationale as the dylint allowlist entry: stdin-piped + threaded writer is required to avoid the Windows pipe-buffer deadlock when demangling thousands of names.
1 parent 11ea206 commit a409c4c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

crates/fbuild-build/src/symbol_analyzer.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ pub fn demangle_batch(mangled: &[String], cppfilt_path: &Path) -> Result<Vec<Str
7373
}
7474
let stdin_data = mangled.join("\n");
7575

76+
// allow-direct-spawn: c++filt demangler. The captured `run_command`
77+
// helper is stdin-Null; we need to pipe the mangled-symbol list
78+
// through c++filt's stdin and concurrently drain stdout via
79+
// wait_with_output to avoid the Windows pipe-buffer deadlock when
80+
// the symbol pool is large (~3k symbols on a stock ESP32-S3 Blink
81+
// ELF). Read-only analysis path; no containment side effects.
7682
let mut child = Command::new(cppfilt_path)
7783
.stdin(Stdio::piped())
7884
.stdout(Stdio::piped())

0 commit comments

Comments
 (0)