cartesi / dave

Cartesi fraud-proof system
Apache License 2.0
13 stars 11 forks source link

Dave compute test image build error #51

Open ZzzzHui opened 1 week ago

ZzzzHui commented 1 week ago

The command docker build -t cartesi/dave-compute:test -f Dockerfile.compute.test ../../ in the prt/compute-rs folder fails on my machine (Apple M1), with some of the printed info as follows:

118.6   jsonrpc-virtual-machine.cpp:24:10: fatal error: mongoose.h: No such file or directory
118.6      24 | #include <mongoose.h>
118.6         |          ^~~~~~~~~~~~
118.6   compilation terminated.
118.6   make: *** [Makefile:546: jsonrpc-virtual-machine.o] Error 1
118.6   thread 'main' panicked at /app/machine/machine-rust-bindings/cartesi-machine-sys/build.rs:103:10:
118.6   Failed to move `libcartesi_jsonrpc.a` to OUT_DIR: Os { code: 2, kind: NotFound, message: "No such file or directory" }
118.6   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
118.7 thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-chef-0.1.67/src/recipe.rs:218:27:
118.7 Exited with status code: 101
118.7 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
------
Dockerfile.compute.test:22
--------------------
  20 |     # Build dependencies - this is the caching Docker layer!
  21 |     WORKDIR /app/prt/compute-rs
  22 | >>> RUN cargo chef cook --release --recipe-path recipe.json
  23 |     
  24 |     # Build application
--------------------
ERROR: failed to solve: process "/bin/sh -c cargo chef cook --release --recipe-path recipe.json" did not complete successfully: exit code: 101

Stephen debugged this error by removing all lines containing jsonrpc in the file machine/machine-rust-bindings/cartesi-machine-sys/build.rs and the build succeeded. Thanks @stephenctw

stephenctw commented 1 week ago

@GCdePaula I'm not sure what's the cause of this missing file error. But if we don't use jsonrpc anymore, can we simply remove those lines?