Skip to content

Commit

Permalink
v0.1.14 release (#102)
Browse files Browse the repository at this point in the history
* rm zcash

* Squashed 'depend/zcash/' content from commit e08571476

git-subtree-dir: depend/zcash
git-subtree-split: e08571476d8a59d0a624da7b118ab8d8ad2a6246

* delete zcash/Cargo.toml

* update versions

* update build

* make sapling.rs work by renaming it and copying it to OUT_DIR

* cargo fmt

---------

Co-authored-by: Conrado Gouvea <[email protected]>
  • Loading branch information
oxarbitrage and conradoplg authored Oct 17, 2023
1 parent 36de930 commit 3fdf588
Show file tree
Hide file tree
Showing 109 changed files with 4,271 additions and 4,476 deletions.
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,28 @@ external-secp = []
# https://github.com/zcash/zcash/blob/<git subtree version>/Cargo.toml
bellman = "0.14"
blake2b_simd = "1"
blake2s_simd = "1"
bls12_381 = "0.8"
byteorder = "1"
crossbeam-channel = "0.5"
cxx = { version = "=1.0.95", features = ["c++17"] }
cxx = { version = "=1.0.107", features = ["c++17"] }
group = "0.13"
incrementalmerkletree = "0.4"
incrementalmerkletree = "0.5"
jubjub = "0.10"
libc = "0.2"
memuse = "0.2"
metrics = "0.21"
orchard = "0.5"
orchard = "0.6"
rand_core = "0.6"
rayon = "1.5"
subtle = "2.2"
tracing = "0.1"
zcash_address = "0.3"
zcash_encoding = "0.2"
zcash_note_encryption = "0.4"
zcash_primitives = { version = "0.12", features = ["temporary-zcashd", "transparent-inputs"] }
zcash_proofs = "0.12"
bridgetree = "0.3"
zcash_primitives = { version = "=0.13.0-rc.1", features = ["temporary-zcashd", "transparent-inputs"] }
zcash_proofs = { version = "=0.13.0-rc.1", features = ["directories"] }
bridgetree = "0.4"
rand = "0.8"

[build-dependencies]
Expand All @@ -86,9 +87,9 @@ bindgen = ">= 0.64.0"
# These dependencies are shared with a lot of other Zebra dependencies,
# so they are configured to automatically upgrade to match Zebra.
# But we try to use the latest versions here, to catch any bugs in `zcash_script`'s CI.
cc = { version = "1.0.79", features = ["parallel"] }
cc = { version = "1.0.83", features = ["parallel"] }
# Treat minor versions with a zero major version as compatible (cargo doesn't by default).
cxx-gen = ">= 0.7.93"
cxx-gen = ">= 0.7.107"
syn = { version = "1.0.109", features = ["full", "printing"] }

[dev-dependencies]
Expand All @@ -98,8 +99,8 @@ syn = { version = "1.0.109", features = ["full", "printing"] }
# Treat minor versions with a zero major version as compatible (cargo doesn't by default).
hex = ">= 0.4.3"
lazy_static = "1.4.0"
incrementalmerkletree = { version = "0.4", features = ["test-dependencies"] }
zcash_primitives = { version = "0.12", features = ["temporary-zcashd", "transparent-inputs", "test-dependencies"] }
incrementalmerkletree = { version = "0.5", features = ["test-dependencies"] }
zcash_primitives = { version = "=0.13.0-rc.1", features = ["temporary-zcashd", "transparent-inputs", "test-dependencies"] }

[[package.metadata.release.pre-release-replacements]]
file = "CHANGELOG.md"
Expand Down
65 changes: 54 additions & 11 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@ fn gen_cxxbridge() -> Result<()> {
let header_out_path = PathBuf::from(&out_path).join("include").join("rust");

// These must match `CXXBRIDGE_RS` in depend/zcash/src/Makefile.am
let filenames = ["blake2b", "ed25519", "equihash", "streams", "bridge"];
let filenames = [
"blake2b",
"ed25519",
"equihash",
"streams",
"bridge",
"sapling/zip32",
];

// The output folder must exist
fs::create_dir_all(&src_out_path).unwrap();
Expand Down Expand Up @@ -103,16 +110,15 @@ fn gen_cxxbridge() -> Result<()> {
)
});

fs::write(
header_out_path.join(format!("{}.h", filename)),
output.header,
)
.unwrap();
fs::write(
src_out_path.join(format!("{}.c", filename)),
output.implementation,
)
.unwrap();
let header_path = header_out_path.join(format!("{}.h", filename));
// Create output dir if does not exist (since `filename` can have a subdir)
fs::create_dir_all(header_path.parent().unwrap()).unwrap();
fs::write(header_path, output.header).unwrap();

let src_path = src_out_path.join(format!("{}.c", filename));
// Create output dir if does not exist (since `filename` can have a subdir)
fs::create_dir_all(src_path.parent().unwrap()).unwrap();
fs::write(src_path, output.implementation).unwrap();
}
Ok(())
}
Expand All @@ -121,6 +127,43 @@ fn main() -> Result<()> {
bindgen_headers()?;
gen_cxxbridge()?;

let rust_path = env::var("OUT_DIR").map_err(Error::Env)?;
let rust_path = PathBuf::from(rust_path).join("rust");

// We want to compile `depend/zcash/src/rust/src/sapling.rs`, which we used
// to do in `src/sapling.rs` by just including it. However, now that it has
// submodules, that approach doesn't work because for some reason Rust
// searches for the submodules in `depend/zcash/src/rust/src/` instead of
// `depend/zcash/src/rust/src/sapling/` where they are located. This can
// be solved if `depend/zcash/src/rust/src/sapling.rs` is renamed to
// `depend/zcash/src/rust/src/sapling/mod.rs`. But we can't do that directly
// because we can't change the source tree inside `build.rs`. Therefore we
// copy the required files to OUT_DIR, with a renamed sapling.rs, and include
// the copied file instead (see src/sapling.rs).
// See also https://stackoverflow.com/questions/77310390/how-to-include-a-source-file-that-has-modules
fs::create_dir_all(rust_path.join("sapling")).unwrap();
for filename in &["sapling.rs", "sapling/spec.rs", "sapling/zip32.rs"] {
println!(
"cargo:rerun-if-changed=depend/zcash/src/rust/src/{}.rs",
filename
);
}
fs::copy(
"depend/zcash/src/rust/src/sapling.rs",
rust_path.join("sapling/mod.rs"),
)
.unwrap();
fs::copy(
"depend/zcash/src/rust/src/sapling/spec.rs",
rust_path.join("sapling/spec.rs"),
)
.unwrap();
fs::copy(
"depend/zcash/src/rust/src/sapling/zip32.rs",
rust_path.join("sapling/zip32.rs"),
)
.unwrap();

let gen_path = env::var("OUT_DIR").map_err(Error::Env)?;
let gen_path = PathBuf::from(gen_path).join("gen");

Expand Down
11 changes: 10 additions & 1 deletion depend/zcash/.github/workflows/audits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,14 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
id: toolchain
- run: rustup override set ${{steps.toolchain.outputs.name}}
- run: cargo install cargo-vet --version ~0.6
- run: cargo install cargo-vet --version ~0.8
- run: cargo vet --locked

cargo-deny:
name: Check licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check licenses
15 changes: 10 additions & 5 deletions depend/zcash/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

- name: Install cross-compilation build dependencies
if: matrix.cross_deps != ''
run: sudo apt install ${{ matrix.cross_deps }}
run: sudo apt update && sudo apt install ${{ matrix.cross_deps }}

- name: Configure MinGW to use POSIX variant
if: matrix.name == 'mingw32'
Expand Down Expand Up @@ -85,33 +85,38 @@ jobs:
restore-keys: |
${{ matrix.name }}-ccache-
- name: Get the number of available processing cores
id: nproc
shell: bash
run: echo "count=$(nproc 2> /dev/null || sysctl -n hw.logicalcpu)" >> "$GITHUB_OUTPUT"

- name: Build zcashd
id: build
run: >
${{ matrix.host }}
./zcutil/build.sh
-j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
-j"${{ steps.nproc.outputs.count }}"
- name: Build zcashd with libraries enabled
if: ${{ always() && steps.build.outcome == 'success' }}
run: >
CONFIGURE_FLAGS="--with-libs"
${{ matrix.host }}
./zcutil/build.sh
-j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
-j"${{ steps.nproc.outputs.count }}"
- name: Build zcashd with wallet disabled
if: ${{ always() && steps.build.outcome == 'success' }}
run: >
CONFIGURE_FLAGS="--disable-wallet"
${{ matrix.host }}
./zcutil/build.sh
-j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
-j"${{ steps.nproc.outputs.count }}"
- name: Build zcashd with mining disabled
if: ${{ always() && steps.build.outcome == 'success' }}
run: >
CONFIGURE_FLAGS="--disable-mining"
${{ matrix.host }}
./zcutil/build.sh
-j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
-j"${{ steps.nproc.outputs.count }}"
4 changes: 4 additions & 0 deletions depend/zcash/.github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
if: always()
continue-on-error: true # Temporary until we get this passing

- name: make dist
run: ./test/lint/lint-make-dist.sh
if: always()

- name: Shebang
run: ./test/lint/lint-shebang.sh
if: always()
Expand Down
Loading

0 comments on commit 3fdf588

Please sign in to comment.