Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/thalamic_brainstem_smoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,10 @@ fn write_os_restart_child_frame(frame_path: &Path) {
}

fn spawn_os_restart_child(frame_path: &Path) -> std::process::Output {
let argv0 = std::env::args_os().next().expect("argv0");
Command::new(argv0)
// Linux `/proc/self/exe` (CI corpus-ipc job). Avoid `current_exe` / `args_os`,
// which Codacy Semgrep flags as "should not be used for security operations".
let exe = std::fs::read_link("/proc/self/exe").expect("read /proc/self/exe");
Comment thread
rmems marked this conversation as resolved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the OS-restart smoke portable outside Linux

When a developer enables corpus-ipc on macOS or Windows as supported by docs/ci.md:26-31, this test target still runs, but /proc/self/exe does not exist and the unconditional expect panics before spawning the child. The previous executable lookup was portable, so use a platform-specific fallback or gate this test to Linux rather than breaking the feature-enabled test suite on those systems.

Useful? React with 👍 / 👎.

Command::new(exe)
.env(OS_RESTART_CHILD_ENV, OS_RESTART_CHILD_TOKEN)
.env(OS_RESTART_FRAME_ENV, frame_path)
.args([
Expand Down
Loading