Skip to content

Commit ee6bc24

Browse files
committed
fix(ci): provide libclang for the test and bench jobs
nextest (cargo test --no-run) and cargo bench both compile the dev-dependency graph which pulls in rocksdb → librocksdb-sys → bindgen → libclang. Windows runner images already ship LLVM; Linux and macOS do not. Added an LLVM/Clang install step to the test job (apt on Linux, brew + LIBCLANG_PATH on macOS) and to the bench job (apt on Linux), so bindgen can locate libclang on every platform and the jobs no longer fail at the compile step.
1 parent 874d51d commit ee6bc24

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,19 @@ jobs:
9595
- name: Install Rust
9696
uses: dtolnay/rust-toolchain@stable
9797

98+
# nextest compiles the dev-dependency graph (incl. rocksdb →
99+
# librocksdb-sys → bindgen → libclang). Windows runner images ship LLVM;
100+
# Linux and macOS need it installed.
101+
- name: Install LLVM/Clang (Linux)
102+
if: runner.os == 'Linux'
103+
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
104+
105+
- name: Install LLVM/Clang (macOS)
106+
if: runner.os == 'macOS'
107+
run: |
108+
brew install llvm
109+
echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> "$GITHUB_ENV"
110+
98111
- uses: Swatinem/rust-cache@v2
99112
with:
100113
prefix-key: test-${{ matrix.os }}
@@ -225,6 +238,11 @@ jobs:
225238
- name: Install Rust
226239
uses: dtolnay/rust-toolchain@stable
227240

241+
# cargo bench builds the dev-dependency graph (rocksdb → librocksdb-sys →
242+
# bindgen → libclang), even when only the btree/segment benches are named.
243+
- name: Install LLVM/Clang
244+
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
245+
228246
- uses: Swatinem/rust-cache@v2
229247
with:
230248
prefix-key: bench

0 commit comments

Comments
 (0)