Skip to content

Commit e28e249

Browse files
committed
fix: gate unix socket AHP on unix targets
1 parent 4a1c3c1 commit e28e249

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/setup-workspace.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ sed -i.bak \
1515
-e 's|a3s-search = { version = "1.2.3", path = "../../search", default-features = false, features = \["lightpanda"\] }|a3s-search = { version = "1.2.3", default-features = false, features = ["lightpanda"] }|' \
1616
-e 's|a3s-box-sdk = { version = "0.7", path = "../../box/src/sdk", optional = true }|a3s-box-sdk = { version = "0.7", optional = true }|' \
1717
-e 's|a3s-ahp = { version = "2.3", path = "../../ahp", optional = true, features = \["http", "websocket", "unix-socket"\] }|a3s-ahp = { version = "2.3", optional = true, features = ["http", "websocket", "unix-socket"] }|' \
18+
-e 's|a3s-ahp = { version = "2.3", path = "../../ahp", optional = true, features = \["http", "websocket"\] }|a3s-ahp = { version = "2.3", optional = true, features = ["http", "websocket"] }|' \
1819
core/Cargo.toml
1920
rm -f core/Cargo.toml.bak
2021

core/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ a3s-common = { version = "0.1", path = "../../common" }
1717
a3s-memory = { version = "0.1.1", path = "../../memory" }
1818
a3s-lane = { version = "0.4", path = "../../lane" }
1919
a3s-search = { version = "1.2.3", path = "../../search", default-features = false, features = ["lightpanda"] }
20-
a3s-ahp = { version = "2.3", path = "../../ahp", optional = true, features = ["http", "websocket", "unix-socket"] }
2120

2221
# Async runtime
2322
tokio = { version = "1.35", features = [
@@ -104,6 +103,12 @@ uuid = { version = "1.6", features = ["v4", "serde"] }
104103
# Time handling
105104
chrono = { version = "0.4", features = ["serde"] }
106105

106+
[target.'cfg(unix)'.dependencies]
107+
a3s-ahp = { version = "2.3", path = "../../ahp", optional = true, features = ["http", "websocket", "unix-socket"] }
108+
109+
[target.'cfg(not(unix))'.dependencies]
110+
a3s-ahp = { version = "2.3", path = "../../ahp", optional = true, features = ["http", "websocket"] }
111+
107112
[features]
108113
default = []
109114
# Enable OpenTelemetry OTLP export for traces and metrics.

sdk/node/src/lib.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,9 +1717,16 @@ fn js_session_options_to_rust(options: Option<SessionOptions>) -> RustSessionOpt
17171717
}
17181718
}
17191719
"unix_socket" => {
1720-
if let Some(path) = &transport.path {
1721-
Some(AhpTransport::UnixSocket { path: path.clone() })
1722-
} else {
1720+
#[cfg(unix)]
1721+
{
1722+
if let Some(path) = &transport.path {
1723+
Some(AhpTransport::UnixSocket { path: path.clone() })
1724+
} else {
1725+
None
1726+
}
1727+
}
1728+
#[cfg(not(unix))]
1729+
{
17231730
None
17241731
}
17251732
}

sdk/python/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4191,6 +4191,7 @@ fn build_rust_session_options(so: PySessionOptions) -> PyResult<RustSessionOptio
41914191
});
41924192
}
41934193
// Try Unix socket transport
4194+
#[cfg(unix)]
41944195
if let Ok(unix) = transport_obj.extract::<pyo3::PyRef<PyUnixSocketTransport>>(py) {
41954196
return Some(AhpTransport::UnixSocket {
41964197
path: unix.path.clone(),

0 commit comments

Comments
 (0)