Skip to content

Commit ca7dec7

Browse files
committed
refactor(fspy): gate ipc_channel_conf on non-musl targets
The IPC channel sender is only used by the preload library, which is not built on musl (only seccomp-based tracking is used there). Mark the `ipc_channel_conf` field, its imports, and its creation site as `#[cfg(not(target_env = "musl"))]` so musl builds don't carry the unused configuration. https://claude.ai/code/session_01VqiMHiGeViu1pGhWwJ67Qc
1 parent 076cef4 commit ca7dec7

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

crates/fspy/src/unix/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,15 @@ impl SpyImpl {
8989
#[cfg(target_os = "linux")]
9090
let supervisor = supervise::<SyscallHandler>().map_err(SpawnError::Supervisor)?;
9191

92+
#[cfg(not(target_env = "musl"))]
9293
let (ipc_channel_conf, ipc_receiver) =
9394
channel(SHM_CAPACITY).map_err(SpawnError::ChannelCreation)?;
95+
#[cfg(target_env = "musl")]
96+
let (_, ipc_receiver) =
97+
channel(SHM_CAPACITY).map_err(SpawnError::ChannelCreation)?;
9498

9599
let payload = Payload {
100+
#[cfg(not(target_env = "musl"))]
96101
ipc_channel_conf,
97102

98103
#[cfg(target_os = "macos")]

crates/fspy_shared_unix/src/payload.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ use bincode::{Decode, Encode, config::standard};
55
use bstr::BString;
66
#[cfg(not(target_env = "musl"))]
77
use fspy_shared::ipc::NativeStr;
8+
#[cfg(not(target_env = "musl"))]
89
use fspy_shared::ipc::channel::ChannelConf;
910

1011
#[derive(Debug, Encode, Decode)]
1112
pub struct Payload {
13+
#[cfg(not(target_env = "musl"))]
1214
pub ipc_channel_conf: ChannelConf,
1315

1416
#[cfg(not(target_env = "musl"))]

0 commit comments

Comments
 (0)