Skip to content

Commit badc1c3

Browse files
tarebyteCopilot
andcommitted
ci: add libclang-dev for tree-sitter cargo build
tree-sitter-cli depends on rquickjs-sys which uses bindgen, requiring libclang. Add libclang-dev to both the CI rustup step and the script's cargo fallback path so it works in real codespaces too. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e386f9d commit badc1c3

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
- name: Install Rust toolchain (old glibc only)
9090
if: matrix.image == 'ubuntu:20.04'
9191
run: |
92-
apt-get install -y build-essential
92+
apt-get install -y build-essential libclang-dev
9393
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
9494
| sh -s -- -y --profile minimal
9595
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"

script/install-codespace-tools

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ else
9595
GLIBC_VER=$(getconf GNU_LIBC_VERSION 2>/dev/null | awk '{print $2}' || echo "unknown")
9696
echo " Installing tree-sitter-cli via cargo (glibc ${GLIBC_VER} < 2.35)..."
9797
if command -v cargo >/dev/null 2>&1; then
98+
if ! dpkg -s libclang-dev >/dev/null 2>&1; then
99+
echo " sudo: installing libclang-dev (needed by bindgen)..."
100+
sudo apt-get install -yq libclang-dev >/dev/null 2>&1
101+
fi
98102
cargo install tree-sitter-cli --root "$HOME/.local"
99103
echo " ✓ tree-sitter installed ($(tool_version tree-sitter), $((SECONDS - start))s)"
100104
else

0 commit comments

Comments
 (0)