Skip to content

Commit 8d5878d

Browse files
Merge branch 'main' into spv_intel_arbitrary_floating_points
2 parents 65fa8e5 + eab4460 commit 8d5878d

File tree

14,908 files changed

+1336704
-398670
lines changed

Some content is hidden

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

14,908 files changed

+1336704
-398670
lines changed

.ci/cache_lit_timing_files.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import glob
1818

1919
from google.cloud import storage
20+
from google.api_core import exceptions
2021

2122
GCS_PARALLELISM = 100
2223

@@ -50,7 +51,14 @@ def _maybe_download_timing_file(blob):
5051

5152
def download_timing_files(storage_client, bucket_name: str):
5253
bucket = storage_client.bucket(bucket_name)
53-
blobs = bucket.list_blobs(prefix="lit_timing")
54+
try:
55+
blobs = bucket.list_blobs(prefix="lit_timing")
56+
except exceptions.ClientError as client_error:
57+
print(
58+
"::warning file=cache_lit_timing_files.py::Failed to list blobs "
59+
"in bucket."
60+
)
61+
sys.exit(0)
5462
with multiprocessing.pool.ThreadPool(GCS_PARALLELISM) as thread_pool:
5563
futures = []
5664
for timing_file_blob in blobs:
@@ -60,7 +68,13 @@ def download_timing_files(storage_client, bucket_name: str):
6068
)
6169
)
6270
for future in futures:
63-
future.get()
71+
future.wait()
72+
if not future.successful():
73+
print(
74+
"::warning file=cache_lit_timing_files.py::Failed to "
75+
"download lit timing file."
76+
)
77+
continue
6478
print("Done downloading")
6579

6680

.ci/generate_test_report_github.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@
88

99
import generate_test_report_lib
1010

11-
PLATFORM_TITLES = {
12-
"Windows": ":window: Windows x64 Test Results",
13-
"Linux": ":penguin: Linux x64 Test Results",
14-
}
11+
12+
def compute_platform_title() -> str:
13+
logo = ":window:" if platform.system() == "Windows" else ":penguin:"
14+
# On Linux the machine value is x86_64 on Windows it is AMD64.
15+
if platform.machine() == "x86_64" or platform.machine() == "AMD64":
16+
arch = "x64"
17+
else:
18+
arch = platform.machine()
19+
return f"{logo} {platform.system()} {arch} Test Results"
20+
1521

1622
if __name__ == "__main__":
1723
parser = argparse.ArgumentParser()
@@ -22,7 +28,7 @@
2228
args = parser.parse_args()
2329

2430
report = generate_test_report_lib.generate_report_from_files(
25-
PLATFORM_TITLES[platform.system()], args.return_code, args.build_test_logs
31+
compute_platform_title(), args.return_code, args.build_test_logs
2632
)
2733

2834
print(report)

.ci/generate_test_report_lib.py

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ def _parse_ninja_log(ninja_log: list[str]) -> list[tuple[str, str]]:
4141
# touch test/4.stamp
4242
#
4343
# index will point to the line that starts with Failed:. The progress
44-
# indicator is the line before this ([4/5] test/4.stamp) and contains a pretty
45-
# printed version of the target being built (test/4.stamp). We use this line
46-
# and remove the progress information to get a succinct name for the target.
47-
failing_action = ninja_log[index - 1].split("] ")[1]
44+
# indicator is sometimes the line before this ([4/5] test/4.stamp) and
45+
# will contain a pretty printed version of the target being built
46+
# (test/4.stamp) when accurate. We instead parse the failed line rather
47+
# than the progress indicator as the progress indicator may not be
48+
# aligned with the failure.
49+
failing_action = ninja_log[index].split("FAILED: ")[1]
4850
failure_log = []
4951
while (
5052
index < len(ninja_log)
@@ -99,6 +101,24 @@ def _format_ninja_failures(ninja_failures: list[tuple[str, str]]) -> list[str]:
99101
return output
100102

101103

104+
def get_failures(junit_objects) -> dict[str, list[tuple[str, str]]]:
105+
failures = {}
106+
for results in junit_objects:
107+
for testsuite in results:
108+
for test in testsuite:
109+
if (
110+
not test.is_passed
111+
and test.result
112+
and isinstance(test.result[0], Failure)
113+
):
114+
if failures.get(testsuite.name) is None:
115+
failures[testsuite.name] = []
116+
failures[testsuite.name].append(
117+
(test.classname + "/" + test.name, test.result[0].text)
118+
)
119+
return failures
120+
121+
102122
# Set size_limit to limit the byte size of the report. The default is 1MB as this
103123
# is the most that can be put into an annotation. If the generated report exceeds
104124
# this limit and failures are listed, it will be generated again without failures
@@ -113,7 +133,7 @@ def generate_report(
113133
size_limit=1024 * 1024,
114134
list_failures=True,
115135
):
116-
failures = {}
136+
failures = get_failures(junit_objects)
117137
tests_run = 0
118138
tests_skipped = 0
119139
tests_failed = 0
@@ -124,18 +144,6 @@ def generate_report(
124144
tests_skipped += testsuite.skipped
125145
tests_failed += testsuite.failures
126146

127-
for test in testsuite:
128-
if (
129-
not test.is_passed
130-
and test.result
131-
and isinstance(test.result[0], Failure)
132-
):
133-
if failures.get(testsuite.name) is None:
134-
failures[testsuite.name] = []
135-
failures[testsuite.name].append(
136-
(test.classname + "/" + test.name, test.result[0].text)
137-
)
138-
139147
report = [f"# {title}", ""]
140148

141149
if tests_run == 0:
@@ -258,7 +266,7 @@ def plural(num_tests):
258266
return report
259267

260268

261-
def generate_report_from_files(title, return_code, build_log_files):
269+
def load_info_from_files(build_log_files):
262270
junit_files = [
263271
junit_file for junit_file in build_log_files if junit_file.endswith(".xml")
264272
]
@@ -271,6 +279,9 @@ def generate_report_from_files(title, return_code, build_log_files):
271279
ninja_logs.append(
272280
[log_line.strip() for log_line in ninja_log_file_handle.readlines()]
273281
)
274-
return generate_report(
275-
title, return_code, [JUnitXml.fromfile(p) for p in junit_files], ninja_logs
276-
)
282+
return [JUnitXml.fromfile(p) for p in junit_files], ninja_logs
283+
284+
285+
def generate_report_from_files(title, return_code, build_log_files):
286+
junit_objects, ninja_logs = load_info_from_files(build_log_files)
287+
return generate_report(title, return_code, junit_objects, ninja_logs)

.ci/generate_test_report_lib_test.py

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_find_failure_ninja_logs(self):
3939
self.assertEqual(
4040
failures[0],
4141
(
42-
"test/4.stamp",
42+
"touch test/4.stamp",
4343
dedent(
4444
"""\
4545
FAILED: touch test/4.stamp
@@ -77,7 +77,7 @@ def test_ninja_log_end(self):
7777
self.assertEqual(
7878
failures[0],
7979
(
80-
"test/3.stamp",
80+
"touch test/3.stamp",
8181
dedent(
8282
"""\
8383
FAILED: touch test/3.stamp
@@ -106,7 +106,7 @@ def test_ninja_log_multiple_failures(self):
106106
self.assertEqual(
107107
failures[0],
108108
(
109-
"test/2.stamp",
109+
"touch test/2.stamp",
110110
dedent(
111111
"""\
112112
FAILED: touch test/2.stamp
@@ -117,7 +117,7 @@ def test_ninja_log_multiple_failures(self):
117117
self.assertEqual(
118118
failures[1],
119119
(
120-
"test/4.stamp",
120+
"touch test/4.stamp",
121121
dedent(
122122
"""\
123123
FAILED: touch test/4.stamp
@@ -150,7 +150,7 @@ def test_ninja_log_runtimes_failure(self):
150150
self.assertEqual(
151151
failures[0],
152152
(
153-
"test/2.stamp",
153+
"touch test/2.stamp",
154154
dedent(
155155
"""\
156156
FAILED: touch test/2.stamp
@@ -159,6 +159,34 @@ def test_ninja_log_runtimes_failure(self):
159159
),
160160
)
161161

162+
# Test that we correctly handle cases where the FAILED: line does not
163+
# match up with the progress indicator.
164+
def test_ninja_log_mismatched_failed(self):
165+
failures = generate_test_report_lib.find_failure_in_ninja_logs(
166+
[
167+
[
168+
"[1/5] test/1.stamp",
169+
"[2/5] test/2.stamp",
170+
"ModuleNotFoundError: No module named 'mount_langley'",
171+
"FAILED: tools/check-langley",
172+
"Wow! This system is really broken!",
173+
"[5/5] test/5.stamp",
174+
]
175+
]
176+
)
177+
self.assertEqual(len(failures), 1)
178+
self.assertEqual(
179+
failures[0],
180+
(
181+
"tools/check-langley",
182+
dedent(
183+
"""\
184+
FAILED: tools/check-langley
185+
Wow! This system is really broken!"""
186+
),
187+
),
188+
)
189+
162190
def test_title_only(self):
163191
self.assertEqual(
164192
generate_test_report_lib.generate_report("Foo", 0, [], []),
@@ -407,7 +435,6 @@ def test_no_failures_multiple_build_failed_ninja_log(self):
407435
]
408436
],
409437
)
410-
print(test)
411438
self.assertEqual(
412439
generate_test_report_lib.generate_report(
413440
"Foo",
@@ -449,15 +476,15 @@ def test_no_failures_multiple_build_failed_ninja_log(self):
449476
All tests passed but another part of the build **failed**. Click on a failure below to see the details.
450477
451478
<details>
452-
<summary>test/2.stamp</summary>
479+
<summary>touch test/2.stamp</summary>
453480
454481
```
455482
FAILED: touch test/2.stamp
456483
Wow! Be Kind!
457484
```
458485
</details>
459486
<details>
460-
<summary>test/4.stamp</summary>
487+
<summary>touch test/4.stamp</summary>
461488
462489
```
463490
FAILED: touch test/4.stamp

.ci/metrics/metrics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
GITHUB_JOB_TO_TRACK = {
4141
"github_llvm_premerge_checks": {
4242
"Build and Test Linux": "premerge_linux",
43+
"Build and Test Linux AArch64": "premerge_linux_aarch64",
4344
"Build and Test Windows": "premerge_windows",
4445
},
4546
"github_libcxx_premerge_checks": {

.ci/monolithic-linux.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ enable_cir="${6}"
3232
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests --succinct"
3333

3434
start-group "CMake"
35-
export PIP_BREAK_SYSTEM_PACKAGES=1
36-
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
3735

3836
# Set the system llvm-symbolizer as preferred.
3937
export LLVM_SYMBOLIZER_PATH=`which llvm-symbolizer`
@@ -68,11 +66,13 @@ start-group "ninja"
6866

6967
# Targets are not escaped as they are passed as separate arguments.
7068
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
69+
cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
7170

7271
if [[ "${runtime_targets}" != "" ]]; then
7372
start-group "ninja Runtimes"
7473

7574
ninja -C "${BUILD_DIR}" ${runtime_targets} |& tee ninja_runtimes.log
75+
cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
7676
fi
7777

7878
# Compiling runtimes with just-built Clang and running their tests
@@ -89,6 +89,7 @@ if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
8989

9090
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
9191
|& tee ninja_runtimes_needs_reconfig1.log
92+
cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconig.ninja_log
9293

9394
start-group "CMake Runtimes Clang Modules"
9495

@@ -101,4 +102,5 @@ if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
101102

102103
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
103104
|& tee ninja_runtimes_needs_reconfig2.log
105+
cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconfig2.ninja_log
104106
fi

.ci/monolithic-windows.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ runtimes_targets="${4}"
2323
start-group "CMake"
2424
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
2525

26-
export CC=cl
27-
export CXX=cl
26+
export CC=C:/clang/clang-msvc/bin/clang-cl.exe
27+
export CXX=C:/clang/clang-msvc/bin/clang-cl.exe
2828
export LD=link
2929

3030
# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
@@ -49,15 +49,18 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4949
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
5050
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
5151
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
52+
-D CMAKE_CXX_FLAGS="-Wno-c++98-compat -Wno-c++14-compat -Wno-unsafe-buffer-usage -Wno-old-style-cast" \
5253
-D LLVM_ENABLE_RUNTIMES="${runtimes}"
5354

5455
start-group "ninja"
5556

5657
# Targets are not escaped as they are passed as separate arguments.
5758
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
59+
cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
5860

5961
if [[ "${runtime_targets}" != "" ]]; then
6062
start-group "ninja runtimes"
6163

6264
ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log
65+
cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
6366
fi

0 commit comments

Comments
 (0)