diff --git a/DEPENDENCIES.lock b/DEPENDENCIES.lock index d3845c0..2723e84 100644 --- a/DEPENDENCIES.lock +++ b/DEPENDENCIES.lock @@ -1 +1 @@ -cartesi/machine-guest-tools v0.17.2 3d838a2f80cd8fa614e38ea93efcfabe8ec65bea +cartesi/machine-guest-tools v0.18.0 5222250c69371f7cbe96e6082699a8ca22b5969c diff --git a/build/Dockerfile.echoApp b/build/Dockerfile.echoApp index e17a961..0f12c73 100644 --- a/build/Dockerfile.echoApp +++ b/build/Dockerfile.echoApp @@ -4,10 +4,8 @@ # for the defined date, no matter when the image is built. ARG UBUNTU_TAG=noble-20250910 ARG APT_UPDATE_SNAPSHOT=20250915T030400Z -ARG MACHINE_GUEST_TOOLS_VERSION=0.17.2 -ARG MACHINE_GUEST_TOOLS_SHA256SUM=c077573dbcf0cdc146adf14b480bfe454ca63aa4d3e8408c5487f550a5b77a41 -ARG LINUX_HEADERS_URLPATH=https://github.com/cartesi/machine-linux-image/releases/download/v0.20.0/linux-libc-dev-riscv64-cross-6.5.13-ctsi-1-v0.20.0.deb -ARG LINUX_HEADERS_SHA256=2723435e8b45d8fb7a79e9344f6dc517b3dbc08e03ac17baab311300ec475c08 +ARG MACHINE_GUEST_TOOLS_VERSION=0.18.0 +ARG MACHINE_GUEST_TOOLS_SHA256SUM=204d4260defd68e11b957ae1f1b511b6c2c74345c918748be06f592733b72dcd ARG RUST_VERSION=1.90.0 ################################################################################ @@ -100,18 +98,14 @@ COPY sample_apps/echo_app/.cargo ./.cargo # Copy source code COPY sample_apps/echo_app/src ./src -# Install Cartesi linux headers needed by libcmt (provides linux/cartesi/cmio.h) -ARG LINUX_HEADERS_URLPATH -ARG LINUX_HEADERS_SHA256 -RUN echo "[headers] Downloading Cartesi linux headers..." && \ - curl -fsSL -o /tmp/linux-headers.deb "$LINUX_HEADERS_URLPATH" && \ - echo "${LINUX_HEADERS_SHA256} /tmp/linux-headers.deb" | sha256sum -c - && \ - dpkg-deb -x /tmp/linux-headers.deb / && \ - rm /tmp/linux-headers.deb +# libcmt >= 0.18.0 bundles libcmt/ioctl.h (vendored linux/cartesi/cmio.h), so the +# Cartesi linux headers package is no longer needed to build it. # Build libcmt C library for RISC-V (required by libcmt-binding-rust at link time) -RUN echo "[libcmt] Cloning machine-guest-tools..." && \ - git clone --depth 1 https://github.com/cartesi/machine-guest-tools.git /tmp/machine-guest-tools +ARG MACHINE_GUEST_TOOLS_VERSION +RUN echo "[libcmt] Cloning machine-guest-tools v${MACHINE_GUEST_TOOLS_VERSION}..." && \ + git clone --depth 1 --branch v${MACHINE_GUEST_TOOLS_VERSION} \ + https://github.com/cartesi/machine-guest-tools.git /tmp/machine-guest-tools RUN echo "[libcmt] Building libcmt for riscv64..." && \ make -C /tmp/machine-guest-tools/sys-utils/libcmt libcmt TOOLCHAIN_PREFIX=riscv64-linux-gnu- RUN echo "[libcmt] Copying libcmt.a to known path..." && \ diff --git a/src/abi.rs b/src/abi.rs index 31bc609..32a2a0a 100644 --- a/src/abi.rs +++ b/src/abi.rs @@ -10,7 +10,6 @@ use crate::generated::{ cmt_abi_mark_frame, cmt_abi_peek_bytes_d, cmt_abi_peek_funsel, cmt_abi_put_address, cmt_abi_put_bool, cmt_abi_put_bytes_d, cmt_abi_put_bytes_s, cmt_abi_put_funsel, cmt_abi_put_uint, cmt_abi_put_uint_be, cmt_abi_put_uint256, cmt_abi_reserve_bytes_d, - cmt_abi_start_frame, }; use crate::{cmt_abi_address_t, cmt_abi_bytes_t, cmt_abi_u256_t, cmt_buf_t, to_io_result}; @@ -99,10 +98,6 @@ pub fn get_address(me: &mut cmt_buf_t, value: &mut cmt_abi_address_t) -> io::Res to_io_result(unsafe { cmt_abi_get_address(me, value) }) } -pub fn start_frame(me: &mut cmt_buf_t, frame: *mut c_void) -> io::Result<()> { - to_io_result(unsafe { cmt_abi_start_frame(me, frame) }) -} - pub fn get_bytes_s(me: &mut cmt_buf_t, of: &mut cmt_buf_t) -> io::Result<()> { to_io_result(unsafe { cmt_abi_get_bytes_s(me, of) }) } diff --git a/third_party/machine-guest-tools b/third_party/machine-guest-tools index 3d838a2..5222250 160000 --- a/third_party/machine-guest-tools +++ b/third_party/machine-guest-tools @@ -1 +1 @@ -Subproject commit 3d838a2f80cd8fa614e38ea93efcfabe8ec65bea +Subproject commit 5222250c69371f7cbe96e6082699a8ca22b5969c