[libcxx-commits] [libcxx] [llvm] [libc++][CI] Add a Github workflow to test libc++ tools (PR #211067)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jul 24 08:04:14 PDT 2026
https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/211067
>From 6bf86ec0dac40284dee328b708daec05d8a6fddb Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 21 Jul 2026 13:08:51 -0400
Subject: [PATCH 1/3] [libc++][CI] Add a Github workflow to test libc++ tools
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.
---
.github/workflows/libcxx-pr-test-tools.yml | 58 ++++++++++++++++++++++
libcxx/utils/ci/run-buildbot | 29 +++++++++++
2 files changed, 87 insertions(+)
create mode 100644 .github/workflows/libcxx-pr-test-tools.yml
diff --git a/.github/workflows/libcxx-pr-test-tools.yml b/.github/workflows/libcxx-pr-test-tools.yml
new file mode 100644
index 0000000000000..73299d9d66d48
--- /dev/null
+++ b/.github/workflows/libcxx-pr-test-tools.yml
@@ -0,0 +1,58 @@
+# 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
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test-tools:
+ runs-on: llvm-premerge-libcxx-runners
+ continue-on-error: false
+ 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
+
+ - uses: actions/setup-python at ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
+ with:
+ python-version: '3.14'
+
+ - name: Set up Python dependencies
+ run: |
+ python3 -m venv .venv
+ source .venv/bin/activate
+ python -m 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..2ec5838a7ea52 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -270,6 +270,35 @@ 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_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" \
+ -- -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
#
>From ff1f391126740c12c92f57714335c36221e9dcf2 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Thu, 23 Jul 2026 16:35:44 -0400
Subject: [PATCH 2/3] Adjust for recent changes
---
libcxx/utils/ci/run-buildbot | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index 2ec5838a7ea52..a4fbf1ee315c0 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -283,13 +283,15 @@ test-tools)
--commit HEAD \
--install-dir "${INSTALL_DIR}" \
--tmp-build-dir "${BUILD_DIR}/build-at-commit" \
- -- -DCMAKE_BUILD_TYPE=RelWithDebInfo
+ -- -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"
>From d593e59a2893a8a7f1d3a5b24ac051c61eaaf9f4 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Fri, 24 Jul 2026 11:03:29 -0400
Subject: [PATCH 3/3] Review comments
---
.github/workflows/libcxx-pr-test-tools.yml | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/libcxx-pr-test-tools.yml b/.github/workflows/libcxx-pr-test-tools.yml
index 73299d9d66d48..64bbc705e5e09 100644
--- a/.github/workflows/libcxx-pr-test-tools.yml
+++ b/.github/workflows/libcxx-pr-test-tools.yml
@@ -22,7 +22,7 @@ on:
- cron: '0 8 * * *'
permissions:
- contents: read
+ contents: read # Default everything to read-only
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -30,8 +30,8 @@ concurrency:
jobs:
test-tools:
+ if: github.repository_owner == 'llvm'
runs-on: llvm-premerge-libcxx-runners
- continue-on-error: false
env:
CC: clang-23
CXX: clang++-23
@@ -42,15 +42,11 @@ jobs:
fetch-depth: 0 # some tools need full git history
fetch-tags: true
- - uses: actions/setup-python at ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
- with:
- python-version: '3.14'
-
- name: Set up Python dependencies
run: |
python3 -m venv .venv
source .venv/bin/activate
- python -m pip install -r libcxx/utils/requirements.txt
+ pip install -r libcxx/utils/requirements.txt
- name: Run the tooling smoke test
run: |
More information about the libcxx-commits
mailing list