Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,12 @@ lean_lib Blake3Rust where
roots := #[`Blake3.Rust]
moreLinkObjs := #[blake3_rs]

/-- The `blake3-rs` shared library. Produced by the same `cargo build` as
`blake3_rs`; this target selects the `cdylib` output for downstream tooling
that loads the raw `rs_blake3_*` symbols at runtime rather than linking them
statically — e.g. supplying the BLAKE3 backend to Lean's native evaluator for
`native_decide` proofs. -/
target blake3_rs_shared pkg : System.FilePath := do
proc { cmd := "cargo", args := #["build", "--release"], cwd := pkg.dir / "rust" } (quiet := true)
inputBinFile $ pkg.dir / "rust" / "target" / "release" / nameToSharedLib "blake3_rs"

6 changes: 5 additions & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ version = "0.1.0"
edition = "2024"

[lib]
crate-type = ["staticlib"]
# `staticlib` is linked into final Lean executables. `cdylib` additionally
# builds a position-independent shared object exporting the raw `rs_blake3_*`
# symbols, so they can be loaded at runtime — e.g. by Lean's native evaluator
# for `native_decide` proofs elaborated before any executable is linked.
crate-type = ["staticlib", "cdylib"]

[dependencies]
blake3 = "1.8.4"
Expand Down
Loading