Skip to content

os: add support for windows - #709

Open
AmyJeanes wants to merge 3 commits into
commaai:masterfrom
AmyJeanes:windows
Open

os: add support for windows#709
AmyJeanes wants to merge 3 commits into
commaai:masterfrom
AmyJeanes:windows

Conversation

@AmyJeanes

@AmyJeanes AmyJeanes commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Native Windows support for openpilot's development build (MSYS2 CLANG64, clang/libc++). Linux and macOS are unchanged apart from a few shared wrappers that now choose the queue directory and IPC calls per platform instead of ifdef ladders.

  • Queues become named shared-memory sections (no /dev/shm; the kernel frees a section with its last handle, so nothing has to sweep queue files).
  • Readers wake on a per-thread named event signalled by thread id, replacing the SIGUSR2/tkill path, in one deadline-based poll loop.
  • visionipc uses AF_UNIX stream sockets with length-prefixed messages and WSAPoll; buffer handles are duplicated into the client (the Windows form of SCM_RIGHTS).
  • build: the cython tool names modules .pyd; the SConstruct uses mingw clang and links libc++ statically; a windows-latest CI entry runs ./test.sh from a CLANG64 shell.

Line endings were split out and comma has already merged them.

Part of a six-repo series: commaai/openpilot#38810, commaai/panda#2427, commaai/opendbc#3724, commaai/rednose#61, commaai/dependencies#107. Each merges independently; only openpilot depends on the others.

Generated with Claude, human-reviewed and tested locally and in CI.

@AmyJeanes AmyJeanes changed the title os: add support for windows (1/2) os: add support for windows Sep 7, 2026
AmyJeanes added a commit to AmyJeanes/openpilot-upstream that referenced this pull request Sep 9, 2026
--- TODO REMOVE AFTER THE SUBMODULE PRS MERGE (commaai/msgq#709, commaai/panda#2427, commaai/rednose#61, commaai/opendbc#3724) ---

Until the four submodule PRs merge, the pointers move to the windows-tidy
branches on my fork and .gitmodules fetches them from there: panda and
opendbc just below their own TEMP index commits (their uv sources would
leak into this lockfile), rednose at its TEMP commit (its source supplies
comma-deps-eigen for Windows), msgq's series on openpilot's current pin
(windows-tidy-pin). The lock follows the submodules' metadata.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt
AmyJeanes added a commit to AmyJeanes/openpilot-upstream that referenced this pull request Sep 9, 2026
--- TODO REMOVE AFTER THE SUBMODULE PRS MERGE (commaai/msgq#709, commaai/panda#2427, commaai/rednose#61, commaai/opendbc#3724) ---

Until the four submodule PRs merge, the pointers move to the windows-tidy
branches on my fork and .gitmodules fetches them from there: panda and
opendbc just below their own TEMP index commits (their uv sources would
leak into this lockfile), rednose at its TEMP commit (its source supplies
comma-deps-eigen for Windows), msgq's series on openpilot's current pin
(windows-tidy-pin). The lock follows the submodules' metadata.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt
AmyJeanes added a commit to AmyJeanes/openpilot-upstream that referenced this pull request Sep 9, 2026
--- TODO REMOVE AFTER THE SUBMODULE PRS MERGE (commaai/msgq#709, commaai/panda#2427, commaai/rednose#61, commaai/opendbc#3724) ---

Until the four submodule PRs merge, the pointers move to the windows-tidy
branches on my fork and .gitmodules fetches them from there: panda and
opendbc just below their own TEMP index commits (their uv sources would
leak into this lockfile), rednose at its TEMP commit (its source supplies
comma-deps-eigen for Windows), msgq's series on openpilot's current pin
(windows-tidy-pin). The lock follows the submodules' metadata.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt
@adeebshihadeh adeebshihadeh mentioned this pull request Sep 9, 2026
adeebshihadeh pushed a commit that referenced this pull request Sep 9, 2026
AmyJeanes and others added 3 commits September 9, 2026 18:14
Queues and fake-event state are named sections (no /dev/shm; a queue file
that is only mapped cannot be swept). Readers wait on a per-thread event
that publishers signal by thread id, in place of SIGUSR2, through the one
deadline loop msgq_poll now uses everywhere; fake events are named events
instead of FIFOs. visionipc duplicates section handles into the peer over
AF_UNIX stream sockets, the Windows form of SCM_RIGHTS; sockets close via
ipc_close(), and setenv/unsetenv are shimmed. Tests close their queues and
time with perf_counter; msgq_shm_dir() replaces the /dev/shm vs /tmp ladders.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt
Python imports extension modules as .pyd on Windows. The cython tool
renames the .so targets the SConscripts declare, so neither they nor a
SConstruct that loads the tool has to know.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt
SCons takes the mingw tool with clang (the default picks MSVC), links
libc++ statically so the binaries run outside the shell, and winsock for
visionipc's sockets; setup.py copies the .pyd. setup.sh pins uv to a
native CPython, MSYS2's own python being first on PATH; test.sh addresses
the venv directory, not bin/python, so Scripts/ works too. CI gains a
windows-latest entry in the CLANG64 shell, with five minutes for ./test.sh
on the 4-core runner.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt
AmyJeanes added a commit to AmyJeanes/openpilot-upstream that referenced this pull request Sep 9, 2026
--- TODO REMOVE AFTER THE SUBMODULE PRS MERGE (commaai/msgq#709, commaai/panda#2427, commaai/rednose#61, commaai/opendbc#3724) ---

Until the four submodule PRs merge, the pointers move to the windows-tidy
branches on my fork and .gitmodules fetches them from there: panda and
opendbc just below their own TEMP index commits (their uv sources would
leak into this lockfile), rednose at its TEMP commit (its source supplies
comma-deps-eigen for Windows), msgq at its tip. The lock follows the
submodules' metadata.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt
AmyJeanes added a commit to AmyJeanes/openpilot-upstream that referenced this pull request Sep 9, 2026
--- TODO REMOVE AFTER THE SUBMODULE PRS MERGE (commaai/msgq#709, commaai/panda#2427, commaai/rednose#61, commaai/opendbc#3724) ---

Until the four submodule PRs merge, the pointers move to the windows-tidy
branches on my fork and .gitmodules fetches them from there: panda and
opendbc just below their own TEMP index commits (their uv sources would
leak into this lockfile), rednose at its TEMP commit (its source supplies
comma-deps-eigen for Windows), msgq at its tip. The lock follows the
submodules' metadata.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt
AmyJeanes added a commit to AmyJeanes/openpilot-upstream that referenced this pull request Sep 9, 2026
--- TODO REMOVE AFTER THE SUBMODULE PRS MERGE (commaai/msgq#709, commaai/panda#2427, commaai/rednose#61, commaai/opendbc#3724) ---

Until the four submodule PRs merge, the pointers move to the windows-tidy
branches on my fork and .gitmodules fetches them from there: panda and
opendbc just below their own TEMP index commits (their uv sources would
leak into this lockfile), rednose at its TEMP commit (its source supplies
comma-deps-eigen for Windows), msgq at its tip. The lock follows the
submodules' metadata.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant