diff --git a/.circleci/config.yml b/.circleci/config.yml index 8007b279b..2e682aa29 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,7 +23,7 @@ jobs: command: cargo generate-lockfile - restore_cache: keys: - - v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} + - cargo-cache-{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Cargo.lock" }} - run: name: Build command: WITH_LIBSNARK=1 RUSTFLAGS="-D warnings" ./build.sh @@ -33,7 +33,7 @@ jobs: - target/debug/.fingerprint - target/debug/build - target/debug/deps - key: v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} + key: cargo-cache-{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Cargo.lock" }} test: docker: - image: zokrates/env:latest @@ -48,7 +48,7 @@ jobs: command: cargo generate-lockfile - restore_cache: keys: - - v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} + - cargo-cache-{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Cargo.lock" }} - run: name: Check format command: cargo fmt --all -- --check @@ -82,7 +82,7 @@ jobs: command: cargo generate-lockfile - restore_cache: keys: - - v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} + - cargo-cache-{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Cargo.lock" }} - run: name: Test on firefox command: | @@ -103,7 +103,7 @@ jobs: command: cargo generate-lockfile - restore_cache: keys: - - v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} + - cargo-cache-{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Cargo.lock" }} - run: name: Run integration tests no_output_timeout: "30m" diff --git a/Cargo.lock b/Cargo.lock index b46577108..1afa62d6f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1121,9 +1121,9 @@ checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" [[package]] name = "git2" -version = "0.13.23" +version = "0.13.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a8057932925d3a9d9e4434ea016570d37420ddb1ceed45a174d577f24ed6700" +checksum = "f29229cc1b24c0e6062f6e742aa3e256492a5323365e5ed3413599f8a5eff7d6" dependencies = [ "bitflags", "libc", @@ -1246,9 +1246,9 @@ checksum = "7b2f96d100e1cf1929e7719b7edb3b90ab5298072638fccd77be9ce942ecdfce" [[package]] name = "libgit2-sys" -version = "0.12.24+1.3.0" +version = "0.12.26+1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddbd6021eef06fb289a8f54b3c2acfdd85ff2a585dfbb24b8576325373d2152c" +checksum = "19e1c899248e606fbfe68dcb31d8b0176ebab833b103824af31bddf4b7457494" dependencies = [ "cc", "libc", diff --git a/zokrates_core/Cargo.toml b/zokrates_core/Cargo.toml index 194b9b21a..07184a7ea 100644 --- a/zokrates_core/Cargo.toml +++ b/zokrates_core/Cargo.toml @@ -66,4 +66,4 @@ zokrates_fs_resolver = { version = "0.5", path = "../zokrates_fs_resolver"} [build-dependencies] cc = { version = "1.0", features = ["parallel"], optional = true } cmake = { version = "=0.1.45", optional = true } -git2 = { version = "0.13.1", optional = true } +git2 = { version = "0.13.25", optional = true } diff --git a/zokrates_core/build.rs b/zokrates_core/build.rs index 4c8e53795..8d281b522 100644 --- a/zokrates_core/build.rs +++ b/zokrates_core/build.rs @@ -8,7 +8,7 @@ extern crate git2; fn main() { #[cfg(feature = "libsnark")] { - use git2::{Oid, Repository, ResetType}; + use git2::Repository; use std::env; use std::fs::remove_dir; use std::path::PathBuf; @@ -25,11 +25,17 @@ fn main() { Repository::clone(LIBSNARK_URL, libsnark_source_path).unwrap() }); - let commit = Oid::from_str(LIBSNARK_COMMIT).unwrap(); - let commit = repo.find_commit(commit).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://"); - repo.reset(&commit.as_object(), ResetType::Hard, None) - .unwrap(); + std::fs::write(&gitmodules_path, gitmodules).unwrap(); + + let object = repo.revparse_single(LIBSNARK_COMMIT).unwrap(); + repo.checkout_tree(&object, None).unwrap(); for mut s in repo.submodules().unwrap() { s.update(true, None).unwrap();