-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
118 additions
and
251 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -1,83 +1,5 @@ | ||
use std::process::Command; | ||
|
||
use sp1_build::{build_program_with_args, BuildArgs}; | ||
|
||
/// Build a native program. | ||
fn build_native_program(program: &str) { | ||
let status = Command::new("cargo") | ||
.args([ | ||
"build", | ||
"--workspace", | ||
"--bin", | ||
program, | ||
"--profile", | ||
"release-client-lto", | ||
]) | ||
.status() | ||
.expect("Failed to execute cargo build command"); | ||
|
||
if !status.success() { | ||
panic!("Failed to build {}", program); | ||
} | ||
|
||
println!( | ||
"cargo:warning={} built with release-client-lto profile", | ||
program | ||
); | ||
} | ||
|
||
/// Build the native host runner to a separate target directory to avoid build lockups. | ||
fn build_native_host_runner() { | ||
let metadata = cargo_metadata::MetadataCommand::new() | ||
.exec() | ||
.expect("Failed to get cargo metadata"); | ||
let target_dir = metadata.target_directory.join("native_host_runner"); | ||
|
||
let status = Command::new("cargo") | ||
.args([ | ||
"build", | ||
"--workspace", | ||
"--bin", | ||
"native_host_runner", | ||
"--release", | ||
"--target-dir", | ||
target_dir.as_ref(), | ||
]) | ||
.status() | ||
.expect("Failed to execute cargo build command"); | ||
if !status.success() { | ||
panic!("Failed to build native_host_runner"); | ||
} | ||
|
||
println!("cargo:warning=native_host_runner built with release profile",); | ||
} | ||
|
||
/// Build a program for the zkVM. | ||
#[allow(dead_code)] | ||
fn build_zkvm_program(program: &str) { | ||
build_program_with_args( | ||
&format!("../../programs/{}", program), | ||
BuildArgs { | ||
elf_name: format!("{}-elf", program), | ||
docker: true, | ||
tag: "v3.0.0-rc4".to_string(), | ||
..Default::default() | ||
}, | ||
); | ||
} | ||
use op_succinct_build_utils::build_all; | ||
|
||
fn main() { | ||
let programs = vec!["fault-proof", "range"]; | ||
|
||
for program in programs { | ||
// Note: Don't comment this out, because the Docker program depends on the native program | ||
// for range being built. | ||
build_native_program(program); | ||
// build_zkvm_program(program); | ||
} | ||
|
||
// build_zkvm_program("aggregation"); | ||
// Note: Don't comment this out, because the Docker program depends on the native host runner | ||
// being built. | ||
build_native_host_runner(); | ||
build_all(); | ||
} |
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
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 |
---|---|---|
@@ -1,82 +1,5 @@ | ||
use std::process::Command; | ||
|
||
use sp1_build::{build_program_with_args, BuildArgs}; | ||
|
||
/// Build a native program. | ||
fn build_native_program(program: &str) { | ||
let status = Command::new("cargo") | ||
.args([ | ||
"build", | ||
"--workspace", | ||
"--bin", | ||
program, | ||
"--profile", | ||
"release-client-lto", | ||
]) | ||
.status() | ||
.expect("Failed to execute cargo build command"); | ||
|
||
if !status.success() { | ||
panic!("Failed to build {}", program); | ||
} | ||
|
||
println!( | ||
"cargo:warning={} built with release-client-lto profile", | ||
program | ||
); | ||
} | ||
|
||
/// Build the native host runner to a separate target directory to avoid build lockups. | ||
fn build_native_host_runner() { | ||
let metadata = cargo_metadata::MetadataCommand::new() | ||
.exec() | ||
.expect("Failed to get cargo metadata"); | ||
let target_dir = metadata.target_directory.join("native_host_runner"); | ||
|
||
let status = Command::new("cargo") | ||
.args([ | ||
"build", | ||
"--workspace", | ||
"--bin", | ||
"native_host_runner", | ||
"--release", | ||
"--target-dir", | ||
target_dir.as_ref(), | ||
]) | ||
.status() | ||
.expect("Failed to execute cargo build command"); | ||
if !status.success() { | ||
panic!("Failed to build native_host_runner"); | ||
} | ||
|
||
println!("cargo:warning=native_host_runner built with release profile",); | ||
} | ||
|
||
/// Build a program for the zkVM. | ||
#[allow(dead_code)] | ||
fn build_zkvm_program(program: &str) { | ||
build_program_with_args( | ||
&format!("../../programs/{}", program), | ||
BuildArgs { | ||
elf_name: format!("{}-elf", program), | ||
docker: true, | ||
..Default::default() | ||
}, | ||
); | ||
} | ||
use op_succinct_build_utils::build_all; | ||
|
||
fn main() { | ||
let programs = vec!["fault-proof", "range"]; | ||
|
||
for program in programs { | ||
// Note: Don't comment this out, because the Docker program depends on the native program | ||
// for range being built. | ||
build_native_program(program); | ||
// build_zkvm_program(program); | ||
} | ||
|
||
// build_zkvm_program("aggregation"); | ||
// Note: Don't comment this out, because the Docker program depends on the native host runner | ||
// being built. | ||
build_native_host_runner(); | ||
build_all(); | ||
} |
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
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 |
---|---|---|
@@ -1,83 +1,5 @@ | ||
use std::process::Command; | ||
|
||
use sp1_build::{build_program_with_args, BuildArgs}; | ||
|
||
/// Build a native program. | ||
fn build_native_program(program: &str) { | ||
let status = Command::new("cargo") | ||
.args([ | ||
"build", | ||
"--workspace", | ||
"--bin", | ||
program, | ||
"--profile", | ||
"release-client-lto", | ||
]) | ||
.status() | ||
.expect("Failed to execute cargo build command"); | ||
|
||
if !status.success() { | ||
panic!("Failed to build {}", program); | ||
} | ||
|
||
println!( | ||
"cargo:warning={} built with release-client-lto profile", | ||
program | ||
); | ||
} | ||
|
||
/// Build the native host runner to a separate target directory to avoid build lockups. | ||
fn build_native_host_runner() { | ||
let metadata = cargo_metadata::MetadataCommand::new() | ||
.exec() | ||
.expect("Failed to get cargo metadata"); | ||
let target_dir = metadata.target_directory.join("native_host_runner"); | ||
|
||
let status = Command::new("cargo") | ||
.args([ | ||
"build", | ||
"--workspace", | ||
"--bin", | ||
"native_host_runner", | ||
"--release", | ||
"--target-dir", | ||
target_dir.as_ref(), | ||
]) | ||
.status() | ||
.expect("Failed to execute cargo build command"); | ||
if !status.success() { | ||
panic!("Failed to build native_host_runner"); | ||
} | ||
|
||
println!("cargo:warning=native_host_runner built with release profile",); | ||
} | ||
|
||
/// Build a program for the zkVM. | ||
#[allow(dead_code)] | ||
fn build_zkvm_program(program: &str) { | ||
build_program_with_args( | ||
&format!("../../programs/{}", program), | ||
BuildArgs { | ||
elf_name: format!("{}-elf", program), | ||
docker: true, | ||
tag: "v3.0.0-rc3".to_string(), | ||
..Default::default() | ||
}, | ||
); | ||
} | ||
use op_succinct_build_utils::build_all; | ||
|
||
fn main() { | ||
let programs = vec!["fault-proof", "range"]; | ||
|
||
for program in programs { | ||
// Note: Don't comment this out, because the Docker program depends on the native program | ||
// for range being built. | ||
build_native_program(program); | ||
// build_zkvm_program(program); | ||
} | ||
|
||
// build_zkvm_program("aggregation"); | ||
// Note: Don't comment this out, because the Docker program depends on the native host runner | ||
// being built. | ||
build_native_host_runner(); | ||
build_all(); | ||
} |
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,9 @@ | ||
[package] | ||
name = "op-succinct-build-utils" | ||
version = "0.1.0" | ||
license.workspace = true | ||
edition.workspace = true | ||
|
||
[dependencies] | ||
sp1-build.workspace = true | ||
cargo_metadata.workspace = true |
Oops, something went wrong.