From 17f5e235a94a8e8f95bb4f25f68d8da3b8a18a66 Mon Sep 17 00:00:00 2001 From: dailz Date: Sun, 28 Jun 2026 17:20:02 +0800 Subject: [PATCH] ci(gitea): broaden libclang find pattern to match versioned sonames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Second LIBCLANG_PATH failure mode: my 'libclang.so.*' with -type f pattern returned nothing because Debian Bookworm's runtime library is 'libclang-14.so.1' (versioned, with no plain libclang.so.* symlink), and the .so symlink is itself a symlink not a regular file (-type f excludes it). bindgen accepts any of: libclang.so, libclang-*.so, libclang.so.*, libclang-*.so.* — so the broader 'libclang*.so*' (no -type filter) catches every variant. Also broadened search root from /usr/lib to /usr to cover both /usr/lib/x86_64-linux-gnu/ (runtime lib) and /usr/lib/llvm-*/lib/ (dev symlink). Log line now includes the actual matched path so future debugging is one glance. --- .github/workflows/ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85c6f36..3e8c32a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,12 +61,18 @@ jobs: # Writing to $GITHUB_ENV propagates the value to subsequent steps # inside the act_runner Docker container; the workflow-level `env:` # block is not reliably visible there. + # + # Find pattern note: Debian Bookworm installs the runtime library as + # `libclang-14.so.1` (versioned, no plain libclang.so.* symlink), + # so a strict 'libclang.so.*' pattern returns nothing. The broader + # 'libclang*.so*' matches every bindgen-compatible filename variant: + # libclang.so, libclang-14.so, libclang.so.1, libclang-14.so.1. run: | set -e - LIBCL=$(find /usr/lib -name 'libclang.so.*' -type f 2>/dev/null | head -1) - test -n "$LIBCL" || { echo "ERROR: libclang.so.* not found under /usr/lib"; exit 1; } + LIBCL=$(find /usr -name 'libclang*.so*' 2>/dev/null | head -1) + test -n "$LIBCL" || { echo "ERROR: no libclang shared lib found under /usr"; exit 1; } LIBDIR=$(dirname "$LIBCL") - echo "Resolved LIBCLANG_PATH=$LIBDIR" + echo "Resolved LIBCLANG_PATH=$LIBDIR (found $LIBCL)" echo "LIBCLANG_PATH=$LIBDIR" >> "$GITHUB_ENV" - name: Cache cargo registry + build artifacts