[libcxx-commits] [libcxx] 8676929 - [libc++][CI] Add a Github workflow to test libc++ tools (#211067)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jul 24 11:53:29 PDT 2026
Author: Louis Dionne
Date: 2026-07-24T14:53:24-04:00
New Revision: 86769296941811360d7126e41e3b13cbabab55ae
URL: https://github.com/llvm/llvm-project/commit/86769296941811360d7126e41e3b13cbabab55ae
DIFF: https://github.com/llvm/llvm-project/commit/86769296941811360d7126e41e3b13cbabab55ae.diff
LOG: [libc++][CI] Add a Github workflow to test libc++ tools (#211067)
We have a few scripts under libcxx/utils, and they wouldn't be tested on
a regular basis. As a result, changes to e.g. the build system could
break these scripts, which in turn could break some Github workflows
like the libc++ PR benchmarking workflow.
This patch adds a new `test-tools` configuration to `run-buildbot` which
allows testing these tools locally, and a new dedicated Github workflow
to run it.
Added:
.github/workflows/libcxx-pr-test-tools.yml
Modified:
libcxx/utils/ci/run-buildbot
Removed:
################################################################################
diff --git a/.github/workflows/libcxx-pr-test-tools.yml b/.github/workflows/libcxx-pr-test-tools.yml
new file mode 100644
index 0000000000000..64bbc705e5e09
--- /dev/null
+++ b/.github/workflows/libcxx-pr-test-tools.yml
@@ -0,0 +1,54 @@
+# This workflow exercises libc++ tools whose testing doesn't belong in the conformance
+# suite or in `check-cxx` proper.
+#
+# The actual logic lives in `libcxx/utils/ci/run-buildbot test-tools`, which is also how
+# failures can be reproduced locally (after installing libcxx/utils/requirements.txt):
+#
+# CC=clang CXX=clang++ libcxx/utils/ci/run-buildbot test-tools
+
+name: "[libc++] Test tools"
+
+on:
+ pull_request:
+ paths:
+ - 'libcxx/**'
+ - 'libcxxabi/**'
+ - 'libunwind/**'
+ - 'runtimes/**'
+ - 'cmake/**'
+ - '.github/workflows/libcxx-pr-test-tools.yml'
+ schedule:
+ # Match the main libc++ CI cron
+ - cron: '0 8 * * *'
+
+permissions:
+ contents: read # Default everything to read-only
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test-tools:
+ if: github.repository_owner == 'llvm'
+ runs-on: llvm-premerge-libcxx-runners
+ env:
+ CC: clang-23
+ CXX: clang++-23
+ steps:
+ - uses: actions/checkout at df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
+ with:
+ persist-credentials: false
+ fetch-depth: 0 # some tools need full git history
+ fetch-tags: true
+
+ - name: Set up Python dependencies
+ run: |
+ python3 -m venv .venv
+ source .venv/bin/activate
+ pip install -r libcxx/utils/requirements.txt
+
+ - name: Run the tooling smoke test
+ run: |
+ source .venv/bin/activate
+ libcxx/utils/ci/run-buildbot test-tools
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index 2ca14352b9b1b..a4fbf1ee315c0 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -270,6 +270,37 @@ check-generated-output)
--exclude 'underflow.pass.cpp' \
|| false
;;
+test-tools)
+ #
+ # This job tests libc++ tools that don't make sense to be tested inside the
+ # libc++ conformance test suite.
+ #
+ clean
+
+ step "Building and installing libc++ with build-at-commit"
+ "${MONOREPO_ROOT}/libcxx/utils/build-at-commit" \
+ --git-repo "${MONOREPO_ROOT}" \
+ --commit HEAD \
+ --install-dir "${INSTALL_DIR}" \
+ --tmp-build-dir "${BUILD_DIR}/build-at-commit" \
+ -- -DCMAKE_CXX_COMPILER="${CXX}" \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo
+
+ step "Running a benchmark through the benchmark tooling pipeline"
+ "${MONOREPO_ROOT}/libcxx/utils/test-at-commit" \
+ --git-repo "${MONOREPO_ROOT}" \
+ --libcxx-installation "${INSTALL_DIR}" \
+ --build-dir "${BUILD_DIR}/benchmarks" \
+ --compiler "${CXX}" \
+ -- -sv --param optimization=speed \
+ "${MONOREPO_ROOT}/libcxx/test/benchmarks/hash.bench.cpp"
+
+ step "Consolidate benchmark results"
+ "${MONOREPO_ROOT}/libcxx/utils/consolidate-benchmarks" "${BUILD_DIR}/benchmarks" > "${BUILD_DIR}/results.lnt"
+
+ step "Compare benchmark results" # perform a no-op comparison, just to run the tool
+ "${MONOREPO_ROOT}/libcxx/utils/compare-benchmarks" "${BUILD_DIR}/results.lnt" "${BUILD_DIR}/results.lnt"
+;;
#
# Various Standard modes
#
More information about the libcxx-commits
mailing list