Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
889d3b8
feat(c-api): add CMake find_package support for dora-node-api-c
Ts-sound Apr 28, 2026
a63ebf4
feat(cli): generate CMakeLists.txt for C nodes
Ts-sound Apr 28, 2026
3d086dd
feat(c-api): add platform-specific system libraries via dora-node-api…
Ts-sound Apr 28, 2026
632abaf
feat(c-api): add target matching check in cmake config
Ts-sound Apr 28, 2026
e333538
ci: include cmake config files in published C libraries
Ts-sound Apr 28, 2026
eeb0953
fix(c-api): handle --target flag in build.rs for cross-compilation
Ts-sound Apr 28, 2026
9605eb1
fix(c-api): remove cargo:warning output from build.rs
Ts-sound Apr 28, 2026
eb9bc24
fix(c-api): use OUT_DIR to derive target path correctly
Ts-sound Apr 28, 2026
85d8ba3
fix(c-api): normalize CMAKE_SYSTEM_PROCESSOR in cmake config
Ts-sound Apr 28, 2026
b7f4864
ci: add cmake smoke test for find_package
Ts-sound Apr 28, 2026
3772fa5
style(cli): reorder imports in c template module
Ts-sound Apr 28, 2026
6b44ae7
fix(cli,cmake): update executable name and verify path
Ts-sound Apr 28, 2026
3c7bf2a
refactor(c-api): move lib staging to post-build scripts
Ts-sound Apr 28, 2026
d7949c4
refactor(c-api): simplify staging scripts to use TARGET_DIR directly
Ts-sound Apr 28, 2026
8696930
fix(ci): simplify paths filter and fix parameter names
Ts-sound Apr 28, 2026
91372f3
fix(c-api): write cmake files to TARGET_DIR using CARGO_BUILD_TARGET
Ts-sound Apr 28, 2026
a2f0aa9
refactor(c-api): replace shell staging scripts with xtask
Ts-sound Apr 29, 2026
51aebd3
refactor(c-api): generalize cmake templates and xtask stage for all C…
Ts-sound Apr 29, 2026
520c9ab
feat(c-api): add CXX_BRIDGE_FILES cmake variable and fix C++ node tem…
Ts-sound Apr 29, 2026
9652c97
refactor(c-api): simplify dataflow CMake to use find_package + add_su…
Ts-sound Apr 29, 2026
9d11d64
docs(c-api): rewrite C-CPP-LIBRARIES.md for find_package workflow
Ts-sound Apr 29, 2026
7a5ee7f
docs(c-api): add Obtaining the API Libraries section with download an…
Ts-sound Apr 29, 2026
3e734ec
fix(cli): remove unused ContextCompat import in c/cxx template modules
Ts-sound Apr 29, 2026
2e3abd3
fix(cli): remove unused ContextCompat import in c/cxx template modules
Ts-sound Apr 29, 2026
a837780
ci: add C++ node test and merge Unix/Windows CMake steps in test work…
Ts-sound Apr 29, 2026
c8ea02c
ci: separate Unix/Windows CMake steps in test workflow
Ts-sound Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 36 additions & 50 deletions .github/workflows/publish-c-cpp-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,73 +68,59 @@ jobs:
# (cross builds inside Docker and may not expose cxxbridge output).
cargo build -p dora-node-api-cxx -p dora-operator-api-cxx

- name: Package C libraries (Unix)
- name: Stage and Package C libraries (Unix)
if: runner.os != 'Windows'
run: |
PREFIX="dora-c-libraries-${{ matrix.target }}"
mkdir -p "$PREFIX/include" "$PREFIX/lib"

cp target/${{ matrix.target }}/release/libdora_node_api_c.a "$PREFIX/lib/"
cp target/${{ matrix.target }}/release/libdora_operator_api_c.a "$PREFIX/lib/"

cp apis/c/node/node_api.h "$PREFIX/include/"
cp apis/c/operator/operator_api.h "$PREFIX/include/"
cp apis/c/operator/operator_types.h "$PREFIX/include/"
run: |
TARGET="${{ matrix.target }}"
TARGET_DIR="target/$TARGET/release"
C_PREFIX="dora-c-libraries-$TARGET"

tar czf "$PREFIX.tar.gz" "$PREFIX"
cargo run -p xtask -- stage dora-node-api-c "$TARGET_DIR" "$C_PREFIX"

cargo run -p xtask -- stage dora-operator-api-c "$TARGET_DIR" "$C_PREFIX"

tar czf "$C_PREFIX.tar.gz" "$C_PREFIX"

- name: Package C++ libraries (Unix)
if: runner.os != 'Windows'
run: |
PREFIX="dora-cpp-libraries-${{ matrix.target }}"
mkdir -p "$PREFIX/include" "$PREFIX/lib" "$PREFIX/src"

cp target/${{ matrix.target }}/release/libdora_node_api_cxx.a "$PREFIX/lib/"
cp target/${{ matrix.target }}/release/libdora_operator_api_cxx.a "$PREFIX/lib/"

# Bridge headers (generated by host cargo build)
cp target/cxxbridge/dora-node-api-cxx/src/lib.rs.h "$PREFIX/include/dora-node-api.h"
cp target/cxxbridge/dora-operator-api-cxx/src/lib.rs.h "$PREFIX/include/dora-operator-api.h"

# Bridge source files (users must compile these alongside their code)
cp target/cxxbridge/dora-node-api-cxx/src/lib.rs.cc "$PREFIX/src/dora-node-api.cc"
cp target/cxxbridge/dora-operator-api-cxx/src/lib.rs.cc "$PREFIX/src/dora-operator-api.cc"
TARGET="${{ matrix.target }}"
TARGET_DIR="target/$TARGET/release"
CPP_PREFIX="dora-cpp-libraries-$TARGET"

tar czf "$PREFIX.tar.gz" "$PREFIX"
cargo run -p xtask -- stage dora-node-api-cxx "$TARGET_DIR" "$CPP_PREFIX"

cargo run -p xtask -- stage dora-operator-api-cxx "$TARGET_DIR" "$CPP_PREFIX"

tar czf "$CPP_PREFIX.tar.gz" "$CPP_PREFIX"

- name: Package C libraries (Windows)
- name: Stage and Package C libraries (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$prefix = "dora-c-libraries-${{ matrix.target }}"
New-Item -ItemType Directory -Force -Path "$prefix/include", "$prefix/lib"
$target = "${{ matrix.target }}"
$targetDir = "target/$target/release"
$cPrefix = "dora-c-libraries-$target"

Copy-Item "target/${{ matrix.target }}/release/dora_node_api_c.lib" "$prefix/lib/"
Copy-Item "target/${{ matrix.target }}/release/dora_operator_api_c.lib" "$prefix/lib/"

Copy-Item "apis/c/node/node_api.h" "$prefix/include/"
Copy-Item "apis/c/operator/operator_api.h" "$prefix/include/"
Copy-Item "apis/c/operator/operator_types.h" "$prefix/include/"

Compress-Archive -Path "$prefix" -DestinationPath "$prefix.zip"
cargo run -p xtask -- stage dora-node-api-c $targetDir $cPrefix

cargo run -p xtask -- stage dora-operator-api-c $targetDir $cPrefix

Compress-Archive -Path $cPrefix -DestinationPath "$cPrefix.zip"

- name: Package C++ libraries (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$prefix = "dora-cpp-libraries-${{ matrix.target }}"
New-Item -ItemType Directory -Force -Path "$prefix/include", "$prefix/lib", "$prefix/src"

Copy-Item "target/${{ matrix.target }}/release/dora_node_api_cxx.lib" "$prefix/lib/"
Copy-Item "target/${{ matrix.target }}/release/dora_operator_api_cxx.lib" "$prefix/lib/"

Copy-Item "target/cxxbridge/dora-node-api-cxx/src/lib.rs.h" "$prefix/include/dora-node-api.h"
Copy-Item "target/cxxbridge/dora-operator-api-cxx/src/lib.rs.h" "$prefix/include/dora-operator-api.h"

Copy-Item "target/cxxbridge/dora-node-api-cxx/src/lib.rs.cc" "$prefix/src/dora-node-api.cc"
Copy-Item "target/cxxbridge/dora-operator-api-cxx/src/lib.rs.cc" "$prefix/src/dora-operator-api.cc"

Compress-Archive -Path "$prefix" -DestinationPath "$prefix.zip"
$target = "${{ matrix.target }}"
$targetDir = "target/$target/release"
$cppPrefix = "dora-cpp-libraries-$target"

cargo run -p xtask -- stage dora-node-api-cxx $targetDir $cppPrefix

cargo run -p xtask -- stage dora-operator-api-cxx $targetDir $cppPrefix

Compress-Archive -Path $cppPrefix -DestinationPath "$cppPrefix.zip"

- name: Upload C libraries artifact
uses: actions/upload-artifact@v4
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/test-c-cpp-libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Test C/C++ Libraries

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

jobs:
test-apis:
name: Test C/C++ Node APIs (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: macos-latest
- os: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install dora CLI
run: cargo install --path binaries/cli

# ============================================================================
# C Node API Test
# ============================================================================
- name: Build C API
run: cargo build --release --package dora-node-api-c

- name: Stage C libraries
run: cargo run -p xtask -- stage dora-node-api-c target/release dora-c-prefix

- name: Create C test node
run: dora new test-node-c --kind node --lang c

- name: Build C test node (Unix)
if: runner.os != 'Windows'
run: |
cd test-node-c
mkdir -p build
cd build
cmake .. -DCMAKE_PREFIX_PATH=${{ github.workspace }}/dora-c-prefix
cmake --build . --config Release

- name: Build C test node (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd test-node-c
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=${{ github.workspace }}/dora-c-prefix
cmake --build . --config Release

# ============================================================================
# C++ Node API Test
# ============================================================================
- name: Build C++ API
run: cargo build --release --package dora-node-api-cxx

- name: Stage C++ libraries
run: cargo run -p xtask -- stage dora-node-api-cxx target/release dora-cpp-prefix

- name: Create C++ test node
run: dora new test-node-cpp --kind node --lang cxx

- name: Build C++ test node (Unix)
if: runner.os != 'Windows'
run: |
cd test-node-cpp
mkdir -p build
cd build
cmake .. -DCMAKE_PREFIX_PATH=${{ github.workspace }}/dora-cpp-prefix
cmake --build . --config Release

- name: Build C++ test node (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd test-node-cpp
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=${{ github.workspace }}/dora-cpp-prefix
cmake --build . --config Release
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,7 @@ out/
#Miscellaneous
yolo.yml

#temp file
temp

~*
10 changes: 8 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ members = [
"tests/fault_tolerance/input_closed_observer_node",
"tests/fault_tolerance/silent_source_node",
"tests/fault_tolerance/timed_burst_source_node",
"xtask",
]

[workspace.package]
Expand Down
Loading
Loading