chore!: update libcmt to machine-guest-tools v0.18.0 - #1
Merged
Conversation
Bump the vendored machine-guest-tools submodule from v0.17.2 to v0.18.0 and adapt the bindings to its breaking changes. Upstream changes affecting the public headers bindgen consumes: - Removed the unimplemented `cmt_abi_start_frame` declaration. The corresponding `abi::start_frame` wrapper is dropped; it bound a symbol with no implementation behind it, so any caller already failed to link. - Renamed `HTIF_YIELD_REASON_ADVANCE`/`_INSPECT` to `_ADVANCE_STATE`/ `_INSPECT_STATE`. Regenerated; no internal callers. - Renamed the `cmt_rollup_t` cache field `finish_root_hash` to `finish_outputs_merkle_root`, and the libcmt mock's file suffix from `.outputs_root_hash` to `.outputs_merkle_root`. No internal callers, and no test harness in this repo reads the old file name. - Renamed `struct cmt_rollup_finish` to `cmt_rollup_finish_s`. The `cmt_rollup_finish_t` typedef absorbs this, so consumers are unaffected. No new public libcmt API was added, so there is nothing new to bind. The new bundled `libcmt/ioctl.h` is internal to `io.c` and is deliberately not added to wrapper.h. Dockerfile.echoApp: - Bump the guest-tools release pin to 0.18.0 with a recomputed sha256. - Drop the Cartesi linux-headers download. v0.18.0 vendors the cmio ioctl ABI in `libcmt/ioctl.h`, so libcmt no longer includes <linux/cartesi/cmio.h>. This also removes a stale pin on kernel headers v0.20.0/ctsi-1 while v0.18.0 targets ctsi-2. - Pin the libcmt source clone to the same release the bindings are generated from. It previously cloned main unpinned, so the linked libcmt.a could drift from the generated bindings. Verified by building libcmt's host mock backend and running the echo app against it: advance and inspect both round-trip, a correct Voucher(address,uint256,bytes) is emitted, and the outputs Merkle root accumulates across inputs rather than resetting. Upstream's own libcmt test suite passes. The riscv64 cross-build stage was also built under Docker, confirming libcmt v0.18.0 compiles without the kernel headers package and the app links into a working riscv64 binary. BREAKING CHANGE: `abi::start_frame` is removed and the re-exported `HTIF_YIELD_REASON_ADVANCE`/`_INSPECT` constants are renamed to `_ADVANCE_STATE`/`_INSPECT_STATE`.
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.
Bumps the vendored
machine-guest-toolssubmodule from v0.17.2 → v0.18.0 and adapts the bindings to its breaking changes.Upstream changes affecting the headers bindgen consumes
cmt_abi_start_framedeclaration removedabi::start_framewrapper droppedHTIF_YIELD_REASON_ADVANCE/_INSPECT→_ADVANCE_STATE/_INSPECT_STATEfinish_root_hash→finish_outputs_merkle_rootstruct cmt_rollup_finish→cmt_rollup_finish_scmt_rollup_finish_ttypedef absorbs itabi::start_framebound a symbol with no implementation behind it, so any caller already failed at link time — removing it costs nothing.The mock's output file suffix also changed (
.outputs_root_hash→.outputs_merkle_root). Upstream flagged this as breaking test harnesses that read the old name; I grepped, and nothing in this repo does.No new public libcmt API was added, so there is nothing new to bind. The new bundled
libcmt/ioctl.his internal toio.cand is deliberately not added towrapper.h.Dockerfile.echoApp
0.18.0with a recomputed sha256.libcmt/ioctl.h, so libcmt no longer includes<linux/cartesi/cmio.h>. This also clears a stale pin on kernel headers v0.20.0/ctsi-1 while v0.18.0 targets ctsi-2.mainunpinned, so the linkedlibcmt.acould silently drift from the generated bindings — a latent bug independent of this bump.Verification
Built libcmt's host
mockbackend and ran the echo app against it:Voucher(address,uint256,bytes)is emitted (funsel237a816f, right destination, value, and payload).82ad…→5d77…→b2b7…) rather than resetting.Also built the riscv64
cross-build-stageunder Docker, confirming libcmt v0.18.0 compiles without the kernel-headers package and the app links into a workingELF 64-bit … UCB RISC-Vbinary.Follow-ups (intentionally not in this PR)
sample_apps/echo_app/Cargo.tomlstill pins the old crate rev, so the sample app doesn't consume this yet. Best bumped once this merges and the SHA is final. I verified the app builds and links against the updated crate, so the pin is the only thing in the way.main.rs:484off the bare0/1literals to theHTIF_YIELD_REASON_*_STATEconstants, which only exist as of this change.0.1.0despite the breaking API change — worth bumping before tagging, sincerelease-on-tag.ymlpackages the.cratefrom whatever is there.BREAKING CHANGE
abi::start_frameis removed, and the re-exportedHTIF_YIELD_REASON_ADVANCE/_INSPECTconstants are renamed to_ADVANCE_STATE/_INSPECT_STATE.