Skip to content

Commit 8c2b953

Browse files
committed
Merge remote-tracking branch 'fork/main' into objdump-report-missing-arg-value
2 parents 9e7cd62 + dc298fe commit 8c2b953

File tree

5,406 files changed

+251021
-88260
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,406 files changed

+251021
-88260
lines changed

.github/workflows/docs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- 'lld/docs/**'
2424
- 'openmp/docs/**'
2525
- 'polly/docs/**'
26+
- 'flang/docs/**'
2627
pull_request:
2728
paths:
2829
- 'llvm/docs/**'
@@ -35,11 +36,13 @@ on:
3536
- 'lld/docs/**'
3637
- 'openmp/docs/**'
3738
- 'polly/docs/**'
39+
- 'flang/docs/**'
3840

3941
jobs:
4042
check-docs-build:
4143
name: "Test documentation build"
4244
runs-on: ubuntu-latest
45+
if: github.repository == 'llvm/llvm-project'
4346
steps:
4447
# Don't fetch before checking for file changes to force the file changes
4548
# action to use the Github API in pull requests. If it's a push to a
@@ -75,6 +78,8 @@ jobs:
7578
- 'openmp/docs/**'
7679
polly:
7780
- 'polly/docs/**'
81+
flang:
82+
- 'flang/docs/**'
7883
- name: Fetch LLVM sources (PR)
7984
if: ${{ github.event_name == 'pull_request' }}
8085
uses: actions/checkout@v4
@@ -143,4 +148,11 @@ jobs:
143148
run: |
144149
cmake -B polly-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="polly" -DLLVM_ENABLE_SPHINX=ON ./llvm
145150
TZ=UTC ninja -C polly-build docs-polly-html docs-polly-man
151+
- name: Build Flang docs
152+
if: steps.docs-changed-subprojects.outputs.flang_any_changed == 'true'
153+
# TODO(boomanaiden154): Remove the SPHINX_WARNINGS_AS_ERRORS from the
154+
# CMake invocation once the warnings in the flang docs build are fixed.
155+
run: |
156+
cmake -B flang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;mlir;flang" -DLLVM_ENABLE_SPHINX=ON -DSPHINX_WARNINGS_AS_ERRORS=OFF ./llvm
157+
TZ=UTC ninja -C flang-build docs-flang-html docs-flang-man
146158

.github/workflows/new-prs.yml

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,36 @@
11
name: "Labelling new pull requests"
2+
3+
permissions:
4+
contents: read
5+
26
on:
3-
workflow_run:
4-
workflows: ["PR Receive"]
7+
# It's safe to use pull_request_target here, because we aren't checking out
8+
# code from the pull request branch.
9+
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
10+
pull_request_target:
11+
types:
12+
- opened
13+
- reopened
14+
- ready_for_review
15+
- synchronize
516

617
jobs:
718
automate-prs-labels:
819
permissions:
9-
contents: read
1020
pull-requests: write
1121
runs-on: ubuntu-latest
22+
# Ignore PRs with more than 10 commits. Pull requests with a lot of
23+
# commits tend to be accidents usually when someone made a mistake while trying
24+
# to rebase. We want to ignore these pull requests to avoid excessive
25+
# notifications.
1226
if: >
1327
github.repository == 'llvm/llvm-project' &&
14-
github.event.workflow_run.event == 'pull_request_target' &&
15-
github.event.workflow_run.conclusion == 'success'
28+
github.event.pull_request.draft == false &&
29+
github.event.pull_request.commits < 10
1630
steps:
17-
# From: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
18-
# Updated version here: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
19-
- name: Debug
20-
run: |
21-
echo "Event: ${{ github.event.workflow_run.event }} Conclusion: ${{ github.event.workflow_run.conclusion }}"
22-
- name: 'Download artifact'
23-
uses: actions/github-script@v6
24-
with:
25-
script: |
26-
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
27-
owner: context.repo.owner,
28-
repo: context.repo.repo,
29-
run_id: context.payload.workflow_run.id
30-
});
31-
const matchArtifact = artifacts.data.artifacts.find((artifact) =>
32-
artifact.name === 'pr'
33-
);
34-
const download = await github.rest.actions.downloadArtifact({
35-
owner: context.repo.owner,
36-
repo: context.repo.repo,
37-
artifact_id: matchArtifact.id,
38-
archive_format: 'zip'
39-
});
40-
const { writeFileSync } = require('node:fs');
41-
writeFileSync('${{ github.workspace }}/pr.zip', Buffer.from(download.data));
42-
43-
- run: unzip pr.zip
44-
45-
- name: "Get PR Number"
46-
id: vars
47-
run:
48-
echo "pr-number=$(cat NR)" >> "$GITHUB_OUTPUT"
49-
5031
- uses: actions/labeler@v4
5132
with:
5233
configuration-path: .github/new-prs-labeler.yml
5334
# workaround for https://github.com/actions/labeler/issues/112
5435
sync-labels: ''
5536
repo-token: ${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}
56-
pr-number: ${{ steps.vars.outputs.pr-number }}

.github/workflows/pr-code-format.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,38 @@ permissions:
66
jobs:
77
code_formatter:
88
runs-on: ubuntu-latest
9+
if: github.repository == 'llvm/llvm-project'
910
steps:
1011
- name: Fetch LLVM sources
1112
uses: actions/checkout@v4
1213
with:
13-
fetch-depth: 2
14+
ref: ${{ github.event.pull_request.head.sha }}
15+
16+
- name: Checkout through merge base
17+
uses: rmacklin/fetch-through-merge-base@v0
18+
with:
19+
base_ref: ${{ github.event.pull_request.base.ref }}
20+
head_ref: ${{ github.event.pull_request.head.sha }}
21+
deepen_length: 500
1422

1523
- name: Get changed files
1624
id: changed-files
1725
uses: tj-actions/changed-files@v39
1826
with:
1927
separator: ","
20-
fetch_depth: 100 # Fetches only the last 10 commits
28+
skip_initial_fetch: true
29+
30+
# We need to make sure that we aren't executing/using any code from the
31+
# PR for security reasons as we're using pull_request_target. Checkout
32+
# the target branch with the necessary files.
33+
- name: Fetch code formatting utils
34+
uses: actions/checkout@v4
35+
with:
36+
sparse-checkout: |
37+
llvm/utils/git/requirements_formatting.txt
38+
llvm/utils/git/code-format-helper.py
39+
sparse-checkout-cone-mode: false
40+
path: code-format-tools
2141

2242
- name: "Listed files"
2343
run: |
@@ -34,10 +54,10 @@ jobs:
3454
with:
3555
python-version: '3.11'
3656
cache: 'pip'
37-
cache-dependency-path: 'llvm/utils/git/requirements_formatting.txt'
57+
cache-dependency-path: 'code-format-tools/llvm/utils/git/requirements_formatting.txt'
3858

3959
- name: Install python dependencies
40-
run: pip install -r llvm/utils/git/requirements_formatting.txt
60+
run: pip install -r code-format-tools/llvm/utils/git/requirements_formatting.txt
4161

4262
- name: Run code formatter
4363
env:
@@ -46,7 +66,7 @@ jobs:
4666
END_REV: ${{ github.event.pull_request.head.sha }}
4767
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
4868
run: |
49-
python llvm/utils/git/code-format-helper.py \
69+
python ./code-format-tools/llvm/utils/git/code-format-helper.py \
5070
--token ${{ secrets.GITHUB_TOKEN }} \
5171
--issue-number $GITHUB_PR_NUMBER \
5272
--start-rev $START_REV \

.github/workflows/pr-receive-label.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/pr-receive.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/pr-subscriber-wait.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/pr-subscriber.yml

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
name: PR Subscriber
22

33
on:
4-
workflow_run:
5-
workflows: ["PR Receive Label"]
4+
pull_request_target:
65
types:
7-
- completed
6+
- labeled
87

98
permissions:
10-
actions: read
119
contents: read
1210

1311
jobs:
1412
auto-subscribe:
1513
runs-on: ubuntu-latest
16-
if: >
17-
github.repository == 'llvm/llvm-project' &&
18-
github.event.workflow_run.event == 'pull_request' &&
19-
github.event.workflow_run.conclusion == 'success'
14+
if: github.repository == 'llvm/llvm-project'
2015
steps:
2116
- name: Setup Automation Script
2217
run: |
@@ -26,47 +21,10 @@ jobs:
2621
chmod a+x github-automation.py
2722
pip install -r requirements.txt
2823
29-
- name: 'Wait for other actions'
30-
# We can't use the concurrency tag for these jobs, because it will
31-
# cancel pending jobs if another job is running.
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
run: |
35-
python3 pr-subscriber-wait.py
36-
37-
38-
# From: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
39-
# Updated version here: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
40-
- name: 'Download artifact'
41-
uses: actions/github-script@v6
42-
with:
43-
script: |
44-
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
45-
owner: context.repo.owner,
46-
repo: context.repo.repo,
47-
run_id: context.payload.workflow_run.id
48-
});
49-
const matchArtifact = artifacts.data.artifacts.find((artifact) =>
50-
artifact.name === 'pr'
51-
);
52-
const download = await github.rest.actions.downloadArtifact({
53-
owner: context.repo.owner,
54-
repo: context.repo.repo,
55-
artifact_id: matchArtifact.id,
56-
archive_format: 'zip'
57-
});
58-
const { writeFileSync } = require('node:fs');
59-
writeFileSync('${{ github.workspace }}/pr.zip', Buffer.from(download.data));
60-
61-
- run: unzip pr.zip
62-
6324
- name: Update watchers
64-
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
6525
run: |
66-
PR_NUMBER=$(cat NR)
67-
LABEL_NAME=$(cat LABEL)
6826
./github-automation.py \
6927
--token '${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}' \
7028
pr-subscriber \
71-
--issue-number "$PR_NUMBER" \
72-
--label-name "$LABEL_NAME"
29+
--issue-number "${{ github.event.number }}" \
30+
--label-name "${{ github.event.label.name }}"

0 commit comments

Comments
 (0)