Simplify example run.rs files to use dora_cli build and run functions#1165
Conversation
This commit standardizes all example run.rs files to use the `dora_cli::build` and
`dora_cli::run` functions directly instead of spawning cargo commands with
tokio::process::Command. This simplification:
- Removes custom `build_dataflow` and `run_dataflow` helper functions
- Uses `dora_cli::{build, run}` API directly
- Standardizes error messages for tracing setup to use
`.wrap_err("failed to set up tracing subscriber")`
- Reduces code duplication across all examples
- Makes the codebase more maintainable
Modified examples:
- All Rust examples (rust-dataflow, rust-dataflow-git, rust-dataflow-url, rust-ros2-dataflow)
- All C/C++ examples (c-dataflow, c++-dataflow, c++-arrow-dataflow, c++-ros2-dataflow, cmake-dataflow)
- All Python examples (python-dataflow, python-operator-dataflow, python-ros2-dataflow)
- Benchmark example
Total reduction: 289 lines of boilerplate code removed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
phil-opp
left a comment
There was a problem hiding this comment.
Nice!
We should make the test functions sync now though, as both the build and run functions are blocking. I assume that's also why the CI fails.
|
The log output is very mangled unfortunately: https://github.com/dora-rs/dora/actions/runs/18831862990/job/53724683004?pr=1165
|
9530de8 to
6c7cbb6
Compare
So FYI, there was a |
|
I think those changes should make the CI 30% faster compared to before as the example are now less compile exhaustive. |
binaries/daemon/src/spawn.rs
Outdated
| } else { | ||
| let mut cmd = tokio::process::Command::new( | ||
| std::env::current_exe() | ||
| which::which("dora") |
There was a problem hiding this comment.
We should hightlight this change in the changelog for our next release because this might break people that have installed dora under a different name (e.g. named the executable dora-0.13.3).
This commit standardizes all example run.rs files to use the
dora_cli::buildanddora_cli::runfunctions directly instead of spawning cargo commands with tokio::process::Command. This simplification:build_dataflowandrun_dataflowhelper functionsdora_cli::{build, run}API directly.wrap_err("failed to set up tracing subscriber")Modified examples:
Total reduction: 289 lines of boilerplate code removed.
🤖 Generated with Claude Code