Skip to content

Commit

Permalink
feat: add compile sierra to casm util
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware committed Apr 4, 2024
1 parent 4a0e789 commit 49093ab
Show file tree
Hide file tree
Showing 6 changed files with 1,293 additions and 0 deletions.
22 changes: 22 additions & 0 deletions crates/gateway/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use std::process::Command;

fn main() {
install_starknet_sierra_compile();
}

fn install_starknet_sierra_compile() {
let mut command = Command::new("cargo");
command.arg("install");
command.arg("--root");
command.arg("/home/arni/workspace/mempool/crates/gateway/src/compiler"); // TODO: DOn't dup the path.
command.arg("starknet-sierra-compile");
let result = command.output();
if let Err(e) = result {
panic!("Failed to execute command: {}", e);
}
let compile_output = result.unwrap(); // TODO: handle error
let stderr_output = String::from_utf8(compile_output.stderr).unwrap(); // TODO: handle error
if !compile_output.status.success() {
panic!("Failed to compile Sierra code: {}", stderr_output);
};
}
1 change: 1 addition & 0 deletions crates/gateway/src/compiler.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod compile;
Loading

0 comments on commit 49093ab

Please sign in to comment.