Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions .github/workflows/per-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,27 @@ jobs:
compose-file: ./docker/docker-compose-ci.yaml
- uses: Swatinem/rust-cache@v2
- run: cargo integ-test docker_

c-bridge-static-link-test:
name: "C bridge static link test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88.0
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
# TODO: Upgrade proto once https://github.com/arduino/setup-protoc/issues/99 is fixed
version: "23.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build crate as static library
run: cargo rustc --package temporal-sdk-core-c-bridge --features xz2-static -- --crate-type=staticlib

- name: Build C test program
run: gcc -I./core-c-bridge/include tests/c_bridge_smoke_test.c target/debug/deps/libtemporal_sdk_core_c_bridge.a -lpthread -ldl -lm -o test

- name: Run C test program
run: ./test
6 changes: 5 additions & 1 deletion core-c-bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ tokio-util = "0.7"
tonic = { workspace = true }
tracing = "0.1"
url = "2.5"
# This is only needed as an explicit dependency so we can enable static as a feature
xz2 = { version = "0.1" }

[dependencies.temporal-client]
path = "../client"
Expand All @@ -44,6 +46,8 @@ path = "../sdk-core-protos"
futures-util = "0.3"
thiserror = { workspace = true }


[build-dependencies]
cbindgen = { version = "0.29", default-features = false }

[features]
xz2-static = ["xz2/static"]
3 changes: 2 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ tracing-subscriber = { version = "0.3", default-features = false, features = [
] }
url = "2.5"
uuid = { version = "1.18", features = ["v4"] }
zip = { version = "4.6", optional = true }
# Only need specific features to decompress zip files for ephemeral server download
zip = { version = "4.6", optional = true, default-features = false, features = ["deflate", "bzip2", "zstd"] }

# 1st party local deps
[dependencies.temporal-sdk-core-api]
Expand Down
10 changes: 10 additions & 0 deletions tests/c_bridge_smoke_test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "temporal-sdk-core-c-bridge.h"
#include <stdio.h>

int main(void) {
// Just do something simple to confirm the bridge works
struct TemporalCoreCancellationToken *tok = temporal_core_cancellation_token_new();
temporal_core_cancellation_token_free(tok);
printf("C bridge smoke test passed!\n");
return 0;
}
Loading