Skip to content

Commit 51f87d5

Browse files
authored
Merge branch 'main' into hxie/constexpr_flat_multimap
2 parents 001b381 + 31e6fe7 commit 51f87d5

File tree

3,390 files changed

+268454
-129106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,390 files changed

+268454
-129106
lines changed

.ci/generate_test_report_github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
1717
args = parser.parse_args()
1818

19-
report, _ = generate_test_report_lib.generate_report_from_files(
20-
args.title, args.return_code, args.junit_files, None
19+
report = generate_test_report_lib.generate_report_from_files(
20+
args.title, args.return_code, args.junit_files
2121
)
2222

2323
print(report)

.ci/generate_test_report_lib.py

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55

66
from junitparser import JUnitXml, Failure
77

8+
SEE_BUILD_FILE_STR = "Download the build's log file to see the details."
9+
UNRELATED_FAILURES_STR = (
10+
"If these failures are unrelated to your changes (for example "
11+
"tests are broken or flaky at HEAD), please open an issue at "
12+
"https://github.com/llvm/llvm-project/issues and add the "
13+
"`infrastructure` label."
14+
)
15+
816

917
# Set size_limit to limit the byte size of the report. The default is 1MB as this
1018
# is the most that can be put into an annotation. If the generated report exceeds
@@ -18,16 +26,7 @@ def generate_report(
1826
junit_objects,
1927
size_limit=1024 * 1024,
2028
list_failures=True,
21-
buildkite_info=None,
2229
):
23-
if not junit_objects:
24-
# Note that we do not post an empty report, therefore we can ignore a
25-
# non-zero return code in situations like this.
26-
#
27-
# If we were going to post a report, then yes, it would be misleading
28-
# to say we succeeded when the final return code was non-zero.
29-
return ("", "success")
30-
3130
failures = {}
3231
tests_run = 0
3332
tests_skipped = 0
@@ -51,16 +50,28 @@ def generate_report(
5150
(test.classname + "/" + test.name, test.result[0].text)
5251
)
5352

54-
if not tests_run:
55-
return ("", None)
56-
57-
style = "success"
58-
# Either tests failed, or all tests passed but something failed to build.
59-
if tests_failed or return_code != 0:
60-
style = "error"
61-
6253
report = [f"# {title}", ""]
6354

55+
if tests_run == 0:
56+
if return_code == 0:
57+
report.extend(
58+
[
59+
"The build succeeded and no tests ran. This is expected in some "
60+
"build configurations."
61+
]
62+
)
63+
else:
64+
report.extend(
65+
[
66+
"The build failed before running any tests.",
67+
"",
68+
SEE_BUILD_FILE_STR,
69+
"",
70+
UNRELATED_FAILURES_STR,
71+
]
72+
)
73+
return "\n".join(report)
74+
6475
tests_passed = tests_run - tests_skipped - tests_failed
6576

6677
def plural(num_tests):
@@ -73,22 +84,12 @@ def plural(num_tests):
7384
if tests_failed:
7485
report.append(f"* {tests_failed} {plural(tests_failed)} failed")
7586

76-
if buildkite_info is not None:
77-
log_url = (
78-
"https://buildkite.com/organizations/{BUILDKITE_ORGANIZATION_SLUG}/"
79-
"pipelines/{BUILDKITE_PIPELINE_SLUG}/builds/{BUILDKITE_BUILD_NUMBER}/"
80-
"jobs/{BUILDKITE_JOB_ID}/download.txt".format(**buildkite_info)
81-
)
82-
download_text = f"[Download]({log_url})"
83-
else:
84-
download_text = "Download"
85-
8687
if not list_failures:
8788
report.extend(
8889
[
8990
"",
9091
"Failed tests and their output was too large to report. "
91-
f"{download_text} the build's log file to see the details.",
92+
+ SEE_BUILD_FILE_STR,
9293
]
9394
)
9495
elif failures:
@@ -118,20 +119,12 @@ def plural(num_tests):
118119
"",
119120
"All tests passed but another part of the build **failed**.",
120121
"",
121-
f"{download_text} the build's log file to see the details.",
122+
SEE_BUILD_FILE_STR,
122123
]
123124
)
124125

125126
if failures or return_code != 0:
126-
report.extend(
127-
[
128-
"",
129-
"If these failures are unrelated to your changes (for example "
130-
"tests are broken or flaky at HEAD), please open an issue at "
131-
"https://github.com/llvm/llvm-project/issues and add the "
132-
"`infrastructure` label.",
133-
]
134-
)
127+
report.extend(["", UNRELATED_FAILURES_STR])
135128

136129
report = "\n".join(report)
137130
if len(report.encode("utf-8")) > size_limit:
@@ -141,16 +134,14 @@ def plural(num_tests):
141134
junit_objects,
142135
size_limit,
143136
list_failures=False,
144-
buildkite_info=buildkite_info,
145137
)
146138

147-
return report, style
139+
return report
148140

149141

150-
def generate_report_from_files(title, return_code, junit_files, buildkite_info):
142+
def generate_report_from_files(title, return_code, junit_files):
151143
return generate_report(
152144
title,
153145
return_code,
154146
[JUnitXml.fromfile(p) for p in junit_files],
155-
buildkite_info=buildkite_info,
156147
)

.ci/generate_test_report_lib_test.py

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,28 @@ def junit_from_xml(xml):
2121
class TestReports(unittest.TestCase):
2222
def test_title_only(self):
2323
self.assertEqual(
24-
generate_test_report_lib.generate_report("Foo", 0, []), ("", "success")
24+
generate_test_report_lib.generate_report("Foo", 0, []),
25+
dedent(
26+
"""\
27+
# Foo
28+
29+
The build succeeded and no tests ran. This is expected in some build configurations."""
30+
),
31+
)
32+
33+
def test_title_only_failure(self):
34+
self.assertEqual(
35+
generate_test_report_lib.generate_report("Foo", 1, []),
36+
dedent(
37+
"""\
38+
# Foo
39+
40+
The build failed before running any tests.
41+
42+
Download the build's log file to see the details.
43+
44+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
45+
),
2546
)
2647

2748
def test_no_tests_in_testsuite(self):
@@ -42,7 +63,16 @@ def test_no_tests_in_testsuite(self):
4263
)
4364
],
4465
),
45-
("", None),
66+
dedent(
67+
"""\
68+
# Foo
69+
70+
The build failed before running any tests.
71+
72+
Download the build's log file to see the details.
73+
74+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
75+
),
4676
)
4777

4878
def test_no_failures(self):
@@ -70,8 +100,7 @@ def test_no_failures(self):
70100
# Foo
71101
72102
* 1 test passed"""
73-
),
74-
"success",
103+
)
75104
),
76105
)
77106

@@ -93,12 +122,6 @@ def test_no_failures_build_failed(self):
93122
)
94123
)
95124
],
96-
buildkite_info={
97-
"BUILDKITE_ORGANIZATION_SLUG": "organization_slug",
98-
"BUILDKITE_PIPELINE_SLUG": "pipeline_slug",
99-
"BUILDKITE_BUILD_NUMBER": "build_number",
100-
"BUILDKITE_JOB_ID": "job_id",
101-
},
102125
),
103126
(
104127
dedent(
@@ -109,11 +132,10 @@ def test_no_failures_build_failed(self):
109132
110133
All tests passed but another part of the build **failed**.
111134
112-
[Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.
135+
Download the build's log file to see the details.
113136
114137
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
115-
),
116-
"error",
138+
)
117139
),
118140
)
119141

@@ -174,14 +196,12 @@ def test_report_single_file_single_testsuite(self):
174196
</details>
175197
176198
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
177-
),
178-
"error",
199+
)
179200
),
180201
)
181202

182-
MULTI_SUITE_OUTPUT = (
183-
dedent(
184-
"""\
203+
MULTI_SUITE_OUTPUT = dedent(
204+
"""\
185205
# ABC and DEF
186206
187207
* 1 test passed
@@ -210,8 +230,6 @@ def test_report_single_file_single_testsuite(self):
210230
</details>
211231
212232
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
213-
),
214-
"error",
215233
)
216234

217235
def test_report_single_file_multiple_testsuites(self):
@@ -320,8 +338,7 @@ def test_report_dont_list_failures(self):
320338
Failed tests and their output was too large to report. Download the build's log file to see the details.
321339
322340
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
323-
),
324-
"error",
341+
)
325342
),
326343
)
327344

@@ -346,12 +363,6 @@ def test_report_dont_list_failures_link_to_log(self):
346363
)
347364
],
348365
list_failures=False,
349-
buildkite_info={
350-
"BUILDKITE_ORGANIZATION_SLUG": "organization_slug",
351-
"BUILDKITE_PIPELINE_SLUG": "pipeline_slug",
352-
"BUILDKITE_BUILD_NUMBER": "build_number",
353-
"BUILDKITE_JOB_ID": "job_id",
354-
},
355366
),
356367
(
357368
dedent(
@@ -360,11 +371,10 @@ def test_report_dont_list_failures_link_to_log(self):
360371
361372
* 1 test failed
362373
363-
Failed tests and their output was too large to report. [Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.
374+
Failed tests and their output was too large to report. Download the build's log file to see the details.
364375
365376
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
366-
),
367-
"error",
377+
)
368378
),
369379
)
370380

@@ -403,7 +413,6 @@ def test_report_size_limit(self):
403413
Failed tests and their output was too large to report. Download the build's log file to see the details.
404414
405415
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
406-
),
407-
"error",
416+
)
408417
),
409418
)

.clang-tidy

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-const-correctness,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-misc-no-recursion,-misc-use-anonymous-namespace,readability-identifier-naming,-misc-include-cleaner'
1+
Checks: >
2+
-*,
3+
clang-diagnostic-*,
4+
llvm-*,
5+
misc-*,
6+
-misc-const-correctness,
7+
-misc-include-cleaner,
8+
-misc-no-recursion,
9+
-misc-non-private-member-variables-in-classes,
10+
-misc-unused-parameters,
11+
-misc-use-anonymous-namespace,
12+
readability-identifier-naming
13+
214
CheckOptions:
315
- key: readability-identifier-naming.ClassCase
416
value: CamelCase

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
/clang/www/cxx_dr_status.html @Endilll
3232
/clang/www/make_cxx_dr_status @Endilll
3333

34-
/clang/include/clang/CIR @lanza @bcardosolopes
35-
/clang/lib/CIR @lanza @bcardosolopes
36-
/clang/tools/cir-* @lanza @bcardosolopes
34+
/clang/include/clang/CIR @lanza @bcardosolopes @xlauko @andykaylor
35+
/clang/lib/CIR @lanza @bcardosolopes @xlauko @andykaylor
36+
/clang/tools/cir-* @lanza @bcardosolopes @xlauko @andykaylor
3737

3838
/lldb/ @JDevlieghere
3939

.github/new-prs-labeler.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -784,18 +784,20 @@ backend:NVPTX:
784784
backend:MIPS:
785785
- '**/*mips*'
786786
- '**/*Mips*'
787+
- '**/*mips*/**'
788+
- '**/*Mips*/**'
787789

788790
backend:RISC-V:
789-
- clang/**/*riscv*
790-
- clang/**/*RISCV*
791-
- llvm/**/*riscv*
792-
- llvm/**/*RISCV*
791+
- '**/*riscv*'
792+
- '**/*RISCV*'
793+
- '**/*riscv*/**'
794+
- '**/*RISCV*/**'
793795

794796
backend:Xtensa:
795-
- clang/**/*xtensa*
796-
- clang/**/*Xtensa*
797-
- llvm/**/*xtensa*
798-
- llvm/**/*Xtensa*
797+
- '**/*xtensa*'
798+
- '**/*Xtensa*'
799+
- '**/*xtensa*/**'
800+
- '**/*Xtensa*/**'
799801

800802
lld:coff:
801803
- lld/**/COFF/**

.github/workflows/build-ci-container-windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
jobs:
2121
build-ci-container-windows:
2222
if: github.repository_owner == 'llvm'
23-
runs-on: windows-2019
23+
runs-on: windows-2022
2424
outputs:
2525
container-name: ${{ steps.vars.outputs.container-name }}
2626
container-name-tag: ${{ steps.vars.outputs.container-name-tag }}
@@ -34,7 +34,7 @@ jobs:
3434
id: vars
3535
run: |
3636
$tag = [int64](Get-Date -UFormat %s)
37-
$container_name="ghcr.io/$env:GITHUB_REPOSITORY_OWNER/ci-windows-2019"
37+
$container_name="ghcr.io/$env:GITHUB_REPOSITORY_OWNER/ci-windows-2022"
3838
echo "container-name=${container_name}" >> $env:GITHUB_OUTPUT
3939
echo "container-name-tag=${container_name}:${tag}" >> $env:GITHUB_OUTPUT
4040
echo "container-filename=ci-windows-${tag}.tar" >> $env:GITHUB_OUTPUT
@@ -58,7 +58,7 @@ jobs:
5858
- build-ci-container-windows
5959
permissions:
6060
packages: write
61-
runs-on: windows-2019
61+
runs-on: windows-2022
6262
env:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6464
steps:

0 commit comments

Comments
 (0)