Skip to content

Commit 92ccb58

Browse files
committed
Try adding Github Problem Matchers to libc++ workflow.
The problem matchers are simple regex's that will be applied to the output of particular steps, and when a match is found, an annotation is applied to the relevent github workflow. The idea is to more easily surface relevent failure information, which may otherwise be hidden among cancelled tasks. The Problem Matcher specification/format is rather limited in its descriptive abliity, meaning we lose most context about the error. Further, because many of the source files are re-arranged before use, it prevents us from actually pointing to the file:line in the github UI; Boo :-(. A more complete solution would likely hook into LIT, remap source file paths as needed, and use the "echo ::error::" toolkit command to create the annotations.
1 parent 1c305f7 commit 92ccb58

File tree

2 files changed

+52
-3
lines changed

2 files changed

+52
-3
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "clang",
5+
"pattern": [
6+
{
7+
"regexp": "^(.+):(\\d+):(\\d+):\\s+(error|warning):\\s+(.+)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"severity": 4,
12+
"message": 5
13+
}
14+
]
15+
},
16+
{
17+
"owner": "lit",
18+
"severity": "error",
19+
"pattern": [
20+
{
21+
"regexp": "^\\s*(FAIL|XPASS):\\s+([^\\s]+)\\s+::\\s+(.+?)\\s+\\(\\d+\\s+of\\s+\\d+\\)$",
22+
"message": 2
23+
}
24+
]
25+
}
26+
]
27+
}

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,17 @@ jobs:
5757
steps:
5858
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5959
- name: ${{ matrix.config }}.${{ matrix.cxx }}
60-
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
60+
run: |
61+
echo "::add-matcher::.github/libcxx-problem-matchers.json"
62+
libcxx/utils/ci/run-buildbot ${{ matrix.config }}
6163
env:
6264
CC: ${{ matrix.cc }}
6365
CXX: ${{ matrix.cxx }}
66+
- if: always()
67+
name: Disable Problem Matchers
68+
run: |
69+
echo "::remove-matcher owner=lit::"
70+
echo "::remove-matcher owner=clang::"
6471
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
6572
if: always()
6673
with:
@@ -103,10 +110,17 @@ jobs:
103110
steps:
104111
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
105112
- name: ${{ matrix.config }}
106-
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
113+
run: |
114+
echo "::add-matcher::.github/libcxx-problem-matchers.json"
115+
libcxx/utils/ci/run-buildbot ${{ matrix.config }}
107116
env:
108117
CC: ${{ matrix.cc }}
109118
CXX: ${{ matrix.cxx }}
119+
- if: always()
120+
name: Disable Problem Matchers
121+
run: |
122+
echo "::remove-matcher owner=lit::"
123+
echo "::remove-matcher owner=clang::"
110124
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
111125
if: always() # Upload artifacts even if the build or test suite fails
112126
with:
@@ -167,10 +181,17 @@ jobs:
167181
steps:
168182
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
169183
- name: ${{ matrix.config }}
170-
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
184+
run: |
185+
echo "::add-matcher::.github/libcxx-problem-matchers.json"
186+
libcxx/utils/ci/run-buildbot ${{ matrix.config }}
171187
env:
172188
CC: clang-21
173189
CXX: clang++-21
190+
- if: always()
191+
name: Disable Problem Matchers
192+
run: |
193+
echo "::remove-matcher owner=lit::"
194+
echo "::remove-matcher owner=clang::"
174195
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
175196
if: always()
176197
with:
@@ -221,6 +242,7 @@ jobs:
221242
- uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
222243
- name: Build and test
223244
run: |
245+
echo "::add-matcher::.github/libcxx-problem-matchers.json"
224246
python3 -m venv .venv
225247
source .venv/bin/activate
226248
python -m pip install psutil

0 commit comments

Comments
 (0)