crypto/rust: default lux-crypto umbrella to build-cto, not stale build-canonical

The lux-crypto umbrella crate's build.rs defaulted to ../../../../luxcpp/crypto/
build-canonical when neither CRYPTO_DIR nor CRYPTO_BUILD_DIR was set. That
directory is a partial build from before the 2026-04-26 brand-neutral C-ABI
rename (luxcpp commit e8690bb8 "drop lux_ prefix from C-ABI symbols"). Its
libsecp256k1_cpu.a still exports _lux_secp256k1_ecrecover (legacy) while the
Rust extern "C" block expects _secp256k1_ecrecover (post-rename, brand-neutral).
build-canonical also lacks banderwagon/sha256/ripemd160 archives.

All 17 sibling per-algorithm crates already default to build-cto; only the
umbrella was misaligned. Switching the umbrella default to build-cto makes the
workspace build out of the box.

Verified: cargo test --workspace --all-features reports 182 PASS, 0 fail
(matching the #97-retry baseline) with no env vars set, and also with explicit
CRYPTO_BUILD_DIR=/Users/z/work/luxcpp/crypto/build-cto.
This commit is contained in:
Hanzo AI
2025-12-28 01:35:05 -08:00
parent dc7b4099e2
commit 686b38b19b
+7 -1
View File
@@ -46,10 +46,16 @@ fn main() {
} else if let Some(d) = build_dir {
PathBuf::from(d)
} else {
// Default to build-cto to match the per-algorithm member crates
// (lux-crypto-secp256k1, lux-crypto-keccak, etc.) which all default to
// build-cto. build-cto contains brand-neutral C-ABI symbols (post the
// 2026-04-26 rename) and all required archives. build-canonical is a
// partial build dir that may have stale objects from before the rename
// and does not contain banderwagon/sha256/ripemd160 archives.
manifest_dir
.join("..").join("..").join("..")
.join("..").join("luxcpp").join("crypto")
.join("build-canonical")
.join("build-cto")
};
println!("cargo:rerun-if-changed=src/lib.rs");