Skip to content

fix(engine): drop cactus_graph.h include so the shipped framework header compiles - #774

Open
ayaangazali wants to merge 1 commit into
cactus-compute:mainfrom
ayaangazali:fix/xcframework-self-contained-header
Open

ayaangazali wants to merge 1 commit into
cactus-compute:mainfrom
ayaangazali:fix/xcframework-self-contained-header

Conversation

@ayaangazali

@ayaangazali ayaangazali commented Jul 20, 2026 •

Copy link
Copy Markdown

What

Removes the #include "cactus_graph.h" line from cactus-engine/cactus_engine.h.

Why

apple/build.sh copies cactus_engine.h as the only header inside the iOS/macOS xcframeworks (cp_headers, line 37), and the module map exports just that header. Since its first include is cactus_graph.h, which is not bundled, import cactus fails out of the box:

fatal error: 'cactus_graph.h' file not found
could not build module 'cactus'

Nothing in the C FFI surface of the header references graph types, so the include is unnecessary for consumers. On the engine side every file that uses graph symbols already includes cactus_graph.h directly (src/engine.h:14, src/log.cpp:2, src/model.cpp:2, tests/test_kv_compress.cpp:4), so nothing relied on the transitive include.

Closes #771

Gates

  • ./venv/bin/cactus test --component engine on Apple Silicon (M-series): all tests pass
  • Header now compiles standalone: clang -fsyntax-only -x c -std=c11 and -x c++ -std=c++20 both clean
  • 2-line deletion, no behavior change for in-repo builds

apple/build.sh bundles cactus_engine.h as the sole header of the iOS/macOS
xcframeworks, but its first include pulls in cactus_graph.h, which is not
shipped in the framework. Any consumer following bindings/swift/README.md
fails at `import cactus` with "'cactus_graph.h' file not found".

Nothing in the C FFI surface references graph types, and every internal
consumer already includes cactus_graph.h directly (engine.h, log.cpp,
model.cpp, tests), so the include can simply go. The header now compiles
standalone as C11 and C++20.

Closes cactus-compute#771

Signed-off-by: ayaangazali <ayaangazali.work@gmail.com>
Copilot AI review requested due to automatic review settings July 20, 2026 19:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

iOS/macOS xcframework: import cactus fails as shipped — bundled cactus_engine.h includes cactus_graph.h, which is not in the framework

2 participants