Skip to content

Add FreeBSD platform support#204

Open
elliejs wants to merge 1 commit into
CadQuery:masterfrom
elliejs:freebsd-support
Open

Add FreeBSD platform support#204
elliejs wants to merge 1 commit into
CadQuery:masterfrom
elliejs:freebsd-support

Conversation

@elliejs

@elliejs elliejs commented Jun 25, 2026

Copy link
Copy Markdown

Summary

  • Add build-job-freebsd.yml CI workflow for FreeBSD 15.0 using vmactions/freebsd-vm, with all dependencies from FreeBSD pkg (no conda-forge packages exist for FreeBSD). Follows the same two-phase generate/compile structure as the other platforms.
  • Add [FreeBSD] platform section to ocp.toml with system include paths and using declarations for 13 nested C++ types that FreeBSD's clang resolves differently than other platforms.
  • Update dump_symbols.py for lief <0.14 compatibility (lief.EXE_FORMATS fallback), fix a crash when lief.parse() returns None, and detect FreeBSD as a distinct ELF platform.
  • Add FreeBSD case to CMakeLists.txt platform detection and job entry to bindings.yml.

Notes

  • The clang Python bindings are pip-installed because the FreeBSD port (py311-clang 11.0) is too old to drive libclang 22 from llvm-devel.
  • Companion pywrap PR forthcoming with FreeBSD platform detection, CMake MPI support, and symbol manifest.

Test plan

  • FreeBSD CI generate phase completes successfully
  • FreeBSD CI compile phase completes successfully
  • import OCP test passes in CI
  • Stubs generated and uploaded
  • Verified locally: full pywrap generate + ninja compile on FreeBSD 15.0

🤖 Generated with Claude Code

@elliejs

elliejs commented Jun 25, 2026

Copy link
Copy Markdown
Author

I have no idea why that OSX 3.11 job failed. Clang itself segfaulted, it didn't even emit an error, so I think it's unrelated to this change. In my own fork (which also has my own forked pywrap, so slightly different), this check passes. pywrap sister PR here: CadQuery/pywrap#62

action run with passing osx 3.11 here: https://github.com/elliejs/OCP/actions/runs/28189561694/job/83530983484

Add build-job-freebsd.yml CI workflow for generating and compiling OCP
bindings on FreeBSD 15.0 using vmactions/freebsd-vm. FreeBSD has no
conda-forge packages, so all dependencies come from the FreeBSD pkg
system (latest repo). The workflow follows the same two-phase structure
(generate → compile) as the other platforms, with source caching between
phases and a combined sources+stubs artifact upload. The clang Python
bindings are pip-installed because the FreeBSD pkg version (11.0) is
too old to drive libclang 22 from llvm-devel.

Add a [FreeBSD] platform section to ocp.toml with system include paths
and a FreeBSD symbol manifest. Add `using` declarations
(include_header_pre) for 13 nested C++ types across 11 modules
(Standard, OSD, Aspect, SelectMgr, AIS, Graphic3d, BRepGProp,
ShapeProcess, BOPAlgo, Message, IntPatch, HLRAlgo) — FreeBSD's clang
resolves these nested types (e.g. Standard_MMgrOpt::TPCallBackFunc,
HLRAlgo_PolyData::Box) to a different canonical form than other
platforms, so pybind11 needs explicit forward declarations to bind them.

Update dump_symbols.py to support lief <0.14 (FreeBSD pkg ships 0.12.3),
which uses lief.EXE_FORMATS instead of lief.Binary.FORMATS. The
existing code used p.FORMATS which only works on 0.14+. The fallback
(getattr + or) now supports both. Also reorder the lief.parse() None
check before accessing p.format (was a crash on parse failure), add an
empty-string guard for the semicolon-split lib list, and detect FreeBSD
as a distinct ELF platform via platform.system().

Add FreeBSD case to CMakeLists.txt platform detection and FreeBSD job
entry to bindings.yml.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@elliejs

elliejs commented Jun 26, 2026

Copy link
Copy Markdown
Author

yeah I only changed the commit message but it all passes now, yay

@adam-urbanczyk

Copy link
Copy Markdown
Member

I would expect no changes needed in ocp.toml except for the [FreeBSD] section. What is the reason of the remaining changes.

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