-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add compile sierra to casm util
- Loading branch information
1 parent
4a0e789
commit 49093ab
Showing
6 changed files
with
1,293 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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); | ||
}; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod compile; |
Oops, something went wrong.