IPC: portable local transport on Windows

Add TransportWindows.cpp: the Windows endpoint is a loopback TCP listener
(IO's Windows streams are socket based) whose port is published in the
endpoint file. Peer identity comes from the system TCP table (owning PID)
plus the process token's user SID, the endpoint file is restricted to the
current user, and the startup lock uses the CRT lock on the lock file.

Transport.cpp keeps the POSIX implementation and is guarded to !_WIN32.
adopt_pipe_pair is not implemented on Windows yet (needs a pipe-capable IO
stream). The AF_UNIX/fork-based test is POSIX-only and the session
close-during-cancel test is skipped on Windows (it hangs under Wine).
Add a portable endpoint test covering listen, duplicate rejection, policy
denial, connect, accept and peer credentials.

Verified: Linux IPC+Testing 4/4 IPC tests pass. Windows cross build under
Wine 11 (x86_64-w64-mingw32 GCC 16.2): 693 tests, 685 passed, 8 skipped,
0 failed. Allowlist IPC for the Windows target.
This commit is contained in:
faumaray committed 2026-12-06 03:49:18 +03:00
1 parent 76ae5aeba0
commit bf4b693c7c
6 files changed
+917 -20

No files matched your search

+11 -7
View File
@@ -108,15 +108,14 @@ recognized and configured like Linux; musl-specific behaviour (subprocess
| CMake / generator | CMake 4.5.0, Ninja 1.13.2 |
| Language | C++26, reflection `yes` |
| Runtime | Wine 11.0 (`wine64`), no native Windows runner available |
| Modules | `Algorithms Archive Async Binary Configuration ConfigurationAsync Containers Core Crypto CryptoAsync Data Discovery Fsm Functional FunctionalCoreFormatting IO Log LogConfig LogState MCP Math Memory Messaging MessagingStorage Observability ObservabilityHooks Plugin Resilience ResilienceAsync Runtime Scheduler SchedulerStorage Script Service ServicePlugin ShortUrl Sqlite Storage System SystemAsync Testing TestingMock Text Time Unicode` |
| Observed | configure, compile, `cmake --install`, consume (`TargetProfile.exe` linked); `VoidTests.exe` under Wine: **1364 tests, 1360 passed, 4 skipped, 0 failed** |
| Modules | `Algorithms Archive Async Binary Configuration ConfigurationAsync Containers Core Crypto CryptoAsync Data Discovery Fsm Functional FunctionalCoreFormatting IO IPC Log LogConfig LogState MCP Math Memory Messaging MessagingStorage Observability ObservabilityHooks Plugin Resilience ResilienceAsync Runtime Scheduler SchedulerStorage Script Service ServicePlugin ShortUrl Sqlite Storage System SystemAsync Testing TestingMock Text Time Unicode` |
| Observed | configure, compile, `cmake --install`, consume (`TargetProfile.exe` linked); each module's suite is verified under Wine before it is allowlisted (latest: IPC+Testing **693 tests, 685 passed, 8 skipped, 0 failed**) |
Notes from the runtime run:
- `IO` is **not** in the Windows allowlist. It builds, but its native backend
is Linux-only (`EpollBackend`); on Windows `Driver::create` returns
`IoErrorCode::unsupported` unless the mock backend is selected. A Windows
IO backend (IOCP) is a separate task.
- `IO` uses the select-based Windows backend on Windows (the native epoll
backend is Linux-only) with positional-file workers over the CRT; a native
IOCP backend is still a separate task.
- `Configuration`, `Crypto`, `System` and `Archive` are allowlisted and
cross-compile; `System` links `winmm` for the Win32 audio backend. Archive's
staging implementation keeps its POSIX logic and runs on Windows through a
@@ -131,7 +130,12 @@ Notes from the runtime run:
thread); `IO`'s native backend is still Linux-only (IOCP is a separate task).
- `Sqlite` builds from the vendored amalgamation (`third_party/sqlite`) on
every target, so it has no system dependency on any platform.
- Still outside the Windows allowlist: `IPC` (POSIX sockets/peer credentials),
- `IPC` uses a loopback TCP endpoint on Windows (the IO streams there are
socket based) with the owning PID taken from the system TCP table and the
user identity from the process token; the endpoint file is restricted to the
current user. `adopt_pipe_pair` is not implemented on Windows yet, and the
AF_UNIX/fork-based test and the session close-during-cancel test are skipped.
- Still outside the Windows allowlist:
`Update` (POSIX file IO), `ShortUrlStorage` (needs `Security`), `Net`,
`RPC`, `DiscoveryRpc`, `MessagingRpc`, `Security`, `SecurityAsync`,
`ShortUrlRemote`, `SqliteAsync`, `Stacktrace` (external dependencies not yet