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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
[submodule "crates/divan_compat/examples/src/the_algorithms/Rust"]
path = crates/divan_compat/examples/src/the_algorithms/Rust
url = https://github.com/TheAlgorithms/Rust.git
[submodule "crates/codspeed/instrument-hooks"]
path = crates/codspeed/instrument-hooks
url = https://github.com/CodSpeedHQ/instrument-hooks
114 changes: 105 additions & 9 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions crates/codspeed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ keywords = ["codspeed", "benchmark"]

[dependencies]
anyhow = { workspace = true }
bincode = "1.3.3"
colored = "2.0.0"
glob = "0.3.2"
libc = "^0.2"
nix = { version = "0.29.0", features = ["fs"] }
nix = { version = "0.30.1", features = ["time"] }
serde = { workspace = true }
serde_json = { workspace = true }
statrs = { version = "0.18.0", default-features = false }
Expand All @@ -35,3 +34,7 @@ harness = false

[dev-dependencies]
tempfile = { workspace = true }

[build-dependencies]
bindgen = "0.72.1"
cc = "1.0"
24 changes: 24 additions & 0 deletions crates/codspeed/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use std::{env, path::PathBuf};

fn main() {
// Compile the C library
cc::Build::new()
.file("instrument-hooks/dist/core.c")
.include("instrument-hooks/includes")
.flag("-w") // Suppress all warnings
.compile("instrument_hooks");

let bindings = bindgen::Builder::default()
.header("instrument-hooks/includes/core.h")
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.generate()
.expect("Unable to generate bindings");

// Write the bindings to the $OUT_DIR/bindings.rs file.
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
}
1 change: 1 addition & 0 deletions crates/codspeed/instrument-hooks
Submodule instrument-hooks added at 0d3de5
Loading
Loading