Skip to content

Commit 561990c

Browse files
committed
Rebase & update
Created using spr 1.3.5
2 parents d942a7f + 31c6f5a commit 561990c

File tree

5,667 files changed

+419923
-210871
lines changed

Some content is hidden

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

5,667 files changed

+419923
-210871
lines changed

.ci/compute_projects.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
"clang": {"clang-tools-extra", "compiler-rt", "cross-project-tests"},
5353
"clang-tools-extra": {"libc"},
5454
"mlir": {"flang"},
55+
# Test everything if ci scripts are changed.
56+
# FIXME: Figure out what is missing and add here.
57+
".ci": {"llvm", "clang", "lld", "lldb"},
5558
}
5659

5760
DEPENDENT_RUNTIMES_TO_TEST = {"clang": {"libcxx", "libcxxabi", "libunwind"}}
@@ -130,12 +133,11 @@ def _add_dependencies(projects: Set[str]) -> Set[str]:
130133
def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set[str]:
131134
projects_to_test = set()
132135
for modified_project in modified_projects:
133-
# Skip all projects where we cannot run tests.
134-
if modified_project not in PROJECT_CHECK_TARGETS:
135-
continue
136136
if modified_project in RUNTIMES:
137137
continue
138-
projects_to_test.add(modified_project)
138+
# Skip all projects where we cannot run tests.
139+
if modified_project in PROJECT_CHECK_TARGETS:
140+
projects_to_test.add(modified_project)
139141
if modified_project not in DEPENDENTS_TO_TEST:
140142
continue
141143
for dependent_project in DEPENDENTS_TO_TEST[modified_project]:

.ci/compute_projects_test.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,19 @@ def test_exclude_gn(self):
188188
self.assertEqual(env_variables["runtimes_to_build"], "")
189189
self.assertEqual(env_variables["runtimes_check_targets"], "")
190190

191+
def test_ci(self):
192+
env_variables = compute_projects.get_env_variables(
193+
[".ci/compute_projects.py"], "Linux"
194+
)
195+
self.assertEqual(env_variables["projects_to_build"],
196+
"clang;lld;llvm;lldb")
197+
self.assertEqual(env_variables["project_check_targets"], "check-clang
198+
check-lld check-llvm check-lldb")
199+
self.assertEqual(env_variables["runtimes_to_build"],
200+
"libcxx;libcxxabi;libunwind")
201+
self.assertEqual(env_variables["runtimes_check_targets"], "check-cxx
202+
check-cxxabi check-unwind")
203+
191204

192205
if __name__ == "__main__":
193206
unittest.main()

.ci/generate_test_report_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def plural(num_tests):
9292
]
9393
)
9494
elif failures:
95-
report.extend(["", "## Failed Tests", "(click to see output)"])
95+
report.extend(["", "## Failed Tests", "(click on a test name to see its output)"])
9696

9797
for testsuite_name, failures in failures.items():
9898
report.extend(["", f"### {testsuite_name}"])

.ci/generate_test_report_lib_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# See https://llvm.org/LICENSE.txt for license information.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5+
# To run these tests:
6+
# python -m unittest generate_test_report_lib_test.py
7+
58
import unittest
69
from io import StringIO
710
from textwrap import dedent
@@ -150,7 +153,7 @@ def test_report_single_file_single_testsuite(self):
150153
* 2 tests failed
151154
152155
## Failed Tests
153-
(click to see output)
156+
(click on a test name to see its output)
154157
155158
### Bar
156159
<details>
@@ -182,7 +185,7 @@ def test_report_single_file_single_testsuite(self):
182185
* 2 tests failed
183186
184187
## Failed Tests
185-
(click to see output)
188+
(click on a test name to see its output)
186189
187190
### ABC
188191
<details>

.ci/metrics/metrics.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,13 @@ def github_get_metrics(
282282
queued_count = collections.Counter()
283283
running_count = collections.Counter()
284284

285+
# Initialize all the counters to 0 so we report 0 when no job is queued
286+
# or running.
287+
for wf_name, wf_metric_name in GITHUB_WORKFLOW_TO_TRACK.items():
288+
for job_name, job_metric_name in GITHUB_JOB_TO_TRACK[wf_metric_name].items():
289+
queued_count[wf_metric_name + "_" + job_metric_name] = 0
290+
running_count[wf_metric_name + "_" + job_metric_name] = 0
291+
285292
# The list of workflows this iteration will process.
286293
# MaxSize = GITHUB_WORKFLOWS_MAX_PROCESS_COUNT
287294
workflow_seen_as_completed = set()

.ci/monolithic-linux.sh

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ set -o pipefail
1818

1919
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
2020
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
21-
INSTALL_DIR="${BUILD_DIR}/install"
2221
rm -rf "${BUILD_DIR}"
2322

2423
ccache --zero-stats
@@ -28,11 +27,16 @@ if [[ -n "${CLEAR_CACHE:-}" ]]; then
2827
ccache --clear
2928
fi
3029

30+
mkdir -p artifacts/reproducers
31+
32+
# Make sure any clang reproducers will end up as artifacts.
33+
export CLANG_CRASH_DIAGNOSTICS_DIR=`realpath artifacts/reproducers`
34+
3135
function at-exit {
3236
retcode=$?
3337

34-
mkdir -p artifacts
3538
ccache --print-stats > artifacts/ccache_stats.txt
39+
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
3640

3741
# If building fails there will be no results files.
3842
shopt -s nullglob
@@ -49,16 +53,28 @@ trap at-exit EXIT
4953

5054
projects="${1}"
5155
targets="${2}"
56+
runtimes="${3}"
5257

5358
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
5459

5560
echo "--- cmake"
61+
62+
export PIP_BREAK_SYSTEM_PACKAGES=1
5663
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
5764
pip install -q -r "${MONOREPO_ROOT}"/lldb/test/requirements.txt
5865
pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt
66+
67+
# Set the system llvm-symbolizer as preferred.
68+
export LLVM_SYMBOLIZER_PATH=`which llvm-symbolizer`
69+
[[ ! -f "${LLVM_SYMBOLIZER_PATH}" ]] && echo "llvm-symbolizer not found!"
70+
71+
# Set up all runtimes either way. libcxx is a dependency of LLDB.
72+
# If it ends up being unused, not much harm.
5973
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6074
-D LLVM_ENABLE_PROJECTS="${projects}" \
75+
-D LLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
6176
-G Ninja \
77+
-D CMAKE_PREFIX_PATH="${HOME}/.local" \
6278
-D CMAKE_BUILD_TYPE=Release \
6379
-D LLVM_ENABLE_ASSERTIONS=ON \
6480
-D LLVM_BUILD_EXAMPLES=ON \
@@ -67,69 +83,47 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6783
-D LLVM_ENABLE_LLD=ON \
6884
-D CMAKE_CXX_FLAGS=-gmlt \
6985
-D LLVM_CCACHE_BUILD=ON \
86+
-D LIBCXX_CXX_ABI=libcxxabi \
7087
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
71-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
88+
-D LLDB_ENABLE_PYTHON=ON \
89+
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON
7290

7391
echo "--- ninja"
92+
7493
# Targets are not escaped as they are passed as separate arguments.
7594
ninja -C "${BUILD_DIR}" -k 0 ${targets}
7695

77-
runtimes="${3}"
7896
runtime_targets="${4}"
7997

80-
# Compiling runtimes with just-built Clang and running their tests
81-
# as an additional testing for Clang.
98+
# Run runtimes tests.
99+
# We don't need to do a clean separate build of runtimes, because runtimes
100+
# will be built against just built clang, and because LIBCXX_TEST_PARAMS
101+
# and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully
102+
# propagates without a clean build. Other that those two variables, builds
103+
# are supposed to be the same.
82104
if [[ "${runtimes}" != "" ]]; then
83105
if [[ "${runtime_targets}" == "" ]]; then
84106
echo "Runtimes to build are specified, but targets are not."
85107
exit 1
86108
fi
87109

88-
echo "--- ninja install-clang"
89-
90-
ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers
91-
92-
RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes"
93-
INSTALL_DIR="${BUILD_DIR}/install"
94-
mkdir -p ${RUNTIMES_BUILD_DIR}
95-
96110
echo "--- cmake runtimes C++26"
97111

98-
rm -rf "${RUNTIMES_BUILD_DIR}"
99-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
100-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
101-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
102-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
103-
-D LIBCXX_CXX_ABI=libcxxabi \
104-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
105-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
112+
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
106113
-D LIBCXX_TEST_PARAMS="std=c++26" \
107-
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
108-
-D LLVM_LIT_ARGS="${lit_args}"
114+
-D LIBCXXABI_TEST_PARAMS="std=c++26"
109115

110116
echo "--- ninja runtimes C++26"
111117

112-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
118+
ninja -vC "${BUILD_DIR}" ${runtime_targets}
113119

114120
echo "--- cmake runtimes clang modules"
115121

116-
# We don't need to do a clean build of runtimes, because LIBCXX_TEST_PARAMS
117-
# and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully
118-
# propagates without a clean build. Other that those two variables, builds
119-
# are supposed to be the same.
120-
121-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
122-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
123-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
124-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
125-
-D LIBCXX_CXX_ABI=libcxxabi \
126-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
127-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
122+
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
128123
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
129-
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
130-
-D LLVM_LIT_ARGS="${lit_args}"
124+
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang"
131125

132126
echo "--- ninja runtimes clang modules"
133127

134-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
128+
ninja -vC "${BUILD_DIR}" ${runtime_targets}
135129
fi

.ci/monolithic-windows.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function at-exit {
3232

3333
mkdir -p artifacts
3434
sccache --show-stats >> artifacts/sccache_stats.txt
35+
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
3536

3637
# If building fails there will be no results files.
3738
shopt -s nullglob

.github/new-prs-labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,12 @@ backend:DirectX:
660660
- '**/*dxil*/**'
661661
- '**/*DXContainer*'
662662
- '**/*DXContainer*/**'
663+
- clang/lib/Sema/SemaDirectX.cpp
664+
- clang/include/clang/Sema/SemaDirectX.h
665+
- clang/include/clang/Basic/BuiltinsDirectX.td
666+
- clang/lib/CodeGen/TargetBuiltins/DirectX.cpp
667+
- clang/test/CodeGenDirectX/**
668+
- clang/test/SemaDirectX/**
663669

664670
backend:SPIR-V:
665671
- clang/lib/Driver/ToolChains/SPIRV.*

.github/workflows/ci-post-commit-analyzer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
if: >-
3535
github.repository_owner == 'llvm' &&
3636
github.event.action != 'closed'
37-
runs-on: ubuntu-22.04
37+
runs-on: ubuntu-24.04
3838
container:
39-
image: 'ghcr.io/llvm/ci-ubuntu-22.04:latest'
39+
image: 'ghcr.io/llvm/ci-ubuntu-24.04:latest'
4040
env:
4141
LLVM_VERSION: 18
4242
steps:

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ RUN choco install -y handle
108108
109109
RUN pip3 install pywin32 buildbot-worker==2.8.4
110110
111-
ARG RUNNER_VERSION=2.322.0
111+
ARG RUNNER_VERSION=2.323.0
112112
ENV RUNNER_VERSION=$RUNNER_VERSION
113113
114114
RUN powershell -Command \

0 commit comments

Comments
 (0)