Skip to content

fix(mdb): Build against SDK 1.15 - #276

Open
fishloa wants to merge 7 commits into
AxisCommunications:mainfrom
fishloa:mdb-axis-os-12
Open

fishloa wants to merge 7 commits into
AxisCommunications:mainfrom
fishloa:mdb-axis-os-12

Conversation

@fishloa

@fishloa fishloa commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

mdb didn't build against SDK 1.15 (AXIS OS 11). In that SDK mdb_on_error_t takes mdb_error_t *, while SDK 12 takes const mdb_error_t *. bindgen now skips mdb_on_error_t and mdb-sys declares it once with the const pointer, which has the same ABI, so mdb passes its callback without a cast for either SDK.

SDK 1.3 has no mdb, so AXIS OS 10.12 stays unsupported.

make check_mdb_axis_os_11 (part of check_other) checks mdb against committed AXIS OS 11 host bindings, selected with the mdb-sys/axis-os-11 feature. They are regenerated with make crates/mdb-sys/src/bindings_axis_os_11.rs in an SDK 1.15 container; check_generated_files leaves them alone because CI runs it with SDK 12.

I tested consume_analytics_metadata on an AXIS OS 11.11 camera (P3248-LV) and an AXIS OS 12.11 camera (P3268-LV). Both receive scene description messages.

@fishloa
fishloa requested a review from a team as a code owner October 21, 2026 21:58
apljungquist
apljungquist previously approved these changes Oct 22, 2026

@apljungquist apljungquist left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an improvement over status quo, but I think it could be even better. If you want to go ahead with it as is, then tag Gustaf and ask for his approval.

Thanks for contributing this; I expect I will need it soon since I'm starting to use scene metadata on a project and I may need to deploy to AXIS OS 11 soon.

Comment thread crates/mdb/src/lib.rs Outdated
mdb_sys::mdb_on_error_t,
>(
Self::on_error::<F>
as unsafe extern "C" fn(*const mdb_sys::mdb_error_t, *mut libc::c_void),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need both the as cast and the transmute?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither, as it turns out. mdb-sys now blocklists mdb_on_error_t and declares it once with *const mdb_error_t, so mdb passes Some(Self::on_error::<F>) with no cast, transmute or unsafe (e2112d9).

Comment thread crates/mdb/src/lib.rs Resolved
Comment thread crates/mdb/src/lib.rs Resolved
@fishloa

fishloa commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

@guoxe could you take a look? @apljungquist approved; the review points are addressed in e2112d9 and cd6d0f5. CI needs a workflow approval to run, and I will update the consume_analytics_metadata checksum from its output if it changed.

…ed_files

CI runs it with SDK 12, whose headers differ.
apljungquist
apljungquist previously approved these changes Nov 7, 2026
Comment thread crates/mdb-sys/src/lib.rs Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants