Skip to content

refactor(platform-common): adopt odp_client::impl_odp_relay_handler! (Phase 2b)#2

Closed
dymk wants to merge 2 commits into
mainfrom
dymk/dev-qemu-mctp-serial-medium
Closed

refactor(platform-common): adopt odp_client::impl_odp_relay_handler! (Phase 2b)#2
dymk wants to merge 2 commits into
mainfrom
dymk/dev-qemu-mctp-serial-medium

Conversation

@dymk

@dymk dymk commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

Migrates platform/platform-common/src/lib.rs from the deleted
embedded_services::relay::mctp::impl_odp_mctp_relay_handler! macro to
odp_client::impl_odp_relay_handler!, and re-pins all embedded-services
deps to the dymk fork at rev b00c3a7 while PR #11 (canonical ODP wire
format + odp-client crate)
awaits upstream merge.

This is Phase 2b of PLAN-006 (cross-repo ODP message-type consolidation).

Why

embedded-services PR OpenDevicePartnership#11 deleted embedded_services/src/relay/mctp/ and
moved the relay-handler macro into a new odp-client crate. Any consumer
that bumps its embedded-services pin past that PR will fail to build
until this migration lands. Branch dymk/dev-qemu-mctp-serial-medium
previously bumped branch = "v0.2.0"branch = "main" (commit
already squashed during this rebase as it was applied upstream as OpenDevicePartnership#23),
so this PR is the natural follow-up.

Changes

File Change
platform/platform-common/src/lib.rs macro path swap (1 line). Argument grammar is unchanged.
platform/platform-common/Cargo.toml add odp-client direct dep + [patch] block
platform/{dev-qemu,dev-imxrt,dev-npcx,dev-mcxa,dev-mec}/Cargo.toml add identical [patch] block (14 entries) re-routing embedded-services deps to dymk fork rev b00c3a7
platform/*/Cargo.lock regenerated against patched sources

Pin reversion plan

Once OpenDevicePartnership/embedded-services PR OpenDevicePartnership#11 merges to upstream
main, a follow-up will delete the 6 [patch.\"https://github.com/OpenDevicePartnership/embedded-services\"]
blocks and cargo update will re-resolve to upstream.

Validation

All 5 CI-matrix platforms pass cargo clippy --locked and
cargo fmt --check:

  • platform-common / dev-qemu / dev-imxrt / dev-npcx / dev-mcxa

Also verified:

  • dev-qemu builds a 6.3 MB riscv32imac-unknown-none-elf ELF
  • dev-mec (not in CI matrix) builds cleanly

A pre-existing clippy::clone_on_copy finding in
platform-common/src/mock/battery.rs:35 is gated behind
--all-features --all-targets, which is NOT part of CI scope
(CI runs default-features clippy --locked per platform). Reproduces
unchanged on origin/main. Out of scope for this PR.

Parallel-safe

Independent of Phase 2 (dymk/odp-secure-services#3) and Phase 3
(dymk/odp-platform-common). All three feed into the
odp-platform-qemu-sbsa integration PR (Phase 4).

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown

Cargo Vet Audit Failed

cargo vet has failed for one or more platforms in this PR. See the cargo-vet workflow run for which platform(s) failed, and run cargo vet --locked locally from platform/<dev-*>/ to reproduce.
Details about the vetting process can be found in docs/supply-chain.md.

If the unvetted dependencies are not needed

Please modify Cargo.toml file to avoid including the dependencies.

If the unvetted dependencies are needed

Post a new comment with the questionnaire below to the PR to help the auditors vet the dependencies.
After the auditors have vetted the dependencies, the PR will need to be rebased to pick up the new audits and pass this check.

Copy and paste the questionnaire as a new comment and provide your answers:

1. What crates (with version) need to be audited?

2. How many of the crates are version updates vs new dependencies?

3. To confirm none of the already included crates serve your needs, please provide a brief description of the purpose of the new crates.

4. Any extra notes to the auditors to help with their audits.

dymk added 2 commits May 28, 2026 14:45
Switch dev-qemu from SmbusEspiMedium to MctpSerialMedium for the
uart-service, using DSP0253 serial framing with CRC-16 instead of
SMBus/eSPI framing.

Note: this will require a corresponding ec-test-cli update to support
DSP0253 serial framing before the integration-test CI job passes.
embedded-services PR OpenDevicePartnership#11 (currently dymk/odp-canonical-wire-and-odp-client
@ b00c3a7) deleted embedded_services::relay::mctp::impl_odp_mctp_relay_handler!
and replaced it with odp_client::impl_odp_relay_handler! in a new odp-client
crate. This commit migrates platform-common to the new path and re-pins all
embedded-services-sourced deps (direct and transitive) through Cargo [patch]
sections so this PR can ship to the personal fork before PR OpenDevicePartnership#11 merges
upstream.

Files:

- platform/platform-common/Cargo.toml: add odp-client direct dep
- platform/platform-common/src/lib.rs: swap macro path
  embedded_services::relay::mctp::impl_odp_mctp_relay_handler!
    -> odp_client::impl_odp_relay_handler!
  (macro grammar unchanged — argument list is identical)
- platform/{platform-common,dev-qemu,dev-imxrt,dev-npcx,dev-mcxa,dev-mec}/Cargo.toml:
  add identical [patch."https://github.com/OpenDevicePartnership/embedded-services"]
  block re-routing 14 embedded-services workspace crates to the dymk fork
  rev b00c3a7. REVERT THIS BLOCK once PR OpenDevicePartnership#11 merges to upstream.
- platform/*/Cargo.lock: updated to resolve from the dymk fork rev

Gates (all 5 CI-matrix platforms pass cargo clippy --locked + fmt --check;
dev-qemu also passes cargo build --locked for riscv32imac-unknown-none-elf):
- platform-common / dev-qemu / dev-imxrt / dev-npcx / dev-mcxa: clippy clean
- dev-qemu binary: 6.3 MB ELF produced

A pre-existing clippy::clone_on_copy finding in
platform-common/src/mock/battery.rs:35 is gated behind --all-features
--all-targets which is NOT part of CI scope (CI runs default-features
clippy per platform). Reproduces unchanged on origin/main; out of scope
for this PR.
@dymk dymk force-pushed the dymk/dev-qemu-mctp-serial-medium branch from 9530456 to d3652e5 Compare May 28, 2026 21:45
@dymk

dymk commented Jun 25, 2026

Copy link
Copy Markdown
Owner Author

Superseded by a fresh-eyes minimal approach. The serial-medium idea here is right, but this branch bundles it with the odp_client adoption (parked — see embedded-services #875). The EC dev-qemu MctpSerialMedium change is small (~12 lines of main.rs) and will be rewritten fresh against current upstream main using the existing impl_odp_mctp_relay_handler! macro. Closing; branch retained as a reference model.

@dymk dymk closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant