Skip to content

Commit e40c3c9

Browse files
committed
fixup: replace bindgen
1 parent d08b3c3 commit e40c3c9

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ jobs:
2121
with:
2222
extra_args: --all-files
2323

24+
- uses: taiki-e/install-action@v2
25+
with:
26+
tool: bindgen-cli@0.72.1
27+
- name: Check if bindings are up-to-date
28+
working-directory: crates/codspeed/src/instrument_hooks
29+
run: |
30+
./update-bindings.sh
31+
32+
if ! git diff --exit-code bindings.rs; then
33+
echo "Error: FFI bindings are out of date!"
34+
exit 1
35+
fi
36+
2437
test-codspeed:
2538
runs-on: ${{ matrix.job.os }}
2639
strategy:

crates/codspeed/src/instrument_hooks/bindings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* automatically generated by rust-bindgen 0.72.0 */
1+
/* automatically generated by rust-bindgen 0.72.1 */
22

33
pub const MARKER_TYPE_SAMPLE_START: u32 = 0;
44
pub const MARKER_TYPE_SAMPLE_END: u32 = 1;

crates/codspeed/src/instrument_hooks/ffi.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@
77
// users don't need to install `libclang`.
88
//
99
// To regenerate bindings, run:
10-
// bindgen instrument-hooks/includes/core.h -o src/instrument_hooks/bindings.rs --rust-target 1.74 --allowlist-function "instrument_hooks_.*" --allowlist-var "MARKER_TYPE_.*"
10+
// ```
11+
// ./update-bindings.sh
12+
// ```
1113
include!("bindings.rs");
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
bindgen ../../instrument-hooks/includes/core.h \
5+
-o bindings.rs \
6+
--rust-target 1.74 \
7+
--allowlist-function "instrument_hooks_.*" \
8+
--allowlist-var "MARKER_TYPE_.*"

0 commit comments

Comments
 (0)