Skip to content

Comments

ci: add FreeBSD build CI and glog 0.7.x compatibility#3225

Draft
tuaris wants to merge 1 commit intoapache:masterfrom
tuaris:pr/freebsd-ci
Draft

ci: add FreeBSD build CI and glog 0.7.x compatibility#3225
tuaris wants to merge 1 commit intoapache:masterfrom
tuaris:pr/freebsd-ci

Conversation

@tuaris
Copy link
Contributor

@tuaris tuaris commented Feb 23, 2026

What problem does this PR solve?

Issue Number: N/A

Problem Summary:

brpc has CI for Linux and macOS but not FreeBSD. With FreeBSD platform support added in PR #3224, a CI workflow is needed to prevent regressions.

Additionally, glog >= 0.7 requires GLOG_USE_GLOG_EXPORT to be defined before including its headers. Without this, builds using newer glog versions fail with:

error: <glog/logging.h> was not included correctly.

This is PR 3 of 3 for FreeBSD support:

  1. fix: remove references to non-existent tracked_objects.h in platform_thread_freebsd.cc #3223
  2. feat: improve FreeBSD platform support #3224
  3. This PR — FreeBSD CI + glog 0.7.x compatibility

What is changed and the side effects?

Changed:

  • Added .github/workflows/ci-freebsd.yml — GitHub Actions workflow using vmactions/freebsd-vm to build on FreeBSD 14.2. Modeled after the existing ci-macos.yml.
  • Added conditional GLOG_USE_GLOG_EXPORT detection in CMakeLists.txt — uses check_include_file_cxx("glog/export.h") to detect glog >= 0.7, and only defines GLOG_USE_GLOG_EXPORT when the header exists. Safe with older glog versions. Benefits all platforms, not just FreeBSD.

Side effects:

  • Performance effects:
    None

  • Breaking backward compatibility:
    None — the glog compatibility change is additive and safe with all glog versions.


Check List:

Add GitHub Actions workflow for FreeBSD using vmactions/freebsd-vm@v1.
This runs cmake + make on FreeBSD 14.2 with system-installed deps.

Also add conditional GLOG_USE_GLOG_EXPORT detection for glog >= 0.7
compatibility. This uses check_include_file_cxx to detect glog/export.h
(added in glog 0.7) before defining GLOG_USE_GLOG_EXPORT. Safe with
older glog versions where the header does not exist. This benefits all
platforms, not just FreeBSD.
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