Skip to content

Commit e6bd4ae

Browse files
committed
address latest round of feedback
Created using spr 1.3.6-beta.1
2 parents 555b851 + 01a041b commit e6bd4ae

File tree

4,000 files changed

+237691
-86185
lines changed

Some content is hidden

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

4,000 files changed

+237691
-86185
lines changed

.ci/compute_projects.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"clang": {"compiler-rt"},
8181
"clang-tools-extra": {"libc"},
8282
"libc": {"libc"},
83+
"compiler-rt": {"compiler-rt"},
8384
".ci": {"compiler-rt", "libc"},
8485
}
8586
DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = {
@@ -100,6 +101,9 @@
100101
"libc", # No Windows Support.
101102
"lldb", # TODO(issues/132800): Needs environment setup.
102103
"bolt", # No Windows Support.
104+
"libcxx",
105+
"libcxxabi",
106+
"libunwind",
103107
}
104108

105109
# These are projects that we should test if the project itself is changed but
@@ -118,6 +122,9 @@
118122
"lldb",
119123
"openmp",
120124
"polly",
125+
"libcxx",
126+
"libcxxabi",
127+
"libunwind",
121128
}
122129

123130
PROJECT_CHECK_TARGETS = {

.ci/compute_projects_test.py

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ def test_llvm_windows(self):
4545
env_variables["project_check_targets"],
4646
"check-clang check-clang-tools check-lld check-llvm check-mlir check-polly",
4747
)
48-
self.assertEqual(
49-
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
50-
)
48+
self.assertEqual(env_variables["runtimes_to_build"], "")
5149
self.assertEqual(
5250
env_variables["runtimes_check_targets"],
5351
"",
5452
)
5553
self.assertEqual(
5654
env_variables["runtimes_check_targets_needs_reconfig"],
57-
"check-cxx check-cxxabi check-unwind",
55+
"",
5856
)
5957

6058
def test_llvm_mac(self):
@@ -69,16 +67,14 @@ def test_llvm_mac(self):
6967
env_variables["project_check_targets"],
7068
"check-clang check-clang-tools check-lld check-llvm check-mlir",
7169
)
72-
self.assertEqual(
73-
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
74-
)
70+
self.assertEqual(env_variables["runtimes_to_build"], "")
7571
self.assertEqual(
7672
env_variables["runtimes_check_targets"],
7773
"",
7874
)
7975
self.assertEqual(
8076
env_variables["runtimes_check_targets_needs_reconfig"],
81-
"check-cxx check-cxxabi check-unwind",
77+
"",
8278
)
8379

8480
def test_clang(self):
@@ -119,19 +115,43 @@ def test_clang_windows(self):
119115
self.assertEqual(
120116
env_variables["project_check_targets"], "check-clang check-clang-tools"
121117
)
122-
self.assertEqual(
123-
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
124-
)
118+
self.assertEqual(env_variables["runtimes_to_build"], "")
125119
self.assertEqual(
126120
env_variables["runtimes_check_targets"],
127121
"",
128122
)
129123
self.assertEqual(
130124
env_variables["runtimes_check_targets_needs_reconfig"],
131-
"check-cxx check-cxxabi check-unwind",
125+
"",
132126
)
133127
self.assertEqual(env_variables["enable_cir"], "OFF")
134128

129+
def test_compiler_rt(self):
130+
env_variables = compute_projects.get_env_variables(
131+
["compiler-rt/lib/asan/asan_allocator.cpp"], "Linux"
132+
)
133+
self.assertEqual(
134+
env_variables["projects_to_build"],
135+
"clang;lld",
136+
)
137+
self.assertEqual(
138+
env_variables["project_check_targets"],
139+
"",
140+
)
141+
self.assertEqual(env_variables["runtimes_to_build"], "compiler-rt")
142+
self.assertEqual(
143+
env_variables["runtimes_check_targets"],
144+
"check-compiler-rt",
145+
)
146+
self.assertEqual(
147+
env_variables["runtimes_check_targets_needs_reconfig"],
148+
"",
149+
)
150+
self.assertEqual(
151+
env_variables["enable_cir"],
152+
"OFF",
153+
)
154+
135155
def test_cir(self):
136156
env_variables = compute_projects.get_env_variables(
137157
["clang/lib/CIR/CMakeLists.txt"], "Linux"
@@ -284,6 +304,31 @@ def test_ci(self):
284304
"check-cxx check-cxxabi check-unwind",
285305
)
286306

307+
def test_windows_ci(self):
308+
env_variables = compute_projects.get_env_variables(
309+
[".ci/compute_projects.py"], "Windows"
310+
)
311+
self.assertEqual(
312+
env_variables["projects_to_build"],
313+
"clang;clang-tools-extra;libclc;lld;llvm;mlir;polly",
314+
)
315+
self.assertEqual(
316+
env_variables["project_check_targets"],
317+
"check-clang check-clang-cir check-clang-tools check-lld check-llvm check-mlir check-polly",
318+
)
319+
self.assertEqual(
320+
env_variables["runtimes_to_build"],
321+
"",
322+
)
323+
self.assertEqual(
324+
env_variables["runtimes_check_targets"],
325+
"",
326+
)
327+
self.assertEqual(
328+
env_variables["runtimes_check_targets_needs_reconfig"],
329+
"",
330+
)
331+
287332
def test_lldb(self):
288333
env_variables = compute_projects.get_env_variables(
289334
["lldb/CMakeLists.txt"], "Linux"

.ci/generate_test_report_github.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@
44
"""Script to generate a build report for Github."""
55

66
import argparse
7+
import platform
78

89
import generate_test_report_lib
910

11+
PLATFORM_TITLES = {
12+
"Windows": ":window: Windows x64 Test Results",
13+
"Linux": ":penguin: Linux x64 Test Results",
14+
}
15+
1016
if __name__ == "__main__":
1117
parser = argparse.ArgumentParser()
12-
parser.add_argument(
13-
"title", help="Title of the test report, without Markdown formatting."
14-
)
1518
parser.add_argument("return_code", help="The build's return code.", type=int)
1619
parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
1720
args = parser.parse_args()
1821

1922
report = generate_test_report_lib.generate_report_from_files(
20-
args.title, args.return_code, args.junit_files
23+
PLATFORM_TITLES[platform.system()], args.return_code, args.junit_files
2124
)
2225

2326
print(report)

.ci/monolithic-linux.sh

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,25 @@
1313
# run only the relevant tests.
1414
#
1515

16-
set -ex
17-
set -o pipefail
16+
source .ci/utils.sh
1817

19-
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
20-
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
2118
INSTALL_DIR="${BUILD_DIR}/install"
22-
rm -rf "${BUILD_DIR}"
23-
24-
sccache --zero-stats
2519

2620
mkdir -p artifacts/reproducers
2721

28-
# Make sure any clang reproducers will end up as artifacts.
22+
# Make sure any clang reproducers will end up as artifacts
2923
export CLANG_CRASH_DIAGNOSTICS_DIR=`realpath artifacts/reproducers`
3024

31-
function at-exit {
32-
retcode=$?
33-
34-
sccache --show-stats > artifacts/sccache_stats.txt
35-
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
36-
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
37-
38-
# If building fails there will be no results files.
39-
shopt -s nullglob
40-
41-
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":penguin: Linux x64 Test Results" \
42-
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
43-
}
44-
trap at-exit EXIT
45-
4625
projects="${1}"
4726
targets="${2}"
4827
runtimes="${3}"
4928
runtime_targets="${4}"
5029
runtime_targets_needs_reconfig="${5}"
5130
enable_cir="${6}"
5231

53-
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
32+
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests --succinct"
5433

55-
echo "::group::cmake"
34+
start-group "CMake"
5635
export PIP_BREAK_SYSTEM_PACKAGES=1
5736
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
5837

@@ -83,49 +62,39 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
8362
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
8463
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
8564

86-
echo "::endgroup::"
87-
echo "::group::ninja"
65+
start-group "ninja"
8866

8967
# Targets are not escaped as they are passed as separate arguments.
9068
ninja -C "${BUILD_DIR}" -k 0 ${targets}
9169

92-
echo "::endgroup::"
93-
9470
if [[ "${runtime_targets}" != "" ]]; then
95-
echo "::group::ninja runtimes"
71+
start-group "ninja Runtimes"
9672

9773
ninja -C "${BUILD_DIR}" ${runtime_targets}
98-
99-
echo "::endgroup::"
10074
fi
10175

10276
# Compiling runtimes with just-built Clang and running their tests
10377
# as an additional testing for Clang.
10478
if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
105-
echo "::group::cmake runtimes C++26"
79+
start-group "CMake Runtimes C++26"
10680

10781
cmake \
10882
-D LIBCXX_TEST_PARAMS="std=c++26" \
10983
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
11084
"${BUILD_DIR}"
11185

112-
echo "::endgroup::"
113-
echo "::group::ninja runtimes C++26"
86+
start-group "ninja Runtimes C++26"
11487

11588
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}
11689

117-
echo "::endgroup::"
118-
echo "::group::cmake runtimes clang modules"
90+
start-group "CMake Runtimes Clang Modules"
11991

12092
cmake \
12193
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
12294
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
12395
"${BUILD_DIR}"
12496

125-
echo "::endgroup::"
126-
echo "::group::ninja runtimes clang modules"
97+
start-group "ninja Runtimes Clang Modules"
12798

12899
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}
129-
130-
echo "::endgroup::"
131100
fi

.ci/monolithic-windows.sh

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,12 @@
1313
# run only the relevant tests.
1414
#
1515

16-
set -ex
17-
set -o pipefail
18-
19-
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
20-
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
21-
22-
rm -rf "${BUILD_DIR}"
23-
24-
sccache --zero-stats
25-
function at-exit {
26-
retcode=$?
27-
28-
mkdir -p artifacts
29-
sccache --show-stats >> artifacts/sccache_stats.txt
30-
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
31-
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
32-
33-
# If building fails there will be no results files.
34-
shopt -s nullglob
35-
36-
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":window: Windows x64 Test Results" \
37-
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
38-
}
39-
trap at-exit EXIT
16+
source .ci/utils.sh
4017

4118
projects="${1}"
4219
targets="${2}"
4320

44-
echo "::group::cmake"
21+
start-group "CMake"
4522
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
4623

4724
export CC=cl
@@ -62,7 +39,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6239
-D LLVM_ENABLE_ASSERTIONS=ON \
6340
-D LLVM_BUILD_EXAMPLES=ON \
6441
-D COMPILER_RT_BUILD_LIBFUZZER=OFF \
65-
-D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests" \
42+
-D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests --succinct" \
6643
-D COMPILER_RT_BUILD_ORC=OFF \
6744
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
6845
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
@@ -71,10 +48,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
7148
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
7249
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO"
7350

74-
echo "::endgroup::"
75-
echo "::group::ninja"
51+
start-group "ninja"
7652

7753
# Targets are not escaped as they are passed as separate arguments.
7854
ninja -C "${BUILD_DIR}" -k 0 ${targets}
79-
80-
echo "::endgroup"

.ci/utils.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
#===----------------------------------------------------------------------===##
3+
#
4+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+
# See https://llvm.org/LICENSE.txt for license information.
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
#
8+
#===----------------------------------------------------------------------===##
9+
10+
# This script performs some setup and contains some utilities used for in the
11+
# monolithic-linux.sh and monolithic-windows.sh scripts.
12+
13+
set -ex
14+
set -o pipefail
15+
16+
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
17+
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
18+
19+
rm -rf "${BUILD_DIR}"
20+
21+
sccache --zero-stats
22+
23+
function at-exit {
24+
retcode=$?
25+
26+
mkdir -p artifacts
27+
sccache --show-stats >> artifacts/sccache_stats.txt
28+
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
29+
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
30+
31+
# If building fails there will be no results files.
32+
shopt -s nullglob
33+
34+
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
35+
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
36+
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
37+
fi
38+
}
39+
trap at-exit EXIT
40+
41+
function start-group {
42+
groupname=$1
43+
if [[ "$GITHUB_ACTIONS" != "" ]]; then
44+
echo "::endgroup"
45+
echo "::group::$groupname"
46+
elif [[ "$POSTCOMMIT_CI" != "" ]]; then
47+
echo "@@@$STEP@@@"
48+
else
49+
echo "Starting $groupname"
50+
fi
51+
}

0 commit comments

Comments
 (0)