From be9d784a84a1ea1077a9fc5e9a3f530a5403e73a Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 12 Jan 2022 10:55:48 +0100 Subject: [PATCH] patch submodule urls --- zokrates_core/build.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/zokrates_core/build.rs b/zokrates_core/build.rs index 82d0c96d..8d281b52 100644 --- a/zokrates_core/build.rs +++ b/zokrates_core/build.rs @@ -14,8 +14,8 @@ fn main() { use std::path::PathBuf; // fetch libsnark source - const LIBSNARK_URL: &'static str = "https://github.com/dark64/libsnark.git"; - const LIBSNARK_COMMIT: &'static str = "a38294cf04e80de32c2fb8b312557188315605cb"; + const LIBSNARK_URL: &'static str = "https://github.com/scipr-lab/libsnark.git"; + const LIBSNARK_COMMIT: &'static str = "f7c87b88744ecfd008126d415494d9b34c4c1b20"; let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); let libsnark_source_path = &out_path.join("libsnark"); @@ -25,6 +25,15 @@ fn main() { Repository::clone(LIBSNARK_URL, libsnark_source_path).unwrap() }); + // Unencrypted `git://` protocol is no longer supported on GitHub + // so we replace all submodule urls to use `https://` + let gitmodules_path = libsnark_source_path.join(".gitmodules"); + let gitmodules = std::fs::read_to_string(&gitmodules_path) + .unwrap() + .replace("git://", "https://"); + + std::fs::write(&gitmodules_path, gitmodules).unwrap(); + let object = repo.revparse_single(LIBSNARK_COMMIT).unwrap(); repo.checkout_tree(&object, None).unwrap();