Skip to content

Commit

Permalink
add git submodule update --init to methods/build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
sashaaldrick committed Oct 29, 2024
1 parent ecee4bd commit f391a1d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion methods/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::{collections::HashMap, env};
use std::{collections::HashMap, env, process::Command};

use risc0_build::{embed_methods_with_options, DockerOptions, GuestOptions};
use risc0_build_ethereum::generate_solidity_files;
Expand All @@ -21,7 +21,24 @@ use risc0_build_ethereum::generate_solidity_files;
const SOLIDITY_IMAGE_ID_PATH: &str = "../contracts/ImageID.sol";
const SOLIDITY_ELF_PATH: &str = "../tests/Elf.sol";

fn run_git_submodule_update() {
let output = Command::new("git")
.args(["submodule", "update", "--init"])
.output()
.expect("failed to run git submodule update in methods/build.rs");

if !output.status.success() {
panic!(
"git submodule update failed (methods/build.rs): {}",
String::from_utf8_lossy(&output.stderr)
);
}
}

fn main() {
run_git_submodule_update();
println!("cargo:rerun-if-changed=.gitmodules");

// Builds can be made deterministic, and thereby reproducible, by using Docker to build the
// guest. Check the RISC0_USE_DOCKER variable and use Docker to build the guest if set.
println!("cargo:rerun-if-env-changed=RISC0_USE_DOCKER");
Expand Down

0 comments on commit f391a1d

Please sign in to comment.