From 747df35fc54f576b34373c26ef08c9825d47bc82 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Tue, 6 Aug 2024 12:26:27 -0700 Subject: [PATCH] docs, examples --- book/writing-programs/compiling.md | 10 +++++----- build/README.md | 2 +- examples/Cargo.toml | 1 - examples/aggregation/script/Cargo.toml | 2 +- examples/chess/script/Cargo.toml | 2 +- examples/cycle-tracking/script/Cargo.toml | 2 +- examples/fibonacci/script/Cargo.toml | 2 +- examples/io/script/Cargo.toml | 2 +- examples/json/script/Cargo.toml | 2 +- examples/patch-testing/script/Cargo.toml | 2 +- examples/regex/script/Cargo.toml | 3 ++- examples/rsa/script/Cargo.toml | 2 +- examples/ssz-withdrawals/script/Cargo.toml | 2 +- examples/tendermint/script/Cargo.toml | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/book/writing-programs/compiling.md b/book/writing-programs/compiling.md index e40a189d3c..61d723aab7 100644 --- a/book/writing-programs/compiling.md +++ b/book/writing-programs/compiling.md @@ -52,17 +52,17 @@ f9afb8caaef10de9a8aad484c4dd3bfa54ba7218f3fc245a20e8a03ed40b38c617e175328515968a ## Build Script -If you want your program crate to be built automatically whenever you build/run your script crate, you can add a `build.rs` file inside of `script/` (at the same level as `Cargo.toml` of your script crate) that utilizes the `sp1-helper` crate: +If you want your program crate to be built automatically whenever you build/run your script crate, you can add a `build.rs` file inside of `script/` (at the same level as `Cargo.toml` of your script crate) that utilizes the `sp1-build` crate: ```rust,noplayground {{#include ../../examples/fibonacci/script/build.rs}} ``` -The path passed in to `build_program` should point to the directory containing the `Cargo.toml` file for your program. Make sure to also add `sp1-helper` as a build dependency in `script/Cargo.toml`: +The path passed in to `build_program` should point to the directory containing the `Cargo.toml` file for your program. Make sure to also add `sp1-build` as a build dependency in `script/Cargo.toml`: ```toml [build-dependencies] -sp1-helper = "1.1.0" +sp1-build = "1.2.0" ``` You will see output like the following from the build script if the program has changed, indicating that the program was rebuilt: @@ -82,12 +82,12 @@ The above output was generated by running `RUST_LOG=info cargo run --release -vv ### Advanced build options -To configure the build process when using the `sp1-helper` crate, you can pass a [`BuildArgs`](https://docs.rs/sp1-helper/1.1.0/sp1_helper/struct.BuildArgs.html) struct to to the [`build_program_with_args`](https://docs.rs/sp1-helper/1.1.0/sp1_helper/fn.build_program_with_args.html) function. The build arguments are the same as the ones available from the `cargo prove build` command. +To configure the build process when using the `sp1-build` crate, you can pass a [`BuildArgs`](https://docs.rs/sp1-build/1.2.0/sp1_build/struct.BuildArgs.html) struct to to the [`build_program_with_args`](https://docs.rs/sp1-build/1.2.0/sp1_build/fn.build_program_with_args.html) function. The build arguments are the same as the ones available from the `cargo prove build` command. As an example, you could use the following code to build the Fibonacci example with the `docker` flag set to `true` and a custom output directory for the generated ELF: ```rust,noplayground -use sp1_helper::{build_program_with_args, BuildArgs}; +use sp1_build::{build_program_with_args, BuildArgs}; fn main() { let args = BuildArgs { diff --git a/build/README.md b/build/README.md index cc7620417c..0e29481b77 100644 --- a/build/README.md +++ b/build/README.md @@ -1,5 +1,5 @@ # sp1-build -Lightweight crate used to build SP1 programs. Internal crate that is exposed to users via `sp1-cli` and `sp1-helper`. +Lightweight crate used to build SP1 programs. Internal crate that is exposed to users via `sp1-cli`. Exposes `build_program`, which builds an SP1 program in the local environment or in a docker container with the specified parameters from `BuildArgs`. diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 823e75a80f..d4d21fffa1 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -26,7 +26,6 @@ sp1-derive = { path = "../derive" } sp1-core = { path = "../core" } sp1-cli = { path = "../cli", default-features = false } sp1-eval = { path = "../eval", default-features = false } -sp1-helper = { path = "../helper", default-features = false } sp1-primitives = { path = "../primitives" } sp1-prover = { path = "../prover" } sp1-recursion-compiler = { path = "../recursion/compiler" } diff --git a/examples/aggregation/script/Cargo.toml b/examples/aggregation/script/Cargo.toml index 4df959459c..7b3e3e3aee 100644 --- a/examples/aggregation/script/Cargo.toml +++ b/examples/aggregation/script/Cargo.toml @@ -10,4 +10,4 @@ sp1-sdk = { workspace = true } tracing = "0.1.40" [build-dependencies] -sp1-helper = { workspace = true } +sp1-build = { workspace = true } diff --git a/examples/chess/script/Cargo.toml b/examples/chess/script/Cargo.toml index cfa637b66f..0d1194077a 100644 --- a/examples/chess/script/Cargo.toml +++ b/examples/chess/script/Cargo.toml @@ -8,4 +8,4 @@ publish = false sp1-sdk = { workspace = true } [build-dependencies] -sp1-helper = { workspace = true } +sp1-build = { workspace = true } diff --git a/examples/cycle-tracking/script/Cargo.toml b/examples/cycle-tracking/script/Cargo.toml index fb8ef7774b..1b6dbc3cfd 100644 --- a/examples/cycle-tracking/script/Cargo.toml +++ b/examples/cycle-tracking/script/Cargo.toml @@ -8,4 +8,4 @@ publish = false sp1-sdk = { workspace = true } [build-dependencies] -sp1-helper = { workspace = true } +sp1-build = { workspace = true } diff --git a/examples/fibonacci/script/Cargo.toml b/examples/fibonacci/script/Cargo.toml index 6054ede538..72b35cc3b2 100644 --- a/examples/fibonacci/script/Cargo.toml +++ b/examples/fibonacci/script/Cargo.toml @@ -11,7 +11,7 @@ sp1-sdk = { workspace = true } sha2 = "0.10.8" [build-dependencies] -sp1-helper = { workspace = true } +sp1-build = { workspace = true } [[bin]] name = "plonk_bn254" diff --git a/examples/io/script/Cargo.toml b/examples/io/script/Cargo.toml index fbda365c6c..6297b360fe 100644 --- a/examples/io/script/Cargo.toml +++ b/examples/io/script/Cargo.toml @@ -9,4 +9,4 @@ serde = { version = "1.0.196", features = ["derive"] } sp1-sdk = { workspace = true } [build-dependencies] -sp1-helper = { workspace = true } +sp1-build = { workspace = true } diff --git a/examples/json/script/Cargo.toml b/examples/json/script/Cargo.toml index 796c53eff6..860202fbfb 100644 --- a/examples/json/script/Cargo.toml +++ b/examples/json/script/Cargo.toml @@ -11,4 +11,4 @@ sp1-sdk = { workspace = true } lib = { path = "../lib" } [build-dependencies] -sp1-helper = { workspace = true } +sp1-build = { workspace = true } diff --git a/examples/patch-testing/script/Cargo.toml b/examples/patch-testing/script/Cargo.toml index 29836184d4..3c17815e45 100644 --- a/examples/patch-testing/script/Cargo.toml +++ b/examples/patch-testing/script/Cargo.toml @@ -9,4 +9,4 @@ sp1-core = { workspace = true, features = ["neon"] } sp1-sdk = { workspace = true } [build-dependencies] -sp1-helper = { workspace = true } +sp1-build = { workspace = true } diff --git a/examples/regex/script/Cargo.toml b/examples/regex/script/Cargo.toml index 4efbee5cb5..b6430aacb6 100644 --- a/examples/regex/script/Cargo.toml +++ b/examples/regex/script/Cargo.toml @@ -8,4 +8,5 @@ publish = false sp1-sdk = { workspace = true } [build-dependencies] -sp1-helper = { workspace = true } +sp1-build = { workspace = true } + diff --git a/examples/rsa/script/Cargo.toml b/examples/rsa/script/Cargo.toml index 709cb17a55..668fd32149 100644 --- a/examples/rsa/script/Cargo.toml +++ b/examples/rsa/script/Cargo.toml @@ -9,4 +9,4 @@ rsa = "0.6" sp1-sdk = { workspace = true } [build-dependencies] -sp1-helper = { workspace = true } +sp1-build = { workspace = true } diff --git a/examples/ssz-withdrawals/script/Cargo.toml b/examples/ssz-withdrawals/script/Cargo.toml index 50a07d7351..7f8d4cf912 100644 --- a/examples/ssz-withdrawals/script/Cargo.toml +++ b/examples/ssz-withdrawals/script/Cargo.toml @@ -8,4 +8,4 @@ publish = false sp1-sdk = { workspace = true } [build-dependencies] -sp1-helper = { workspace = true } +sp1-build = { workspace = true } diff --git a/examples/tendermint/script/Cargo.toml b/examples/tendermint/script/Cargo.toml index 3f676e8d55..dc28bcf81e 100644 --- a/examples/tendermint/script/Cargo.toml +++ b/examples/tendermint/script/Cargo.toml @@ -21,4 +21,4 @@ serde_cbor = "0.11.2" sha2 = "0.10.8" [build-dependencies] -sp1-helper = { workspace = true } +sp1-build = { workspace = true }