Skip to content

Restore Windows support (optional UDS + SIGUSR1)#475

Open
goodboy wants to merge 7 commits into
mainfrom
windows_support_round2
Open

Restore Windows support (optional UDS + SIGUSR1)#475
goodboy wants to merge 7 commits into
mainfrom
windows_support_round2

Conversation

@goodboy

@goodboy goodboy commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Restore Windows support (optional UDS + SIGUSR1)

Replacement for #408, towards #404; resolves #405.

Motivation

import tractor currently raises on Windows (and any CPython built
without socket.AF_UNIX): the UDS transport backend
(tractor.ipc._uds) imports AF_UNIX at module top, and
tractor.devx._stackscope imports signal.SIGUSR1 — neither exists
on Windows. Because several core modules pull _uds into the import tractor graph, the package won't even import there, which blocks all
downstream Windows use (see #405).

This makes both the UDS backend and the SIGUSR1 trace-dump hook
optional: where they're unavailable the runtime degrades to a
TCP-only, no-SIGUSR1 configuration instead of crashing. Built on
the contributor fix/windows work, rebased onto the post-reorg tree
and hardened so import tractor actually succeeds on Windows.

Summary of changes

  • gate the UDS backend at its root: ipc/_uds.py guards its lone
    AF_UNIX import so the module stays importable everywhere, while
    use of the backend stays gated on trio's has_unix.
  • expose a single HAS_UDS capability flag (= trio.has_unix) as
    the one source of truth; ipc/_types, discovery/_addr and
    ipc/_server import it and register the uds transport / address
    / loopback entries only when it's True.
  • make signal.SIGUSR1 optional in devx/_stackscope:
    enable_stack_on_sig() no-ops gracefully when no SIGUSR1 exists
    instead of raising deep in signal() setup.
  • add a windows-latest CI leg (UDS excluded as POSIX-only;
    informational via continue-on-error while support matures) plus
    an import tractor smoke step as the hard signal.

Testing on Windows (step-by-step)

CI can't fully prove Windows support yet, so hands-on community
testing is very welcome. These steps assume no prior experience
with our packaging tool (uv) or pytest. Run them in
PowerShell.

  1. Install Python 3.13 from https://www.python.org/downloads/ (tick
    "Add python.exe to PATH" in the installer).

  2. Install uv, our project/venv manager:

    pip install uv
  3. Grab the PR branch (install the GitHub CLI gh first if needed:
    https://cli.github.com/):

    gh repo clone goodboy/tractor
    cd tractor
    gh pr checkout 475
  4. Create the virtualenv and install everything (reads
    pyproject.toml and builds an isolated .venv):

    uv sync
  5. Smoke test — this is the core fix. It MUST print ok and must NOT
    raise ImportError:

    uv run python -c "import tractor; print('ok')"
  6. Run the test suite over TCP (UDS is POSIX-only, so it's skipped on
    Windows). uv run executes inside the venv from step 4:

    uv run pytest tests/ --tpt-proto tcp -rsx
  7. What to paste back into this PR:

  • the step 5 smoke-test result,
  • the final pytest summary line (e.g. N passed, M failed),
  • the full traceback of any failures.

Don't worry if some tests fail — Windows support is new and any
failure list is useful signal for follow-ups.

Future follow up

The clean transport-unavailable error and the data-driven transport
registries are done in this PR. The remaining Windows-suite work —
getting the windows-latest leg fully green (it currently runs
continue-on-error and reports 44 failures), then promoting it to a
required check — is tracked in #476.

Links

(this pr content was generated in some part by claude-code)

Copilot AI review requested due to automatic review settings June 29, 2026 23:21
@goodboy goodboy mentioned this pull request Jun 29, 2026
1 task

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make Tractor’s POSIX-specific IPC pieces (UDS transport selection and SIGUSR1 stackscope dumps) optional so the codebase can import and run on Windows without failing.

Changes:

  • Made the UDS backend import conditional (based on platform / AF_UNIX availability) and adjusted transport registries accordingly.
  • Updated discovery address registries/defaults to omit UDS when unavailable.
  • Made SIGUSR1 platform-dependent to avoid importing unavailable signals on Windows.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

File Description
tractor/ipc/_types.py Conditionalizes UDS backend availability and registers transports accordingly.
tractor/ipc/_server.py Makes UDS import optional in the IPC server module.
tractor/discovery/_addr.py Conditionalizes UDS address type registration/defaults for discovery.
tractor/devx/_stackscope.py Makes SIGUSR1 optional/conditional for stackscope signal-based dumps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tractor/discovery/_addr.py Outdated
except Exception as e:
log.warning("UDS backend import failed: %s", e)
else:
log.warning("UDS backend disabled on this platform.")

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Good catch — these import-time log.warnings are gone. UDS availability is now a single HAS_UDS = trio.has_unix flag and the transport/address registries derive from it, so there's no per-import warning noise on Windows/no-AF_UNIX hosts.

📎 already addressed in 83d45435

Comment thread tractor/discovery/_addr.py Outdated
if UDSAddress is not None:
_address_types['uds'] = UDSAddress
else:
log.warning("Skipping UDS address type: no UDS backend available.")

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Good catch — these import-time log.warnings are gone. UDS availability is now a single HAS_UDS = trio.has_unix flag and the transport/address registries derive from it, so no per-import warning noise on Windows/no-AF_UNIX hosts.

📎 already addressed in 83d45435

Comment thread tractor/discovery/_addr.py Outdated
if UDSAddress is not None:
_default_lo_addrs['uds'] = UDSAddress.get_root().unwrap()
else:
log.warning("Skipping UDS default loopback address: no UDS backend available.")

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Good catch — these import-time log.warnings are gone. UDS availability is now a single HAS_UDS = trio.has_unix flag and the transport/address registries derive from it, so no per-import warning noise on Windows/no-AF_UNIX hosts.

📎 already addressed in 83d45435

Comment thread tractor/ipc/_server.py Outdated
Comment on lines +74 to +83
from ._tcp import TCPAddress

log = log.get_logger()

UDSAddress = None

if getattr(socket, "AF_UNIX", None) is not None and platform.system() != "Windows":
from ._uds import UDSAddress
else:
pass

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Fixed at the root: tractor.ipc._uds is now import-safe (only its AF_UNIX import is guarded), so UDSAddress stays a real class on every platform — never None. wrap_address() and the UDSAddress|TCPAddress annotations are fine; actual UDS use is gated on HAS_UDS / trio.has_unix.

📎 already addressed in 83d45435

Comment on lines +45 to +48
if platform.system() != "Windows":
from signal import SIGUSR1
else:
SIGUSR1 = None

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Addressed — enable_stack_on_sig() now early-returns (no-op + warning) when sig is None, so a missing SIGUSR1 on Windows degrades gracefully instead of hitting getsignal(None) / signal(None, ...).

📎 already addressed in 83d45435

Comment thread tractor/ipc/_types.py Outdated

# if TYPE_CHECKING:
# from tractor._addr import Address
log = logging.getLogger(__name__)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Addressed — the module no longer uses the stdlib logging; the whole gating block (and its logger) was dropped when the registries became data-driven, so no stray logging.getLogger() remains.

📎 already addressed in 83d45435

Comment thread tractor/ipc/_types.py Outdated
Comment on lines +57 to +58
except Exception as e:
log.warning("UDS backend unavailable (%s); continuing without it.", e)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Addressed — there is no longer a try/except Exception around the UDS import. Since _uds is import-safe, _types imports UDSAddress / MsgpackUDSStream / HAS_UDS unconditionally, so a real _uds bug now surfaces loudly instead of being swallowed into a silent TCP-only fallback.

📎 already addressed in 83d45435

Comment thread tractor/discovery/_addr.py Outdated
HAS_AF_UNIX = getattr(socket, "AF_UNIX", None) is not None
IS_WINDOWS = platform.system() == "Windows"

UDSAddress = None # so references exist but do nothing on Windows

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Fixed at the root: tractor.ipc._uds is now import-safe (only its AF_UNIX import is guarded), so UDSAddress stays a real class on every platform — never None. wrap_address() and the UDSAddress|TCPAddress annotations are fine; actual UDS use is gated on HAS_UDS / trio.has_unix.

📎 already addressed in 83d45435

@goodboy goodboy force-pushed the windows_support_round2 branch 2 times, most recently from 2743b81 to 5bf6417 Compare June 29, 2026 23:38
@goodboy goodboy requested a review from Copilot June 29, 2026 23:38
@goodboy goodboy added windows_related IPC and transport non-linux for those who prefer walled gardens (macos, windows, etc.) the_AIs_are_taking_over slowly conceding to the reality the botz mk us more productive, but we require SC to avoid skynet.. labels Jun 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread tractor/ipc/_server.py Outdated
Comment on lines +78 to +82
UDSAddress = None

if getattr(socket, "AF_UNIX", None) is not None and platform.system() != "Windows":
from ._uds import UDSAddress
else:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Fixed at the root: tractor.ipc._uds is now import-safe (only its AF_UNIX import is guarded), so UDSAddress stays a real class on every platform — never None. wrap_address() and the UDSAddress|TCPAddress annotations are fine; actual UDS use is gated on HAS_UDS / trio.has_unix.

📎 already addressed in 83d45435

Comment thread tractor/discovery/_addr.py Outdated
Comment on lines +49 to +53
UDSAddress = None # so references exist but do nothing on Windows

if HAS_AF_UNIX and not IS_WINDOWS:
try:
from ..ipc._uds import UDSAddress as _UDSAddress

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Fixed at the root: tractor.ipc._uds is now import-safe (only its AF_UNIX import is guarded), so UDSAddress stays a real class on every platform — never None. wrap_address() and the UDSAddress|TCPAddress annotations are fine; actual UDS use is gated on HAS_UDS / trio.has_unix.

📎 already addressed in 83d45435

Comment on lines +44 to +47
if platform.system() != "Windows":
from signal import SIGUSR1
else:
SIGUSR1 = None

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Addressed — enable_stack_on_sig() now early-returns (no-op + warning) when sig is None, so a missing SIGUSR1 on Windows degrades gracefully instead of hitting getsignal(None) / signal(None, ...).

📎 already addressed in 83d45435

Comment thread tractor/ipc/_types.py Outdated
Comment on lines +57 to +58
except Exception as e:
log.warning("UDS backend unavailable (%s); continuing without it.", e)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 response authored by claude-code

Addressed — there is no longer a try/except Exception around the UDS import. Since _uds is import-safe, _types imports UDSAddress / MsgpackUDSStream / HAS_UDS unconditionally, so a real _uds bug now surfaces loudly instead of being swallowed into a silent TCP-only fallback.

📎 already addressed in 83d45435

@goodboy

goodboy commented Jun 30, 2026

Copy link
Copy Markdown
Owner Author

Self-review of #475 (xhigh, source-traced)

Ran a deep multi-angle review. Headline: as it stood, import tractor still crashed on Windows — the first commit gated UDS in
its 4 files but missed other eager tractor.ipc._uds importers in
the import tractor graph. A follow-up commit (incoming) fixes the
root cause; findings + status below. (Most findings live in files
not in the PR diff, so they're listed here with file:line refs
rather than as inline threads.)

Every eager _uds importer — _uds.py does from socket import AF_UNIX at top, which raises on Windows:

importer gated before? status
discovery/_addr.py, ipc/_types.py kept
discovery/_api.py:39 ❌ top-level fixed at root
spawn/_reap.py:82 ❌ top-level fixed at root
discovery/_multiaddr.py:102 fixed at root
_testing/addr.py:91 fixed at root

🔴 Critical — import tractor fails on Windows

  • discovery/_api.py:39 ungated top-level from ..ipc._uds import UDSAddress (imported by __init__.py:33). → ImportError: cannot import name 'AF_UNIX'.
  • spawn/_reap.py:82 ungated, via __init__ → _root → spawn._spawn → _reap. Second independent crash.

🟠 High — runtime crashes on Windows

  • discovery/_multiaddr.py:102 _uds import before the match
    → wrapping any maddr (even TCP) ImportErrors.
  • devx/_stackscope.py:358 enable_stack_on_sig(sig=SIGUSR1)
    defaults to None on Windows; body getsignal(sig)/signal(sig)
    TypeError (callers only catch ImportError).
  • discovery/_addr.py:268 wrap_address sets cls = UDSAddress
    (None) then cls.from_addr(addr)AttributeError.

🟡 Medium

  • get_address_cls/default_lo_addrs (_addr.py:213/312) and
    _testing/addr.py:58-59, _testing/pytest.py:797 index
    _address_types['uds']/_default_lo_addrs['uds'] → bare
    KeyError when uds requested on a no-UDS host.
  • ipc/_server.py:80 UDS import not in try/except (siblings are)
    → inconsistent degrade on POSIX import failures.
  • ipc/_types.py:57 & _addr.py:55 broad except Exception
    swallows genuine _uds bugs on POSIX into a silent TCP-only fall.

🔵 Design / 🟦 cleanup

  • Three divergent "is UDS available" predicates (_types.HAS_UDS
    needs UDSAddress and MsgpackUDSStream; _addr.UDSAddress is not None; _server inline getattr) — none is trio's has_unix, the
    flag that actually gates socket creation (_uds.py:379).
  • Reuse: _chan.py:65 already has _is_windows; trio's
    has_unix already imported in _uds.py:48.
  • Registries not data-driven: 5 maps each hand-guard if HAS_UDS.
  • Import-time warning spam: ≥4 log.warnings for the expected
    Windows case, emitted via logging.lastResort before logging is
    configured.
  • Style (py-codestyle): """''' docstrings, spaced |
    unions, double-quotes, >69-col lines in _types.py/_addr.py.

Confirmed NOT bugs

  • _server.py:643 dict[UDSAddress|TCPAddress, ...] annotation —
    lazy under from __future__ import annotations (safe).
  • _types.py:73 Address = TCPAddress | UDSAddress was correctly
    guarded by if HAS_UDS:.

Fix approach (follow-up commit)

Make ipc/_uds.py import-safe (guard the one AF_UNIX import;
UDSAddress stays a real class) + a single HAS_UDS = trio.has_unix
imported by all consumers, which gate their registries on it. This
fixes every import crash at the root (no per-importer guards needed),
makes wrap_address/isinstance safe, fixes enable_stack_on_sig,
drops the warning spam, and adds a windows-latest CI leg
(informational) + an import tractor smoke step. Verified on Linux
(UDS still fully works) and via a has_unix=False simulation; real
Windows is validated by the new CI leg.

Deferred (low value / behaviour-risk): the KeyError→clean-error
messages on get_address_cls/default_lo_addrs, and making the
transport registries fully data-driven.

🤖 review via claude-code /code-review

goodboy added a commit that referenced this pull request Jun 30, 2026
The prior round gated UDS in four modules but `import tractor`
still crashed on Windows: `tractor.ipc._uds` does `from socket
import AF_UNIX` at module top, and several modules in the import
graph (`discovery._api`, `spawn._reap`, `discovery._multiaddr`,
`_testing.addr`) import `_uds` unconditionally. Instead of
guarding every importer, fix the root and collapse the per-module
probes to one capability flag.

- in `ipc/_uds.py`, guard the lone `AF_UNIX` import so the module
  stays importable everywhere; expose `HAS_UDS = trio.has_unix`
  as the single source of truth (the same predicate that gates
  `trio.open_unix_socket()`).
- `ipc/_types.py`, `discovery/_addr.py` and `ipc/_server.py` now
  import `UDSAddress`/`MsgpackUDSStream`/`HAS_UDS` directly and
  gate the transport + address registries on `HAS_UDS`; drop the
  duplicated `getattr(socket,'AF_UNIX')` / `platform.system()`
  probes, the dead `HAS_AF_UNIX` conjunct, and the import-time
  `log.warning()` spam.
- `devx/_stackscope.py` `enable_stack_on_sig()` early-returns
  when `sig is None`, so a missing `SIGUSR1` (Windows) degrades
  to a no-op instead of a `TypeError` from `getsignal()` /
  `signal()`.
- add a `windows-latest` CI leg (UDS excluded; informational via
  `continue-on-error` while support matures) plus an `import
  tractor` smoke step as the hard signal for the import fix.

Because `_uds` is importable everywhere `UDSAddress` stays a real
class, so `isinstance()` checks and `wrap_address()` no longer
`AttributeError` on no-UDS hosts; actual socket use stays gated
on `has_unix`.

Review: #475
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
goodboy added 3 commits June 29, 2026 23:37
Windows (and any CPython that doesn't expose `socket.AF_UNIX`)
can't import the UDS transport backend nor `signal.SIGUSR1`, so
the unconditional imports break `import tractor` outright on
those hosts. Guard the platform-specific bits behind capability
probes and fall back to a TCP-only runtime when the UDS backend
is unavailable.

- across `discovery/_addr.py`, `ipc/_server.py` and
  `ipc/_types.py`, gate on `getattr(socket, 'AF_UNIX', None)` +
  `platform.system()` and import `UDSAddress` /
  `MsgpackUDSStream` only when supported, leaving the names as
  `None` otherwise.
- register the `'uds'` key in `_address_types`, its
  default-loopback addr, and the transport lookup maps only when
  the backend actually loads, so TCP keeps working standalone.
- in `devx/_stackscope.py`, import `SIGUSR1` conditionally and
  set it to `None` on Windows.

Rebased onto the post-reorg tree where `_addr.py` now lives
under `tractor/discovery/`; adapt the relocated imports to the
package's `..ipc._uds` / `..ipc._tcp` paths (the original
single-dot paths would silently disable UDS on POSIX) and drop a
duplicated `TYPE_CHECKING` block and dead `import logging` left
by the move.

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
The prior round gated UDS in four modules but `import tractor`
still crashed on Windows: `tractor.ipc._uds` does `from socket
import AF_UNIX` at module top, and several modules in the import
graph (`discovery._api`, `spawn._reap`, `discovery._multiaddr`,
`_testing.addr`) import `_uds` unconditionally. Instead of
guarding every importer, fix the root and collapse the per-module
probes to one capability flag.

- in `ipc/_uds.py`, guard the lone `AF_UNIX` import so the module
  stays importable everywhere; expose `HAS_UDS = trio.has_unix`
  as the single source of truth (the same predicate that gates
  `trio.open_unix_socket()`).
- `ipc/_types.py`, `discovery/_addr.py` and `ipc/_server.py` now
  import `UDSAddress`/`MsgpackUDSStream`/`HAS_UDS` directly and
  gate the transport + address registries on `HAS_UDS`; drop the
  duplicated `getattr(socket,'AF_UNIX')` / `platform.system()`
  probes, the dead `HAS_AF_UNIX` conjunct, and the import-time
  `log.warning()` spam.
- `devx/_stackscope.py` `enable_stack_on_sig()` early-returns
  when `sig is None`, so a missing `SIGUSR1` (Windows) degrades
  to a no-op instead of a `TypeError` from `getsignal()` /
  `signal()`.
- add a `windows-latest` CI leg (UDS excluded; informational via
  `continue-on-error` while support matures) plus an `import
  tractor` smoke step as the hard signal for the import fix.

Because `_uds` is importable everywhere `UDSAddress` stays a real
class, so `isinstance()` checks and `wrap_address()` no longer
`AttributeError` on no-UDS hosts; actual socket use stays gated
on `has_unix`.

Review: #475
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
`tests/test_ringbuf.py` imports `tractor.ipc._ringbuf` at module
top, which pulls in `tractor.ipc._linux` whose module-level
`ffi.dlopen(None)` raises `OSError` on Windows (and any non-linux
host). That fires at COLLECTION, before the module's existing
`pytestmark = pytest.mark.skip` can apply, so it aborts the whole
pytest session — the new `windows-latest` CI leg never gets past
collection.

- guard the module with `pytest.skip(allow_module_level=True)`
  gated on `platform.system() != 'Linux'`, placed before the
  crashing import — same idiom as `tests/devx/test_debugger.py`.
- the `eventfd`-based ringbuf backend is linux-only by design, so
  macOS skips cleanly too (previously it only skipped incidentally
  via the absent `cffi` optional dep).

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
@goodboy goodboy force-pushed the windows_support_round2 branch from f22bfdd to 08f7a3a Compare June 30, 2026 03:57
@goodboy goodboy changed the title Make UDS + SIGUSR1 optional for Windows Restore Windows support (optional UDS + SIGUSR1) Jun 30, 2026
goodboy added 4 commits June 30, 2026 02:45
`test_lifetime_stack_wipes_tmpfile` guards spawn+teardown with a
hard-coded `trio.move_on_after()` (1.6s / 1s) that isn't scaled
for slow CI. On a noisy macOS runner the `error_in_child=True`
case times out before the child error propagates, so the scope
cancels and `assert not cs.cancel_called` flips — reddening the
(required) macOS leg. Same unscaled-deadline class `main` already
fixed for `test_dynamic_pub_sub`.

- multiply the budget by `cpu_perf_headroom()` (`tests/conftest`),
  the established deadline-headroom helper (3x on macOS CI, a
  1.0 no-op locally / on un-throttled linux).

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
`tractor`'s infect-asyncio mode runs an `asyncio` loop under
`trio` guest-mode; on Windows the default `ProactorEventLoop` is
incompatible and the suite hangs/crashes mid-run (orphaned py
procs), so the `windows-latest` CI leg never finishes reporting.

- add a module-level `pytest.skip(allow_module_level=True)` gated
  on `platform.system() == 'Windows'` to `test_infected_asyncio`
  and `test_root_infect_asyncio`, before their asyncio-interop
  imports. macOS/linux are unaffected (they run these fine).

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
The five transport/address lookup maps each hand-guarded `uds`
with its own `if HAS_UDS:` block (3 in `ipc/_types`, 2 in
`discovery/_addr`) — easy to let drift so a backend half-registers
(known by address but not by key, listed but unroutable, &c).

- build one `_msg_transports` / `_address_protos` list per module
  (TCP always, UDS only when `HAS_UDS`), then DERIVE every map
  from it via each backend's ClassVars (`codec_key`,
  `address_type`, `proto_key`). Adding a backend now touches one
  list, and the maps can't disagree.

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
`test_parent_writer_child_reader` deadlocks on Windows (the
parent/child shared-mem transfer hangs at the larger frame size),
so the `windows-latest` CI leg ran to the 16-min job cap instead
of completing. It's a genuine nascent-Windows shm bug, not a
clean "unsupported", so it's `skipif`'d (not removed) and tracked
under #404; `test_child_attaches_alot` still runs on Windows.

- `@pytest.mark.skipif(platform.system() == 'Windows', ...)` on
  the parametrized `test_parent_writer_child_reader` so the leg
  completes + reports. linux/macOS unaffected (all 6 variants
  still run).

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IPC and transport non-linux for those who prefer walled gardens (macos, windows, etc.) the_AIs_are_taking_over slowly conceding to the reality the botz mk us more productive, but we require SC to avoid skynet.. windows_related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UDS tpt backend breaks windows on import..

2 participants