From c854cb188ad1532df18d4922f66482bc2a033e83 Mon Sep 17 00:00:00 2001 From: Mati-ur-rehman-017 Date: Tue, 25 Mar 2025 19:46:16 +0500 Subject: [PATCH] Added example in CI --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ examples/c++-dataflow2/run.rs | 22 +++++++++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bfa2b68..771bab37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,6 +127,26 @@ jobs: - name: "C++ Dataflow example" timeout-minutes: 15 run: cargo run --example cxx-dataflow + - name: "Install Arrow C++ Library" + timeout-minutes: 10 + shell: bash + run: | + if [ "$RUNNER_OS" == "Linux" ]; then + # For Ubuntu + sudo apt-get update + sudo apt-get install -y -V ca-certificates lsb-release wget + wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb + sudo apt-get install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb + sudo apt-get update + sudo apt-get install -y -V libarrow-dev libarrow-glib-dev + elif [ "$RUNNER_OS" == "macOS" ]; then + # For macOS + brew update + brew install apache-arrow + fi + - name: "C++ Dataflow2 example" + timeout-minutes: 15 + run : cargo run --example cxx-dataflow2 - name: "Cmake example" if: runner.os == 'Linux' timeout-minutes: 30 diff --git a/examples/c++-dataflow2/run.rs b/examples/c++-dataflow2/run.rs index b1a9e999..5e1f2185 100644 --- a/examples/c++-dataflow2/run.rs +++ b/examples/c++-dataflow2/run.rs @@ -247,7 +247,15 @@ async fn build_cxx_node( clang.arg("-l").arg("c"); clang.arg("-l").arg("m"); } - clang.args(args); + for arg in args { + if arg.contains(" ") { + for part in arg.split_whitespace() { + clang.arg(part); + } + } else { + clang.arg(arg); + } + } clang.arg("-L").arg(root.join("target").join("debug")); clang .arg("--output") @@ -288,7 +296,15 @@ async fn build_cxx_operator( let mut link = tokio::process::Command::new("clang++"); link.arg("-shared").args(&object_file_paths); - link.args(link_args); + for arg in link_args { + if arg.contains(" ") { + for part in arg.split_whitespace() { + link.arg(part); + } + } else { + link.arg(arg); + } + } #[cfg(target_os = "windows")] { link.arg("-ladvapi32"); @@ -342,4 +358,4 @@ async fn build_cxx_operator( }; Ok(()) -} +} \ No newline at end of file