forked from oneapi-src/SYCLomatic
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Weekly pulldown from origin/sycl to origin/SYCLomatic
- Loading branch information
Showing
9,883 changed files
with
615,983 additions
and
195,458 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import json | ||
import multiprocessing | ||
import os | ||
import re | ||
import subprocess | ||
import sys | ||
|
||
|
||
def run_analyzer(data): | ||
os.chdir(data["directory"]) | ||
command = ( | ||
data["command"] | ||
+ f" --analyze --analyzer-output html -o analyzer-results -Xclang -analyzer-config -Xclang max-nodes=75000" | ||
) | ||
print(command) | ||
subprocess.run(command, shell=True, check=True) | ||
|
||
|
||
def pool_error(e): | ||
print("Error analyzing file:", e) | ||
|
||
|
||
def main(): | ||
db_path = sys.argv[1] | ||
database = json.load(open(db_path)) | ||
|
||
with multiprocessing.Pool() as pool: | ||
pool.map_async(run_analyzer, [k for k in database], error_callback=pool_error) | ||
pool.close() | ||
pool.join() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Post-Commit Static Analyzer | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'release/**' | ||
paths: | ||
- 'clang/**' | ||
- 'llvm/**' | ||
- '.github/workflows/ci-post-commit-analyzer.yml' | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- closed | ||
paths: | ||
- '.github/workflows/ci-post-commit-analyzer.yml' | ||
- '.github/workflows/ci-post-commit-analyzer-run.py' | ||
schedule: | ||
- cron: '30 0 * * *' | ||
|
||
concurrency: | ||
group: >- | ||
llvm-project-${{ github.workflow }}-${{ github.event_name == 'pull_request' && | ||
( github.event.pull_request.number || github.ref) }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
|
||
jobs: | ||
post-commit-analyzer: | ||
if: >- | ||
github.repository_owner == 'llvm' && | ||
github.event.action != 'closed' | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: 'ghcr.io/llvm/ci-ubuntu-22.04:latest' | ||
env: | ||
LLVM_VERSION: 18 | ||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Setup ccache | ||
uses: hendrikmuhs/ccache-action@v1 | ||
with: | ||
# A full build of llvm, clang, lld, and lldb takes about 250MB | ||
# of ccache space. There's not much reason to have more than this, | ||
# because we usually won't need to save cache entries from older | ||
# builds. Also, there is an overall 10GB cache limit, and each | ||
# run creates a new cache entry so we want to ensure that we have | ||
# enough cache space for all the tests to run at once and still | ||
# fit under the 10 GB limit. | ||
# Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174 | ||
max-size: 2G | ||
key: post-commit-analyzer | ||
variant: sccache | ||
|
||
- name: Configure | ||
run: | | ||
cmake -B build -S llvm -G Ninja \ | ||
-DLLVM_ENABLE_ASSERTIONS=ON \ | ||
-DLLVM_ENABLE_PROJECTS=clang \ | ||
-DLLVM_BUILD_LLVM_DYLIB=ON \ | ||
-DLLVM_LINK_LLVM_DYLIB=ON \ | ||
-DCMAKE_CXX_COMPILER=clang++ \ | ||
-DCMAKE_C_COMPILER=clang \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=sccache \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | ||
-DLLVM_INCLUDE_TESTS=OFF \ | ||
-DCLANG_INCLUDE_TESTS=OFF \ | ||
-DCMAKE_BUILD_TYPE=Release | ||
- name: Build | ||
run: | | ||
# FIXME: We need to build all the generated header files in order to be able to run | ||
# the analyzer on every file. Building libLLVM and libclang is probably overkill for | ||
# this, but it's better than building every target. | ||
ninja -v -C build libLLVM.so libclang.so | ||
# Run the analyzer. | ||
python3 .github/workflows/ci-post-commit-analyzer-run.py build/compile_commands.json | ||
scan-build --generate-index-only build/analyzer-results | ||
- name: Upload Results | ||
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0 | ||
if: always() | ||
with: | ||
name: analyzer-results | ||
path: 'build/analyzer-results/*' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
name: Restart Preempted Libc++ Workflow | ||
|
||
# The libc++ builders run on preemptable VMs, which can be shutdown at any time. | ||
# This workflow identifies when a workflow run was canceled due to the VM being preempted, | ||
# and restarts the workflow run. | ||
|
||
# We identify a canceled workflow run by checking the annotations of the check runs in the check suite, | ||
# which should contain the message "The runner has received a shutdown signal." | ||
|
||
# Note: If a job is both preempted and also contains a non-preemption failure, we do not restart the workflow. | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Build and Test libc\+\+] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
restart: | ||
if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'cancelled') | ||
name: "Restart Job" | ||
permissions: | ||
statuses: read | ||
checks: write | ||
actions: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Restart Job" | ||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1 | ||
with: | ||
script: | | ||
const failure_regex = /Process completed with exit code 1./ | ||
const preemption_regex = /The runner has received a shutdown signal/ | ||
const wf_run = context.payload.workflow_run | ||
core.notice(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`) | ||
async function create_check_run(conclusion, message) { | ||
// Create a check run on the given workflow run to indicate if | ||
// we are restarting the workflow or not. | ||
if (conclusion != 'success' && conclusion != 'skipped' && conclusion != 'neutral') { | ||
core.setFailed('Invalid conclusion: ' + conclusion) | ||
} | ||
await github.rest.checks.create({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
name: 'Restart Preempted Job', | ||
head_sha: wf_run.head_sha, | ||
status: 'completed', | ||
conclusion: conclusion, | ||
output: { | ||
title: 'Restarted Preempted Job', | ||
summary: message | ||
} | ||
}) | ||
} | ||
console.log('Listing check runs for suite') | ||
const check_suites = await github.rest.checks.listForSuite({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
check_suite_id: context.payload.workflow_run.check_suite_id, | ||
per_page: 100 // FIXME: We don't have 100 check runs yet, but we should handle this better. | ||
}) | ||
check_run_ids = []; | ||
for (check_run of check_suites.data.check_runs) { | ||
console.log('Checking check run: ' + check_run.id); | ||
if (check_run.status != 'completed') { | ||
console.log('Check run was not completed. Skipping.'); | ||
continue; | ||
} | ||
if (check_run.conclusion != 'failure' && check_run.conclusion != 'cancelled') { | ||
console.log('Check run had conclusion: ' + check_run.conclusion + '. Skipping.'); | ||
continue; | ||
} | ||
check_run_ids.push(check_run.id); | ||
} | ||
has_preempted_job = false; | ||
for (check_run_id of check_run_ids) { | ||
console.log('Listing annotations for check run: ' + check_run_id); | ||
annotations = await github.rest.checks.listAnnotations({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
check_run_id: check_run_id | ||
}) | ||
for (annotation of annotations.data) { | ||
if (annotation.annotation_level != 'failure') { | ||
continue; | ||
} | ||
const preemption_match = annotation.message.match(preemption_regex); | ||
if (preemption_match != null) { | ||
console.log('Found preemption message: ' + annotation.message); | ||
has_preempted_job = true; | ||
} | ||
const failure_match = annotation.message.match(failure_regex); | ||
if (failure_match != null) { | ||
// We only want to restart the workflow if all of the failures were due to preemption. | ||
// We don't want to restart the workflow if there were other failures. | ||
core.notice('Choosing not to rerun workflow because we found a non-preemption failure' + | ||
'Failure message: "' + annotation.message + '"'); | ||
await create_check_run('skipped', 'Choosing not to rerun workflow because we found a non-preemption failure\n' | ||
+ 'Failure message: ' + annotation.message) | ||
return; | ||
} | ||
} | ||
} | ||
if (!has_preempted_job) { | ||
core.notice('No preempted jobs found. Not restarting workflow.'); | ||
await create_check_run('neutral', 'No preempted jobs found. Not restarting workflow.') | ||
return; | ||
} | ||
core.notice("Restarted workflow: " + context.payload.workflow_run.id); | ||
await github.rest.actions.reRunWorkflowFailedJobs({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: context.payload.workflow_run.id | ||
}) | ||
await create_check_run('success', 'Restarted workflow run due to preempted job') |
Oops, something went wrong.