Skip to content

Commit

Permalink
chore: turn off native execution logging (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani authored Dec 16, 2024
1 parent ea89646 commit 9a93175
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
4 changes: 2 additions & 2 deletions proposer/succinct/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use op_succinct_build_utils::build_all;
use op_succinct_build_utils::{build_all, ProgramBuildArgs};

fn main() {
build_all();
build_all(ProgramBuildArgs::Default);
}
4 changes: 2 additions & 2 deletions scripts/prove/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use op_succinct_build_utils::build_all;
use op_succinct_build_utils::{build_all, ProgramBuildArgs};

fn main() {
build_all();
build_all(ProgramBuildArgs::Default);
}
4 changes: 2 additions & 2 deletions scripts/utils/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use op_succinct_build_utils::build_all;
use op_succinct_build_utils::{build_all, ProgramBuildArgs};

fn main() {
build_all();
build_all(ProgramBuildArgs::Default);
}
43 changes: 28 additions & 15 deletions utils/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,32 @@ use std::process::Command;
use chrono::Local;
use sp1_build::{build_program_with_args, BuildArgs};

#[derive(Clone, Copy)]
pub enum ProgramBuildArgs {
Default,
WithTracing,
}

/// Build a native program.
fn build_native_program(program: &str) {
// Build with tracing-subscriber feature enabled for `kona-client` logging.
fn build_native_program(program: &str, program_args: ProgramBuildArgs) {
let mut args = vec![
"build",
"--workspace",
"--bin",
program,
"--profile",
"release-client-lto",
];

match program_args {
ProgramBuildArgs::Default => {}
ProgramBuildArgs::WithTracing => {
args.extend(&["--features", "tracing-subscriber"]);
}
}

let status = Command::new("cargo")
.args([
"build",
"--workspace",
"--bin",
program,
"--profile",
"release-client-lto",
"--features",
"tracing-subscriber",
])
.args(&args)
.status()
.expect("Failed to execute cargo build command");

Expand Down Expand Up @@ -84,9 +96,10 @@ fn build_zkvm_program(program: &str) {

/// Build all the native programs and the native host runner. Optional flag to build the zkVM
/// programs.
pub fn build_all() {
// Build range program.
build_native_program("range");
pub fn build_all(program_args: ProgramBuildArgs) {
// Note: Don't comment this out, because the Docker program depends on the native program
// for range being built.
build_native_program("range", program_args);
// build_zkvm_program("range");

// Build aggregation program.
Expand Down

0 comments on commit 9a93175

Please sign in to comment.