Skip to content

Commit 2b47ba0

Browse files
committed
merge main into branch
2 parents f307196 + 77c2779 commit 2b47ba0

165 files changed

Lines changed: 1036 additions & 638 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,3 +546,12 @@ jobs:
546546
use-cross: true
547547
command: check
548548
args: --target ${{ matrix.platform.target }} --all --exclude dora-dav1d --exclude dora-rav1e --exclude dora-node-api-python --exclude dora-operator-api-python --exclude dora-ros2-bridge-python
549+
550+
# copied from https://github.com/rust-lang/cargo/blob/6833aa715d724437dc1247d0166afe314ab6854e/.github/workflows/main.yml#L291
551+
msrv:
552+
name: "Check for specified `rust-version`"
553+
runs-on: ubuntu-latest
554+
steps:
555+
- uses: actions/checkout@v4
556+
- uses: taiki-e/install-action@cargo-hack
557+
- run: cargo hack check --all-targets --rust-version --workspace --ignore-private --locked --exclude dora-rav1e --exclude dora-dav1d
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Regenerate JSON schemas
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
jobs:
8+
regenerate_schemas:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: r7kamura/rust-problem-matchers@v1.1.0
16+
- run: cargo --version --verbose
17+
18+
- uses: Swatinem/rust-cache@v2
19+
with:
20+
cache-on-failure: true
21+
22+
- name: Update Schema
23+
run: cargo run -p dora-core --bin generate_schema
24+
- name: Create if changed
25+
env:
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: |
28+
if git diff --exit-code -- libraries/core/dora-schema.json; then
29+
echo "Schema file was not changed"
30+
else
31+
git switch -c schema-update-for-${{ github.sha }}
32+
git add libraries/core/dora-schema.json
33+
git config user.email "dora-bot@phil-opp.com"
34+
git config user.name "Dora Bot"
35+
git commit -m "Update JSON schema for ${{ github.sha }}"
36+
git push -u origin HEAD
37+
git fetch origin main
38+
gh pr create --title "Update JSON schema for \`dora-core\`" --body "Update JSON schema for ${{ github.sha }}"
39+
fi
40+

Cargo.lock

Lines changed: 30 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ members = [
4848
]
4949

5050
[workspace.package]
51-
edition = "2021"
51+
edition = "2024"
5252
rust-version = "1.85.0"
5353
# Make sure to also bump `apis/node/python/__init__.py` version.
5454
version = "0.3.12"

apis/c++/node/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ mod ros2 {
6262
pub fn generate() -> PathBuf {
6363
use rust_format::Formatter;
6464
let paths = ament_prefix_paths();
65-
let generated = dora_ros2_bridge_msg_gen::gen(paths.as_slice(), true);
65+
let generated = dora_ros2_bridge_msg_gen::generate(paths.as_slice(), true);
6666
let generated_string = rust_format::PrettyPlease::default()
6767
.format_tokens(generated)
6868
.unwrap();

apis/c++/node/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
use std::{any::Any, vec};
22

33
use dora_node_api::{
4-
self,
4+
self, Event, EventStream,
55
arrow::array::{AsArray, UInt8Array},
66
merged::{MergeExternal, MergedEvent},
7-
Event, EventStream,
87
};
98
use eyre::bail;
109

1110
#[cfg(feature = "ros2-bridge")]
1211
use dora_ros2_bridge::{_core, ros2_client};
13-
use futures_lite::{stream, Stream, StreamExt};
12+
use futures_lite::{Stream, StreamExt, stream};
1413

1514
#[cxx::bridge]
1615
#[allow(clippy::needless_lifetimes)]

apis/c++/operator/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![warn(unsafe_op_in_unsafe_fn)]
33

44
use dora_operator_api::{
5-
self, register_operator, DoraOperator, DoraOutputSender, DoraStatus, Event, IntoArrow,
5+
self, DoraOperator, DoraOutputSender, DoraStatus, Event, IntoArrow, register_operator,
66
};
77
use ffi::DoraSendOutputResult;
88

apis/c/node/src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![deny(unsafe_op_in_unsafe_fn)]
22

33
use arrow_array::UInt8Array;
4-
use dora_node_api::{arrow::array::AsArray, DoraNode, Event, EventStream};
4+
use dora_node_api::{DoraNode, Event, EventStream, arrow::array::AsArray};
55
use eyre::Context;
66
use std::{ffi::c_void, ptr, slice};
77

@@ -21,7 +21,7 @@ struct DoraContext {
2121
/// needed, use the [`free_dora_context`] function.
2222
///
2323
/// On error, a null pointer is returned.
24-
#[no_mangle]
24+
#[unsafe(no_mangle)]
2525
pub extern "C" fn init_dora_context_from_env() -> *mut c_void {
2626
let context = || {
2727
let (node, events) = DoraNode::init_from_env()?;
@@ -47,7 +47,7 @@ pub extern "C" fn init_dora_context_from_env() -> *mut c_void {
4747
/// Only pointers created through [`init_dora_context_from_env`] are allowed
4848
/// as arguments. Each context pointer must be freed exactly once. After
4949
/// freeing, the pointer must not be used anymore.
50-
#[no_mangle]
50+
#[unsafe(no_mangle)]
5151
pub unsafe extern "C" fn free_dora_context(context: *mut c_void) {
5252
let context: Box<DoraContext> = unsafe { Box::from_raw(context.cast()) };
5353
// drop all fields except for `node`
@@ -71,7 +71,7 @@ pub unsafe extern "C" fn free_dora_context(context: *mut c_void) {
7171
/// The `context` argument must be a dora context created through
7272
/// [`init_dora_context_from_env`]. The context must be still valid, i.e., not
7373
/// freed yet.
74-
#[no_mangle]
74+
#[unsafe(no_mangle)]
7575
pub unsafe extern "C" fn dora_next_event(context: *mut c_void) -> *mut c_void {
7676
let context: &mut DoraContext = unsafe { &mut *context.cast() };
7777
match context.events.recv() {
@@ -87,7 +87,7 @@ pub unsafe extern "C" fn dora_next_event(context: *mut c_void) -> *mut c_void {
8787
/// The `event` argument must be a dora event received through
8888
/// [`dora_next_event`]. The event must be still valid, i.e., not
8989
/// freed yet.
90-
#[no_mangle]
90+
#[unsafe(no_mangle)]
9191
pub unsafe extern "C" fn read_dora_event_type(event: *const ()) -> EventType {
9292
let event: &Event = unsafe { &*event.cast() };
9393
match event {
@@ -125,7 +125,7 @@ pub enum EventType {
125125
///
126126
/// - Note: `Out_ptr` is not a null-terminated string. The length of the string
127127
/// is given by `out_len`.
128-
#[no_mangle]
128+
#[unsafe(no_mangle)]
129129
pub unsafe extern "C" fn read_dora_input_id(
130130
event: *const (),
131131
out_ptr: *mut *const u8,
@@ -165,7 +165,7 @@ pub unsafe extern "C" fn read_dora_input_id(
165165
/// freed yet. The returned `out_ptr` must not be used after
166166
/// freeing the `event`, since it points directly into the event's
167167
/// memory.
168-
#[no_mangle]
168+
#[unsafe(no_mangle)]
169169
pub unsafe extern "C" fn read_dora_input_data(
170170
event: *const (),
171171
out_ptr: *mut *const u8,
@@ -203,7 +203,7 @@ pub unsafe extern "C" fn read_dora_input_data(
203203
/// ## Safety
204204
///
205205
/// Return `0` if the given event is not an input event.
206-
#[no_mangle]
206+
#[unsafe(no_mangle)]
207207
pub unsafe extern "C" fn read_dora_input_timestamp(event: *const ()) -> core::ffi::c_ulonglong {
208208
let event: &Event = unsafe { &*event.cast() };
209209
match event {
@@ -221,7 +221,7 @@ pub unsafe extern "C" fn read_dora_input_timestamp(event: *const ()) -> core::ff
221221
/// freeing, the pointer and all derived pointers must not be used anymore.
222222
/// This also applies to the `read_dora_event_*` functions, which return
223223
/// pointers into the original event structure.
224-
#[no_mangle]
224+
#[unsafe(no_mangle)]
225225
pub unsafe extern "C" fn free_dora_event(event: *mut c_void) {
226226
let _: Box<Event> = unsafe { Box::from_raw(event.cast()) };
227227
}
@@ -241,7 +241,7 @@ pub unsafe extern "C" fn free_dora_event(event: *mut c_void) {
241241
/// UTF8-encoded string.
242242
/// - The `data_ptr` and `data_len` fields must be the start pointer and length
243243
/// a byte array.
244-
#[no_mangle]
244+
#[unsafe(no_mangle)]
245245
pub unsafe extern "C" fn dora_send_output(
246246
context: *mut c_void,
247247
id_ptr: *const u8,

apis/python/node/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use dora_node_api::dora_core::config::NodeId;
1111
use dora_node_api::dora_core::descriptor::source_is_url;
1212
use dora_node_api::merged::{MergeExternalSend, MergedEvent};
1313
use dora_node_api::{DataflowId, DoraNode, EventStream};
14-
use dora_operator_api_python::{pydict_to_metadata, DelayedCleanup, NodeCleanupHandle, PyEvent};
14+
use dora_operator_api_python::{DelayedCleanup, NodeCleanupHandle, PyEvent, pydict_to_metadata};
1515
use dora_ros2_bridge_python::Ros2Subscription;
1616
use eyre::Context;
1717
use futures::{Stream, StreamExt};

apis/python/operator/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use std::{
55

66
use arrow::pyarrow::ToPyArrow;
77
use dora_node_api::{
8-
merged::{MergeExternalSend, MergedEvent},
98
DoraNode, Event, EventStream, Metadata, MetadataParameters, Parameter, StopCause,
9+
merged::{MergeExternalSend, MergedEvent},
1010
};
1111
use eyre::{Context, Result};
1212
use futures::{Stream, StreamExt};
@@ -282,7 +282,7 @@ mod tests {
282282
use aligned_vec::{AVec, ConstAlign};
283283
use arrow::{
284284
array::{
285-
ArrayData, ArrayRef, BooleanArray, Float64Array, Int32Array, Int64Array, Int8Array,
285+
ArrayData, ArrayRef, BooleanArray, Float64Array, Int8Array, Int32Array, Int64Array,
286286
ListArray, StructArray,
287287
},
288288
buffer::Buffer,

0 commit comments

Comments
 (0)