Skip to content

Add FreeBSD and OpenBSD builds to CI#1

Open
micheloosterhof wants to merge 8 commits intomainfrom
ci-bsd-builds
Open

Add FreeBSD and OpenBSD builds to CI#1
micheloosterhof wants to merge 8 commits intomainfrom
ci-bsd-builds

Conversation

@micheloosterhof
Copy link
Member

Summary

  • Add FreeBSD build job using vmactions/freebsd-vm
  • Add OpenBSD build job using vmactions/openbsd-vm
  • Both run in parallel with the existing Linux build

Test plan

  • Verify FreeBSD build passes
  • Verify OpenBSD build passes
  • Confirm Linux build still works

Use vmactions to run FreeBSD and OpenBSD in VMs for build testing.
Both run in parallel with the existing Linux build.
- Add cmake/FindReadline.cmake for proper readline detection on all platforms
- Make libdl conditional (BSD has dlopen in libc)
- Add config.passthrough for simple localhost proxy configuration
- Add passthrough integration test with Docker-based CI workflow

The passthrough config proxies all TCP/UDP to localhost services,
responds to ICMP, and presents a Cisco switch OS fingerprint.
- Add __BSD_VISIBLE for FreeBSD to expose u_int type in pcap headers
- Change passthrough config to proxy only specific ports (22, 80, 443, 53)
  instead of all ports, so unconfigured ports appear closed
- Update test to verify both proxy functionality and closed ports
- Add /usr/local/lib and /usr/local/include to libevent search paths
- Add link_directories for library directory to fix linker issues
- Add libpcap to OpenBSD package list
OpenBSD has old libevent 1.x in /usr/lib but we need libevent2 from
/usr/local/lib (installed via pkg_add). Use NO_DEFAULT_PATH to check
our hints first before falling back to system paths.
- Remove PCRE dependency entirely, use standard POSIX regex.h
- proxy.c now uses regcomp/regexec/regfree instead of pcre_*
- Remove PCRE from CMakeLists.txt - proxy/smtp always build now
- Remove pcre from OpenBSD package list in CI

This eliminates an external dependency for simple regex matching.
On OpenBSD (and some other systems), libevent2 is split into two
libraries: libevent_core and libevent_extra. The evtag_* RPC functions
(evtag_marshal, evtag_marshal_timeval, etc.) are in libevent_extra.

- Detect both libevent_core and libevent_extra libraries
- Combine them into LIBEVENT_LIBRARIES variable
- Update all target_link_libraries to use LIBEVENT_LIBRARIES
On OpenBSD, /usr/include/event.h is the old libevent1 header while
libevent2 headers are in /usr/local/include. The evtimer_new and
evsignal_new macros only exist in libevent2 headers.

- Add NO_DEFAULT_PATH to find_path for include directory
- Use include_directories(BEFORE ...) to ensure libevent2 headers
  take precedence over any system headers
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