🐧 ci: gate unix-only server APIs (Windows build fix) + skip wheel-test on cross rows
swadhinbiswas committed 2 months ago
a9534e5
1 parent 4188668
commit a9534e5
2 files changed
+12 -1
Showing 2 changed files+12-1
▼.github/workflows/wheels.yml
+7-0
| @@ -145,6 +145,13 @@ jobs: | ||
145 | 145 | maturin build --release --out dist $ZIG --target ${{ matrix.target }} \ |
146 | 146 | $INTERP ${{ matrix.features || '' }} |
147 | 147 | - name: Install wheel & test |
148 | + # Only rows where the wheel is installable on the runner itself: | |
149 | + # ubuntu x86_64-gnu (glibc matches, incl. the 3.14t row) | |
150 | + # macos aarch64 (runner is arm64) | |
151 | + # windows x64 (runner is x64) | |
152 | + # Skipped: musllinux wheels (can't install on the glibc runner), | |
153 | + # linux aarch64, and macos x86_64 (cross-built, arm64 runner). | |
154 | + if: matrix.target == 'x86_64-unknown-linux-gnu' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'x86_64-pc-windows-msvc' | |
148 | 155 | shell: bash |
149 | 156 | working-directory: crates/justapi-py |
150 | 157 | run: | |
151 | 158 | |
▼crates/justapi-core/src/server/mod.rs
+5-1
| @@ -957,7 +957,8 @@ impl Server { | ||
957 | 957 | } |
958 | 958 | |
959 | 959 | /// Run the server on an already-bound Unix domain socket listener (used by |
960 | - /// the prefork supervisor to hand a UDS fd to a worker child). | |
960 | + /// the prefork supervisor to hand a UDS fd to a worker child). Unix only. | |
961 | + #[cfg(unix)] | |
961 | 962 | pub async fn run_on_uds(mut self, listener: tokio::net::UnixListener) -> Result<()> { |
962 | 963 | if let Some(router) = self.router.take() { |
963 | 964 | let pool = Arc::new(BufferPool::new()); |
| @@ -1734,6 +1735,7 @@ async fn serve_http( | ||
1734 | 1735 | /// previous run (a common footgun — `bind` fails with EADDRINUSE on an existing |
1735 | 1736 | /// socket path). The socket file is unlinked when the listener is dropped. |
1736 | 1737 | #[cfg(unix)] |
1738 | +#[cfg(unix)] | |
1737 | 1739 | pub async fn bind_unix_listener(path: &std::path::Path) -> Result<tokio::net::UnixListener> { |
1738 | 1740 | // Remove a leftover socket file so re-start doesn't fail with EADDRINUSE. |
1739 | 1741 | if path.exists() { |
| @@ -1772,6 +1774,7 @@ impl Drop for UnixSocketGuard { | ||
1772 | 1774 | /// should extract the common accept loop into a generic function parameterized |
1773 | 1775 | /// over the listener type. See P2-3 in deepanalysis.md. |
1774 | 1776 | #[cfg(unix)] |
1777 | +#[cfg(unix)] | |
1775 | 1778 | async fn serve_unix( |
1776 | 1779 | listener: tokio::net::UnixListener, |
1777 | 1780 | chain: Arc<MiddlewareChain>, |
| @@ -2065,6 +2068,7 @@ mod tests { | ||
2065 | 2068 | // shared `serve_connection` path through `serve_unix`. |
2066 | 2069 | #[cfg(all(unix, not(miri)))] |
2067 | 2070 | #[tokio::test] |
2071 | + #[cfg(unix)] | |
2068 | 2072 | async fn test_unix_socket_serves_http() { |
2069 | 2073 | use tokio::io::{AsyncReadExt, AsyncWriteExt}; |
2070 | 2074 | |
2071 | 2075 | |