Skip to content

Build the firmware and libpanda with the mingw tools on Windows - #1

Closed
AmyJeanes wants to merge 2 commits into
windows-basefrom
windows
Closed

AmyJeanes wants to merge 2 commits into
windows-basefrom
windows

Conversation

@AmyJeanes

Copy link
Copy Markdown
Owner

Fork-internal draft: runs this repository's own CI on the windows series before it is proposed upstream. The base branch windows-base is the upstream commit the series builds on. Not for merging.

🤖 Generated with Claude Code

https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt

The default SCons tools pick MSVC there. The host-side libpanda test
library is skipped on Windows: -nostdlib does not link as a DLL.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt
The test library's own Environment picked MSVC on Windows; use the mingw
tool with clang like the firmware build. SCons requires the .dll suffix
there, so name the target and the cffi path per platform, and skip the
import library nobody links against.

CANPacket_t is memcpy'd onto the USB wire, so the DLL must use the packed
GCC bitfield layout (-mno-ms-bitfields): mingw's MS layout puts the checksum
at byte 8 instead of 5. cffi's Windows backend follows MSVC bitfield rules
and cannot be switched, but MSVC packs same-typed bitfields contiguously, so
declaring the three flag bits as unsigned int like addr gives the firmware
layout under both rule sets (unchanged layout on Linux and macOS).

tests/usbprotocol/test_comms.py passes on Windows (5/5).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AgqYZYWLpwE2T5vS3nVEt
@AmyJeanes

Copy link
Copy Markdown
Owner Author

Superseded by commaai#2427: comma's CI runs on the upstream PR now.

@AmyJeanes AmyJeanes closed this Sep 7, 2026
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