From f8f3695d9c7cb77205319ed32a51a89e6a43d07b Mon Sep 17 00:00:00 2001 From: capossele Date: Tue, 5 Mar 2024 15:16:11 +0000 Subject: [PATCH] add forge ffi build into build script --- methods/build.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/methods/build.rs b/methods/build.rs index 11130e59..5f2482ab 100644 --- a/methods/build.rs +++ b/methods/build.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::{collections::HashMap, env}; +use std::{collections::HashMap, env, process::Command}; use risc0_build::{embed_methods_with_options, DockerOptions, GuestOptions}; use risc0_build_ethereum::generate_solidity_files; @@ -43,4 +43,20 @@ fn main() { .with_elf_sol_path(SOLIDITY_ELF_PATH); generate_solidity_files(guests.as_slice(), &solidity_opts).unwrap(); + + // build risc0-ethereum forge ffi. + let status = Command::new("cargo") + .arg("build") + .arg("--manifest-path") + .arg("../lib/risc0-ethereum/ffi/Cargo.toml") + .arg("--bin") + .arg("risc0-forge-ffi") + .status() + .unwrap(); + if !status.success() { + panic!( + "risc0-ethereum forge ffi build failed with exit code: {:?}", + status.code() + ); + } }