Repository navigation
Add mctp-rs as in-tree workspace member (port of dymk/mctp-rs @ 3d941ba) - #823
Merged
dymk merged 5 commits intoMay 6, 2026
Merged
Conversation
Plain `cp -r` snapshot of the dymk/mctp-rs source tree (src/, Cargo.toml, README.md, LICENSE.md, rustfmt.toml). Excludes .cargo-husky/, .github/, .vscode/, .cursorrules, backlog/, source's Cargo.lock, source's .gitignore (destination's existing /target rule already covers it), and all .git* infrastructure. No git history preserved. Rationale: SHA 3d941ba matches embedded-services::v0.2.0 Cargo.lock pin; v1.7 bumps to 1b8b7f5 + updates consumers atomically. Source: dymk/mctp-rs main @ 3d941ba
…ath dep
- [workspace] members: append "mctp-rs" at end of list (after
"fw-update-interface-mocks")
- [workspace.dependencies]: replace `mctp-rs = { git = "https://github.com/dymk/mctp-rs" }`
with `mctp-rs = { path = "./mctp-rs" }` (no version pin; path deps
don't need one)
- Cargo.lock regenerated via `cargo build --workspace`; mctp-rs entry's
`source` field removed (path-only). No transitive churn — SHA matches
pre-edit lock pin (verified via cargo tree diff in Task 3).
Source: dymk/mctp-rs main @ 3d941ba (path-pinned in-tree)
… compatibility cargo-husky's build script searches for `.cargo-husky/hooks/` at the cargo workspace root. In the in-tree location the workspace root is embedded-services/ (one level above mctp-rs/), so the hook search would fail. The .cargo-husky/ directory is intentionally NOT carried over per D-31-06 (incompatible with multi-crate workspaces; embedded-services has its own pre-commit conventions). Phase 32 will add an equivalent cargo-hack feature-powerset CI workflow. Cargo.lock entry for cargo-husky removed by re-resolution. Source: dymk/mctp-rs main @ 3d941ba (Cargo.toml only; src/ untouched)
… style Removes mctp-rs/rustfmt.toml so the in-tree crate uses the destination workspace's rustfmt.toml (max_width = 120, stable rustfmt). The original per-crate config was nightly-rustfmt-only and exercised many unstable features (imports_granularity = "Crate", group_imports = "StdExternalCrate", wrap_comments, format_code_in_doc_comments, etc.) that silently fail on stable rustfmt with 'can't set X = Y, unstable features are only available in nightly channel' warnings. Per the in-tree convention, the workspace formatter governs going forward; no per-crate overrides. cargo fmt --all reformatted source under the workspace style — net change is +90 / -300 lines (lines previously broken at width 100 now fit at width 120; no behavioral changes). cargo test --workspace still produces 178 passed / 0 failed (identical to the post-Phase-31 baseline). cargo fmt --check now passes silently with no warnings on stable rustfmt. Source: dymk/mctp-rs main @ 3d941ba (mctp-rs source); reformatted under embedded-services::v0.2.0 rustfmt.toml
…tree mctp-rs
CI failures on the previous push were entirely about workspace-resolution
state lagging behind the git→path source pin shift in the previous commits:
- examples/{std,rt685s-evk,pico-de-gallo}/Cargo.lock had stale git+SHA
entries for mctp-rs (the example crates are independent cargo projects
with their own lockfiles; the workspace's Cargo.lock regen doesn't reach
them). Re-resolved each via 'cargo update -p mctp-rs' against the
in-tree path. examples/rt633 doesn't depend on mctp-rs and was already
green.
- cargo-machete flagged embedded-batteries, espi-device, uuid as unused
in mctp-rs/Cargo.toml — they're feature-gated optional deps that ARE
used when the relevant feature is on. Added [package.metadata.cargo-machete]
ignored block.
- cargo-vet flagged 16 unvetted deps newly visible in the workspace lock:
hashbrown 0.17.0 + indexmap 2.14.0 (production deps bumped during
re-resolution; pulled in only by the partition-manager-generation build
script via toml) and 14 dev-deps (mctp-rs's [dev-dependencies] now
appear in the lock because path-pinned workspace members expose dev-deps;
git deps did not). Added safe-to-deploy exemptions for the 2 production
bumps + safe-to-run exemptions for the 14 dev-deps. Sorted via
'cargo vet fmt'. 'cargo vet --locked' now reports 'Vetting Succeeded
(163 fully audited, 5 partially audited, 68 exempted)'.
dymk
marked this pull request as ready for review
May 5, 2026 23:52
dymk
requested review from
RobertZ2011,
Copilot,
felipebalbi,
kurtjd,
makubacki and
williampMSFT
May 5, 2026 23:52
RobertZ2011
approved these changes
May 6, 2026
kurtjd
approved these changes
May 6, 2026
This was referenced May 14, 2026
jerrysxie
added a commit
that referenced
this pull request
May 14, 2026
# Bump in-tree mctp-rs to dymk/mctp-rs @ 1b8b7f5 Bumps the in-tree `mctp-rs/` source from `3d941ba` (current `v0.2.0` baseline imported in [#823](#823)) to `1b8b7f5` (the head of `dymk/mctp-rs main`). This brings the in-tree copy to parity with the dymk fork's main, after which `dymk/mctp-rs` will be archived. The high-level `MctpPacketContext::deserialize_packet`/`serialize_packet` API signatures are **identical** between `3d941ba` and `1b8b7f5` (only internal `MctpMedium::deserialize/serialize` cursor types changed). All 4 in-tree consumers (`uart-service`, `espi-service`, `embedded-service`, plus macro re-exports) use the high-level `MctpPacketContext` API, so **zero consumer source changes** were required. Consumer test counts are unchanged at 128. ## What's picked up - **`BufferEncoding` trait + `EncodingDecoder`/`EncodingEncoder` cursor wrappers** (`src/buffer_encoding.rs`, NEW) — stateless cross-medium encoding abstraction; threads through `MctpMedium::deserialize/serialize` internals - **`MctpSerialMedium` DSP0253 byte-stuffed serial framer with CRC-16/X-25 FCS** (`src/medium/serial.rs`, NEW; gated behind opt-in `serial` feature) - **`wire_size_of` chunk-sizing fix** in `src/serialize.rs` (correctly accounts for encoding overhead during packet chunking) - **`SerialEncoding` byte-stuffing implementation** (in `medium/serial.rs`) ## Source lineage ``` Source: dymk/mctp-rs main @ 1b8b7f5 Bumps from: 3d941ba (v0.2.0 baseline imported in #823) ``` ## Carry-forwards from #823 These edits are preserved across the bump: - Dropped `cargo-husky` from `[dev-dependencies]` (workspace-root build script incompatibility; the source at `1b8b7f5` still has cargo-husky declared but the in-tree copy must drop it) - Did NOT re-introduce per-crate `mctp-rs/rustfmt.toml` (workspace style governs; source at `1b8b7f5` has a `rustfmt.toml` for nightly rustfmt, but the workspace uses stable rustfmt with `max_width = 120`) - `[package.metadata.cargo-machete] ignored` block updated to add `"crc"` (now an opt-in optional dep behind the `serial` feature; cargo-machete would otherwise false-positive at default features) - Source reformatted under the workspace style (separate fmt-only commit; no semantic change) ## Test results | Suite | Pre-bump | Post-bump | Delta | |-------|---------:|----------:|------:| | Workspace total `passed` | 178 | 185 | +7 | | `mctp-rs` unit tests | ~47 | 54 | +7 | | `mctp-rs` doctests | 3 | 3 | 0 | | Consumer crates (sum) | 128 | 128 | **0** | `cargo test --workspace` exits 0. New mctp-rs tests come from `buffer_encoding.rs` cursor unit tests at default features. The 41+ `medium/serial.rs` golden-fixture tests live behind opt-in `--features serial` and are exercised by the `hack-clippy` cargo-hack feature-powerset job in `check.yml`. ## Cargo.lock churn - Workspace `Cargo.lock` regenerated via `cargo build --workspace`. `mctp-rs` entry remains source-less (path-pinned). - **NEW transitive entries in `Cargo.lock`:** `crc 3.4.0` and `crc-catalog 2.4.0` (both gated behind opt-in `serial`; neither is reachable from `cargo build --workspace` at default features). - `cargo tree -p mctp-rs` is **byte-identical** pre/post at default features (verified via `diff`). - Example lockfiles regenerated via `cd examples/<name> && cargo update -p mctp-rs`: `examples/std`, `examples/rt685s-evk`, `examples/pico-de-gallo` updated. `examples/rt633` does not depend on `mctp-rs` and is untouched. ## cargo-vet `cargo vet --locked` reports: `Vetting Succeeded (220 fully audited, 1 partially audited, 15 exempted)`. Added **one** new exemption for `crc 3.4.0` as `safe-to-deploy` in `supply-chain/config.toml` (alphabetically interleaved via `cargo vet fmt`). `crc-catalog 2.4.0` did not require a new exemption — already audited via `imports.lock` (OpenDevicePartnership-imported audit by Jerry Xie, Microsoft). ## CI matrix coverage (`hack-clippy`) `check.yml`'s `hack-clippy` job runs `cargo hack --feature-powerset --mutually-exclusive-features=log,defmt,defmt-timestamp-uptime` workspace-wide across `{stable,beta} × {x86_64-unknown-linux-gnu, thumbv8m.main-none-eabihf}`. Since `mctp-rs` is a workspace member, this matrix automatically exercises the new `serial` feature (16 feature combinations total). --------- Co-authored-by: Jerry Xie <139205137+jerrysxie@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Imports
dymk/mctp-rsas an in-tree workspace member atmctp-rs/and flips the existing[workspace.dependencies]git pin to a path dep. The imported source is at SHA3d941ba5205ca7781bf37e3dc7c5dfdc99a082d6, which matches the pre-editCargo.lockpin exactly — so all fourmctp-rsconsumers (uart-service,espi-service,embedded-service, plus its macro re-exports) compile and test unchanged.What changed
mctp-rs/directory: snapshot copy ofdymk/mctp-rsmain @ 3d941basource. No git history preserved.Cargo.toml:"mctp-rs"appended to[workspace] members;mctp-rs = { git = "..." }replaced withmctp-rs = { path = "./mctp-rs" }.Cargo.lockregenerated.mctp-rs/Cargo.toml: droppedcargo-huskyfrom[dev-dependencies](its build script searches for.cargo-husky/hooks/at the workspace root, which is now this repo, not the crate).mctp-rs/rustfmt.tomlremoved; source reformatted under this repo'srustfmt.toml(max_width = 120)..cargo-husky/,.github/,.vscode/, sourceCargo.lock, source.gitignore. A follow-up PR will add the dedicatedmctp-rsCI workflow.Why
mctp-rslived in a personal fork and was already consumed here via a git pin. Bringing it in-tree as a sibling ofuart-serviceetc. removes a layer of cross-repo indirection and lets future changes flow through normal workspace PR review. SHA3d941bawas chosen specifically because it matches the consumer pin — so this PR has zero behavioral surface.The mctp-rs repo holds further commits beyond
3d941bathat change theMctpMediumAPI. Those, together with the corresponding consumer updates and the eventual archival of the personal fork, land in a separate PR after this one.Verifying locally
Spot-check the source is byte-identical to upstream:
(Both empty diffs, modulo the rustfmt-style reflow noted above for the second one.)
Notes for reviewer
cargo test --workspacecount went from 128 → 178. The 50-test delta ismctp-rs's own test suite, which now runs as part of the workspace. Every consumer test result line from before is preserved exactly.Cargo.lockpicks upmctp-rs's dev-dep chain (rstest,tokio,pretty_assertions, etc.) for the same reason — these are dev-only and don't affect runtime. The two production-tree changes arehashbrown 0.15.5 → 0.17.0andindexmap 2.11.0 → 2.14.0; both are pulled in only by thepartition-manager-generationbuild script (viatoml), so no runtime impact.