Skip to content

Commit ce22083

Browse files
committed
[𝘀𝗽𝗿] changes to main this commit is based on
Created using spr 1.3.4 [skip ci]
1 parent e9954ec commit ce22083

File tree

3,422 files changed

+104023
-52151
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,422 files changed

+104023
-52151
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ function exclude-linux() {
153153
for project in ${projects}; do
154154
case ${project} in
155155
cross-project-tests) ;; # tests failing
156-
lldb) ;; # tests failing
157156
openmp) ;; # https://github.com/google/llvm-premerge-checks/issues/410
158157
*)
159158
echo "${project}"
@@ -170,7 +169,7 @@ function exclude-windows() {
170169
compiler-rt) ;; # tests taking too long
171170
openmp) ;; # TODO: having trouble with the Perl installation
172171
libc) ;; # no Windows support
173-
lldb) ;; # tests failing
172+
lldb) ;; # custom environment requirements (https://github.com/llvm/llvm-project/pull/94208#issuecomment-2146256857)
174173
bolt) ;; # tests are not supported yet
175174
*)
176175
echo "${project}"
@@ -213,7 +212,7 @@ function check-targets() {
213212
echo "check-unwind"
214213
;;
215214
lldb)
216-
echo "check-all" # TODO: check-lldb may not include all the LLDB tests?
215+
echo "check-lldb"
217216
;;
218217
pstl)
219218
echo "check-all"

.ci/monolithic-linux.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ targets="${2}"
3939

4040
echo "--- cmake"
4141
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
42+
pip install -q -r "${MONOREPO_ROOT}"/lldb/test/requirements.txt
4243
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4344
-D LLVM_ENABLE_PROJECTS="${projects}" \
4445
-G Ninja \

.github/new-prs-labeler.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,16 @@ backend:AMDGPU:
717717
- '**/*amdgpu*/**'
718718
- '**/*AMDGPU*/**'
719719

720+
backend:NVPTX:
721+
- 'llvm/**/*nvvm*'
722+
- 'llvm/**/*NVVM*'
723+
- 'llvm/**/*nvptx*'
724+
- 'llvm/**/*NVPTX*'
725+
- 'llvm/**/*nvvm*/**'
726+
- 'llvm/**/*NVVM*/**'
727+
- 'llvm/**/*nvptx*/**'
728+
- 'llvm/**/*NVPTX*/**'
729+
720730
backend:RISC-V:
721731
- clang/**/*riscv*
722732
- clang/**/*RISCV*
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import json
2+
import multiprocessing
3+
import os
4+
import re
5+
import subprocess
6+
import sys
7+
8+
9+
def run_analyzer(data):
10+
os.chdir(data["directory"])
11+
command = (
12+
data["command"]
13+
+ f" --analyze --analyzer-output html -o analyzer-results -Xclang -analyzer-config -Xclang max-nodes=75000"
14+
)
15+
print(command)
16+
subprocess.run(command, shell=True, check=True)
17+
18+
19+
def pool_error(e):
20+
print("Error analyzing file:", e)
21+
22+
23+
def main():
24+
db_path = sys.argv[1]
25+
database = json.load(open(db_path))
26+
27+
with multiprocessing.Pool() as pool:
28+
pool.map_async(run_analyzer, [k for k in database], error_callback=pool_error)
29+
pool.close()
30+
pool.join()
31+
32+
33+
if __name__ == "__main__":
34+
main()
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Post-Commit Static Analyzer
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- 'release/**'
10+
paths:
11+
- 'clang/**'
12+
- 'llvm/**'
13+
- '.github/workflows/ci-post-commit-analyzer.yml'
14+
pull_request:
15+
types:
16+
- opened
17+
- synchronize
18+
- reopened
19+
- closed
20+
paths:
21+
- '.github/workflows/ci-post-commit-analyzer.yml'
22+
- '.github/workflows/ci-post-commit-analyzer-run.py'
23+
schedule:
24+
- cron: '30 0 * * *'
25+
26+
concurrency:
27+
group: >-
28+
llvm-project-${{ github.workflow }}-${{ github.event_name == 'pull_request' &&
29+
( github.event.pull_request.number || github.ref) }}
30+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
31+
32+
jobs:
33+
post-commit-analyzer:
34+
if: >-
35+
github.repository_owner == 'llvm' &&
36+
github.event.action != 'closed'
37+
runs-on: ubuntu-22.04
38+
container:
39+
image: 'ghcr.io/llvm/ci-ubuntu-22.04:latest'
40+
env:
41+
LLVM_VERSION: 18
42+
steps:
43+
- name: Checkout Source
44+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
45+
46+
- name: Setup ccache
47+
uses: hendrikmuhs/ccache-action@v1
48+
with:
49+
# A full build of llvm, clang, lld, and lldb takes about 250MB
50+
# of ccache space. There's not much reason to have more than this,
51+
# because we usually won't need to save cache entries from older
52+
# builds. Also, there is an overall 10GB cache limit, and each
53+
# run creates a new cache entry so we want to ensure that we have
54+
# enough cache space for all the tests to run at once and still
55+
# fit under the 10 GB limit.
56+
# Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174
57+
max-size: 2G
58+
key: post-commit-analyzer
59+
variant: sccache
60+
61+
- name: Configure
62+
run: |
63+
cmake -B build -S llvm -G Ninja \
64+
-DLLVM_ENABLE_ASSERTIONS=ON \
65+
-DLLVM_ENABLE_PROJECTS=clang \
66+
-DLLVM_BUILD_LLVM_DYLIB=ON \
67+
-DLLVM_LINK_LLVM_DYLIB=ON \
68+
-DCMAKE_CXX_COMPILER=clang++ \
69+
-DCMAKE_C_COMPILER=clang \
70+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
71+
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
72+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
73+
-DLLVM_INCLUDE_TESTS=OFF \
74+
-DCLANG_INCLUDE_TESTS=OFF \
75+
-DCMAKE_BUILD_TYPE=Release
76+
77+
- name: Build
78+
run: |
79+
# FIXME: We need to build all the generated header files in order to be able to run
80+
# the analyzer on every file. Building libLLVM and libclang is probably overkill for
81+
# this, but it's better than building every target.
82+
ninja -v -C build libLLVM.so libclang.so
83+
84+
# Run the analyzer.
85+
python3 .github/workflows/ci-post-commit-analyzer-run.py build/compile_commands.json
86+
87+
scan-build --generate-index-only build/analyzer-results
88+
89+
- name: Upload Results
90+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
91+
if: always()
92+
with:
93+
name: analyzer-results
94+
path: 'build/analyzer-results/*'
95+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RUN cmake -B ./build -G Ninja ./llvm \
3737
-DLLVM_ENABLE_RUNTIMES="compiler-rt" \
3838
-DCMAKE_INSTALL_PREFIX="$LLVM_SYSROOT" \
3939
-DLLVM_ENABLE_PROJECTS="bolt;clang;lld;clang-tools-extra" \
40-
-DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format" \
40+
-DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format;scan-build" \
4141
-DCLANG_DEFAULT_LINKER="lld" \
4242
-DBOOTSTRAP_CLANG_PGO_TRAINING_DATA_SOURCE_DIR=/llvm-project-llvmorg-$LLVM_VERSION/llvm
4343

.github/workflows/release-binaries.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ jobs:
156156
rm build.tar.zst
157157
158158
- name: Build Stage 2
159+
# Re-enable once PGO builds are supported.
160+
if: false
159161
run: |
160162
ninja -C /mnt/build stage2-instrumented
161163
@@ -214,7 +216,7 @@ jobs:
214216
215217
- id: package-info
216218
run: |
217-
filename="LLVM-${{ needs.prepare.outputs.release-version }}-Linux.tar.gz"
219+
filename="LLVM-${{ needs.prepare.outputs.release-version }}-Linux.tar.xz"
218220
echo "filename=$filename" >> $GITHUB_OUTPUT
219221
echo "path=/mnt/build/tools/clang/stage2-bins/$filename" >> $GITHUB_OUTPUT
220222

.github/workflows/restart-preempted-libcxx-jobs.yaml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
name: "Restart Job"
2525
permissions:
2626
statuses: read
27-
checks: read
27+
checks: write
2828
actions: write
2929
runs-on: ubuntu-latest
3030
steps:
@@ -35,11 +35,36 @@ jobs:
3535
const failure_regex = /Process completed with exit code 1./
3636
const preemption_regex = /The runner has received a shutdown signal/
3737
38+
const wf_run = context.payload.workflow_run
39+
core.notice(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`)
40+
41+
42+
async function create_check_run(conclusion, message) {
43+
// Create a check run on the given workflow run to indicate if
44+
// we are restarting the workflow or not.
45+
if (conclusion != 'success' && conclusion != 'skipped' && conclusion != 'neutral') {
46+
core.setFailed('Invalid conclusion: ' + conclusion)
47+
}
48+
await github.rest.checks.create({
49+
owner: context.repo.owner,
50+
repo: context.repo.repo,
51+
name: 'Restart Preempted Job',
52+
head_sha: wf_run.head_sha,
53+
status: 'completed',
54+
conclusion: conclusion,
55+
output: {
56+
title: 'Restarted Preempted Job',
57+
summary: message
58+
}
59+
})
60+
}
61+
3862
console.log('Listing check runs for suite')
3963
const check_suites = await github.rest.checks.listForSuite({
4064
owner: context.repo.owner,
4165
repo: context.repo.repo,
42-
check_suite_id: context.payload.workflow_run.check_suite_id
66+
check_suite_id: context.payload.workflow_run.check_suite_id,
67+
per_page: 100 // FIXME: We don't have 100 check runs yet, but we should handle this better.
4368
})
4469
4570
check_run_ids = [];
@@ -83,23 +108,27 @@ jobs:
83108
if (failure_match != null) {
84109
// We only want to restart the workflow if all of the failures were due to preemption.
85110
// We don't want to restart the workflow if there were other failures.
86-
console.log('Choosing not to rerun workflow because we found a non-preemption failure');
87-
console.log('Failure message: ' + annotation.message);
111+
core.notice('Choosing not to rerun workflow because we found a non-preemption failure' +
112+
'Failure message: "' + annotation.message + '"');
113+
await create_check_run('skipped', 'Choosing not to rerun workflow because we found a non-preemption failure\n'
114+
+ 'Failure message: ' + annotation.message)
88115
return;
89116
}
90117
}
91118
}
92119
93120
if (!has_preempted_job) {
94-
console.log('No preempted jobs found. Not restarting workflow.');
121+
core.notice('No preempted jobs found. Not restarting workflow.');
122+
await create_check_run('neutral', 'No preempted jobs found. Not restarting workflow.')
95123
return;
96124
}
97125
98-
console.log("Restarted workflow: " + context.payload.workflow_run.id);
126+
core.notice("Restarted workflow: " + context.payload.workflow_run.id);
99127
await github.rest.actions.reRunWorkflowFailedJobs({
100128
owner: context.repo.owner,
101129
repo: context.repo.repo,
102130
run_id: context.payload.workflow_run.id
103131
})
132+
await create_check_run('success', 'Restarted workflow run due to preempted job')
104133
105134

0 commit comments

Comments
 (0)