Skip to content

ci: add Windows build (MSYS2/mingw-w64) - #20

Merged
bluecmd merged 4 commits into
masterfrom
ci/windows-build
Jul 23, 2026
Merged

bluecmd merged 4 commits into
masterfrom
ci/windows-build

Conversation

@bluecmd

@bluecmd bluecmd commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Adds a GitHub Actions job that builds the netsnmp C extension on Windows using the MSYS2 mingw-w64 toolchain.

  • net-snmp (mingw-w64) provides net-snmp-config, so setup.py works unchanged
  • gcc + a matching mingw Python build the extension
  • Scope is build-only for now (no test run / snmpd)

🤖 Generated with Claude Code

bluecmd and others added 4 commits July 23, 2026 17:07
Build the netsnmp C extension on Windows using the MSYS2 mingw-w64
toolchain, which provides net-snmp (with net-snmp-config), gcc and a
matching Python so setup.py works unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014KG1c9XtKawkvig5PnZjC8
net-snmp is not packaged for Windows in MSYS2, vcpkg or conda-forge, so
build the client library from source into the mingw64 prefix. This puts
net-snmp-config on PATH so setup.py works unchanged. Result is cached.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014KG1c9XtKawkvig5PnZjC8
- setup.py: invoke net-snmp-config via sh on Windows (cmd.exe cannot exec
  the shell script) and link ws2_32 for the winsock symbols.
- client_intf.c: use winsock2.h/ws2tcpip.h instead of arpa/inet.h and
  netdb.h on _WIN32.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014KG1c9XtKawkvig5PnZjC8
setup-msys2 installs to $RUNNER_TEMP\msys64, not C:\msys64, so the
cache never matched and net-snmp was rebuilt every run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014KG1c9XtKawkvig5PnZjC8
@bluecmd
bluecmd requested a review from SoundGoof July 23, 2026 15:51

@SoundGoof SoundGoof left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@bluecmd
bluecmd merged commit cc588fd into master Jul 23, 2026
2 checks passed
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.

2 participants