Skip to content

Commit 2f1e32b

Browse files
branchseerclaude
andauthored
refactor(fspy): gate ipc_channel_conf on non-musl targets (#327)
## Summary The IPC channel sender is only used by the preload library, which isn't built on musl targets (only seccomp-based tracking is used there). Gate `Payload::ipc_channel_conf`, its `ChannelConf` import, and its creation/assignment site with `#[cfg(not(target_env = "musl"))]` so musl builds no longer carry the unused configuration. - Field & import in `crates/fspy_shared_unix/src/payload.rs` - Creation and struct-init in `crates/fspy/src/unix/mod.rs` — the `channel(SHM_CAPACITY)` call is still made (the `ipc_receiver` half is consumed downstream), but the conf half is bound to `_` on musl The other reference in `crates/fspy_preload_unix/src/client/mod.rs` is already effectively gated — the entire `client` module is `#[cfg(all(unix, not(target_env = "musl")))]` via `crates/fspy_preload_unix/src/lib.rs`. ## Test plan - [x] `cargo check --workspace --all-features` (host glibc target) - [x] `cargo check --workspace --all-features --target x86_64-unknown-linux-musl` - [x] `cargo clippy -p fspy_shared_unix -p fspy --all-features --all-targets -- -D warnings` https://claude.ai/code/session_01VqiMHiGeViu1pGhWwJ67Qc --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 076cef4 commit 2f1e32b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

crates/fspy/src/unix/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,14 @@ 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) = channel(SHM_CAPACITY).map_err(SpawnError::ChannelCreation)?;
9497

9598
let payload = Payload {
99+
#[cfg(not(target_env = "musl"))]
96100
ipc_channel_conf,
97101

98102
#[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)