ceremonyclient/crates/ferret/build.rs
Cassandra Heart 12996487c3
v2.1.0.18 (#508)
* experiment: reject bad peer info messages

* v2.1.0.18 preview

* add tagged sync

* Add missing hypergraph changes

* small tweaks to sync

* allow local sync, use it for provers with workers

* missing file

* resolve build error

* resolve sync issue, remove raw sync

* resolve deletion promotion bug

* resolve sync abstraction leak from tree deletion changes

* rearrange prover sync

* remove pruning from sync

* restore removed sync flag

* fix: sync, event stream deadlock, heuristic scoring of better shards

* resolve hanging shutdown + pubsub proxy issue

* further bugfixes: sync (restore old leaf sync), pubsub shutdown, merge events

* fix: clean up rust ffi, background coverage events, and sync tweaks

* fix: linking issue for channel, connectivity test aggression, sync regression, join tests

* fix: disjoint sync, improper application of filter

* resolve sync/reel/validation deadlock

* adjust sync to handle no leaf edge cases, multi-path segment traversal

* use simpler sync

* faster, simpler sync with some debug extras

* migration to recalculate

* don't use batch

* square up the roots

* fix nil pointer

* fix: seniority calculation, sync race condition, migration

* make sync dumber

* fix: tree deletion issue

* fix: missing seniority merge request canonical serialization

* address issues from previous commit test

* stale workers should be cleared

* remove missing gap check

* rearrange collect, reduce sync logging noise

* fix: the disjoint leaf/branch sync case

* nuclear option on sync failures

* v2.1.0.18, finalized
2026-02-08 23:51:51 -06:00

102 lines
3.7 KiB
Rust

// build.rs
use cc;
use std::env;
use std::path::PathBuf;
use std::process::Command;
fn main() {
let target = env::var("TARGET").expect("cargo should have set this");
// Get path to local emp-tool and emp-ot directories (relative to crates/ferret)
// manifest_dir is .../ceremonyclient/crates/ferret
// emp-tool is at .../ceremonyclient/emp-tool
// emp-ot is at .../ceremonyclient/emp-ot
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let emp_tool_local = format!("{}/../../emp-tool", manifest_dir);
let emp_ot_local = format!("{}/../../emp-ot", manifest_dir);
if target == "aarch64-apple-darwin" {
cc::Build::new()
.cpp(true)
.flag_if_supported("-std=c++17")
.file("emp_bridge.cpp")
// Local emp-tool first (for buffer_io_channel.h)
.flag(&format!("-I{}", emp_tool_local))
// Local emp-ot first (for ferret_cot.h with is_setup())
.flag(&format!("-I{}", emp_ot_local))
.flag("-I/usr/local/include/emp-tool/")
.flag("-I/usr/local/include/emp-ot/")
.flag("-I/opt/homebrew/Cellar/openssl@3/3.6.1/include")
.flag("-L/usr/local/lib/emp-tool/")
.flag("-L/opt/homebrew/Cellar/openssl@3/3.6.1/lib")
.warnings(false)
.compile("emp_bridge");
println!("cargo:rustc-link-search=native=/usr/local/lib");
println!("cargo:rustc-link-search=native=/opt/homebrew/lib");
println!("cargo:rustc-link-lib=static=emp-tool");
println!("cargo:rustc-link-lib=dylib=c++");
println!("cargo:rustc-link-lib=dylib=crypto");
println!("cargo:rustc-link-lib=dylib=ssl");
println!("cargo:rerun-if-changed=emp_bridge.cpp");
println!("cargo:rerun-if-changed=emp_bridge.h");
} else if target == "aarch64-unknown-linux-gnu" {
cc::Build::new()
.cpp(true)
.flag_if_supported("-std=c++17")
.flag_if_supported("-march=armv8-a+crypto")
.file("emp_bridge.cpp")
.flag("-I/usr/local/include/emp-tool/")
.flag("-I/usr/local/include/emp-ot/")
.flag("-I/usr/include/openssl/")
.flag("-L/usr/local/lib/")
.flag("-L/usr/local/lib/aarch64-linux-gnu/")
.flag("-L/usr/lib/aarch64-linux-gnu/openssl/")
.warnings(false)
.compile("emp_bridge");
println!("cargo:rustc-link-search=native=/usr/local/lib/aarch64-linux-gnu");
println!("cargo:rustc-link-search=native=/usr/local/lib/");
println!("cargo:rustc-link-lib=static=emp-tool");
println!("cargo:rustc-link-lib=dylib=stdc++");
println!("cargo:rustc-link-lib=dylib=crypto");
println!("cargo:rustc-link-lib=dylib=ssl");
println!("cargo:rerun-if-changed=emp_bridge.cpp");
println!("cargo:rerun-if-changed=emp_bridge.h");
} else if target == "x86_64-unknown-linux-gnu" {
cc::Build::new()
.cpp(true)
.flag_if_supported("-std=c++17")
.flag_if_supported("-maes")
.flag_if_supported("-msse4.1")
.file("emp_bridge.cpp")
.flag("-I/usr/local/include/emp-tool/")
.flag("-I/usr/local/include/emp-ot/")
.flag("-I/usr/include/openssl/")
.flag("-L/usr/local/lib/")
.flag("-L/usr/lib/openssl/")
.warnings(false)
.compile("emp_bridge");
println!("cargo:rustc-link-search=native=/usr/local/lib");
println!("cargo:rustc-link-lib=static=emp-tool");
println!("cargo:rustc-link-lib=dylib=stdc++");
println!("cargo:rustc-link-lib=dylib=crypto");
println!("cargo:rustc-link-lib=dylib=ssl");
println!("cargo:rerun-if-changed=emp_bridge.cpp");
println!("cargo:rerun-if-changed=emp_bridge.h");
} else {
panic!("unsupported target {target}");
}
uniffi::generate_scaffolding("src/lib.udl").expect("uniffi generation failed");
}