Skip to content

Commit ccf4c38

Browse files
committed
Merge remote-tracking branch 'upstream/release/19.x' into rustc/19.1-2024-07-30
2 parents 57ae1a3 + d033ae1 commit ccf4c38

File tree

169 files changed

+2560
-1596
lines changed

Some content is hidden

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

169 files changed

+2560
-1596
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Get LLVM Version
2+
description: >-
3+
Get the LLVM version from the llvm-project source tree. This action assumes
4+
the llvm-project sources have already been checked out into GITHUB_WORKSPACE.
5+
6+
outputs:
7+
major:
8+
description: LLVM major version
9+
value: ${{ steps.version.outputs.major }}
10+
minor:
11+
description: LLVM minor version
12+
value: ${{ steps.version.outputs.minor }}
13+
patch:
14+
description: LLVM patch version
15+
value: ${{ steps.version.outputs.patch }}
16+
17+
runs:
18+
using: "composite"
19+
steps:
20+
- name: Get Version
21+
shell: bash
22+
id: version
23+
run: |
24+
for v in major minor patch; do
25+
echo "$v=`llvm/utils/release/get-llvm-version.sh --$v`" >> $GITHUB_OUTPUT
26+
done

.github/workflows/libclang-abi-tests.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
3434
ABI_LIBS: ${{ steps.vars.outputs.ABI_LIBS }}
3535
BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }}
36-
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }}
37-
LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }}
38-
LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }}
36+
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.major }}
37+
LLVM_VERSION_MINOR: ${{ steps.version.outputs.minor }}
38+
LLVM_VERSION_PATCH: ${{ steps.version.outputs.patch }}
3939
steps:
4040
- name: Checkout source
4141
uses: actions/checkout@v4
@@ -44,14 +44,14 @@ jobs:
4444

4545
- name: Get LLVM version
4646
id: version
47-
uses: llvm/actions/get-llvm-version@main
47+
uses: ./.github/workflows/get-llvm-version
4848

4949
- name: Setup Variables
5050
id: vars
5151
run: |
5252
remote_repo='https://github.com/llvm/llvm-project'
53-
if [ ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then
54-
major_version=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1))
53+
if [ ${{ steps.version.outputs.patch }} -eq 0 ]; then
54+
major_version=$(( ${{ steps.version.outputs.major }} - 1))
5555
baseline_ref="llvmorg-$major_version.1.0"
5656
5757
# If there is a minor release, we want to use that as the base line.
@@ -73,8 +73,8 @@ jobs:
7373
} >> "$GITHUB_OUTPUT"
7474
else
7575
{
76-
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.LLVM_VERSION_MAJOR }}"
77-
echo "BASELINE_REF=llvmorg-${{ steps.version.outputs.LLVM_VERSION_MAJOR }}.1.0"
76+
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.major }}"
77+
echo "BASELINE_REF=llvmorg-${{ steps.version.outputs.major }}.1.0"
7878
echo "ABI_HEADERS=."
7979
echo "ABI_LIBS=libclang.so libclang-cpp.so"
8080
} >> "$GITHUB_OUTPUT"

.github/workflows/llvm-project-tests.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ jobs:
131131
-DCMAKE_BUILD_TYPE=Release \
132132
-DLLVM_ENABLE_ASSERTIONS=ON \
133133
-DLLDB_INCLUDE_TESTS=OFF \
134+
-DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" \
134135
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
135136
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
136137
$extra_cmake_args \
@@ -142,8 +143,6 @@ jobs:
142143
env:
143144
LLVM_BUILDDIR: ${{ steps.build-llvm.outputs.llvm-builddir }}
144145
run: |
145-
# Make sure all of LLVM libraries that llvm-config needs are built.
146+
# The libclc tests don't have a generated check target so all we can
147+
# do is build it.
146148
ninja -C "$LLVM_BUILDDIR"
147-
cmake -G Ninja -S libclc -B libclc-build -DLLVM_DIR="$LLVM_BUILDDIR"/lib/cmake/llvm -DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl"
148-
ninja -C libclc-build
149-
ninja -C libclc-build test

.github/workflows/llvm-tests.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ jobs:
4343
ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
4444
BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }}
4545
BASELINE_VERSION_MINOR: ${{ steps.vars.outputs.BASELINE_VERSION_MINOR }}
46-
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }}
47-
LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }}
48-
LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }}
46+
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.major }}
47+
LLVM_VERSION_MINOR: ${{ steps.version.outputs.minor }}
48+
LLVM_VERSION_PATCH: ${{ steps.version.outputs.patch }}
4949
steps:
5050
- name: Checkout source
5151
uses: actions/checkout@v4
@@ -54,7 +54,7 @@ jobs:
5454

5555
- name: Get LLVM version
5656
id: version
57-
uses: llvm/actions/get-llvm-version@main
57+
uses: ./.github/workflows/get-llvm-version
5858

5959
- name: Setup Variables
6060
id: vars
@@ -66,14 +66,14 @@ jobs:
6666
# 18.1.0 We want to check 17.0.x
6767
# 18.1.1 We want to check 18.1.0
6868
echo "BASELINE_VERSION_MINOR=1" >> "$GITHUB_OUTPUT"
69-
if [ ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then
69+
if [ ${{ steps.version.outputs.patch }} -eq 0 ]; then
7070
{
71-
echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1))"
71+
echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.major }} - 1))"
7272
echo "ABI_HEADERS=llvm-c"
7373
} >> "$GITHUB_OUTPUT"
7474
else
7575
{
76-
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.LLVM_VERSION_MAJOR }}"
76+
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.major }}"
7777
echo "ABI_HEADERS=."
7878
} >> "$GITHUB_OUTPUT"
7979
fi
+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Release Binaries All
2+
3+
permissions:
4+
contents: read # Default everything to read-only
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
release-version:
10+
description: 'Release Version'
11+
required: true
12+
type: string
13+
upload:
14+
description: 'Upload binaries to the release page'
15+
required: true
16+
default: false
17+
type: boolean
18+
19+
workflow_call:
20+
inputs:
21+
release-version:
22+
description: 'Release Version'
23+
required: true
24+
type: string
25+
upload:
26+
description: 'Upload binaries to the release page'
27+
required: true
28+
default: false
29+
type: boolean
30+
31+
pull_request:
32+
types:
33+
- opened
34+
- synchronize
35+
- reopened
36+
# When a PR is closed, we still start this workflow, but then skip
37+
# all the jobs, which makes it effectively a no-op. The reason to
38+
# do this is that it allows us to take advantage of concurrency groups
39+
# to cancel in progress CI jobs whenever the PR is closed.
40+
- closed
41+
paths:
42+
- '.github/workflows/release-binaries-all.yml'
43+
- '.github/workflows/release-binaries.yml'
44+
- '.github/workflows/release-binaries-setup-stage/*'
45+
- '.github/workflows/release-binaries-save-stage/*'
46+
47+
concurrency:
48+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || 'dispatch' }}
49+
cancel-in-progress: True
50+
51+
jobs:
52+
setup-variables:
53+
if: >-
54+
(github.event_name != 'pull_request' || github.event.action != 'closed')
55+
runs-on: ubuntu-22.04
56+
outputs:
57+
release-version: ${{ steps.vars.outputs.release-version }}
58+
upload: ${{ steps.vars.outputs.upload }}
59+
steps:
60+
- shell: bash
61+
id: vars
62+
run: |
63+
upload="${{ inputs.upload }}"
64+
release_version="${{ inputs.release-version }}"
65+
if [ "${{ github.event_name }}" = "pull_request" ]; then
66+
upload="false"
67+
release_version=""
68+
fi
69+
echo "release-version=$release_version" >> "$GITHUB_OUTPUT"
70+
echo "upload=$upload" >> "$GITHUB_OUTPUT"
71+
72+
release-binaries-all:
73+
name: Build Release Binaries
74+
needs:
75+
- setup-variables
76+
permissions:
77+
contents: write # For release uploads
78+
id-token: write # For artifact attestations
79+
attestations: write # For artifact attestations
80+
strategy:
81+
fail-fast: false
82+
matrix:
83+
runs-on:
84+
- ubuntu-22.04
85+
- windows-2022
86+
- macos-13
87+
- macos-14
88+
89+
uses: ./.github/workflows/release-binaries.yml
90+
with:
91+
release-version: "${{ needs.setup-variables.outputs.release-version }}"
92+
upload: ${{ needs.setup-variables.outputs.upload == 'true'}}
93+
runs-on: "${{ matrix.runs-on }}"
94+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Save Stage
2+
description: >-
3+
Upload the source and binary directories from a build stage so that they
4+
can be re-used in the next stage. This action is used to the release
5+
binaries workflow into multiple stages to avoid the 6 hour timeout on
6+
the GitHub hosted runners.
7+
inputs:
8+
build-prefix:
9+
description: "Directory containing the build directory."
10+
required: true
11+
type: 'string'
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
# We need to create an archive of the build directory, because it has too
17+
# many files to upload.
18+
- name: Package Build and Source Directories
19+
shell: bash
20+
run: |
21+
# Windows does not support symlinks, so we need to dereference them.
22+
tar --exclude build/ ${{ (runner.os == 'Windows' && '-h') || '' }} -c . | zstd -T0 -c > ../llvm-project.tar.zst
23+
mv ../llvm-project.tar.zst .
24+
tar -C ${{ inputs.build-prefix }} -c build/ | zstd -T0 -c > build.tar.zst
25+
26+
- name: Upload Stage 1 Source
27+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
28+
with:
29+
name: ${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-source
30+
path: llvm-project.tar.zst
31+
retention-days: 2
32+
33+
- name: Upload Stage 1 Build Dir
34+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
35+
with:
36+
name: ${{ runner.os}}-${{ runner.arch }}-${{ github.job }}-build
37+
path: build.tar.zst
38+
retention-days: 2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Setup Stage
2+
description: >-
3+
Setup the next stage of the release binaries workflow. This sets up the
4+
environment correctly for a new stage of the release binaries workflow
5+
and also restores the source and build directory from the previous stage.
6+
7+
inputs:
8+
previous-artifact:
9+
description: >-
10+
A unique descriptor for the artifact from the previous stage. This will
11+
be used to construct the final artifact pattern, which is:
12+
$RUNNER_OS-$RUNNER_ARCH-$PREVIOUS_ARTIFACT-*
13+
required: false
14+
type: 'string'
15+
16+
outputs:
17+
build-prefix:
18+
description: "Directory containing the build directory."
19+
value: ${{ steps.build-prefix.outputs.build-prefix }}
20+
21+
runs:
22+
using: "composite"
23+
steps:
24+
- name: Install Ninja
25+
uses: llvm/actions/install-ninja@22e9f909d35b50bd1181709564bfe816eaeaae81 # main
26+
27+
- name: Setup Windows
28+
if: startsWith(runner.os, 'Windows')
29+
uses: llvm/actions/setup-windows@main
30+
with:
31+
arch: amd64
32+
33+
- name: Set Build Prefix
34+
id: build-prefix
35+
shell: bash
36+
run: |
37+
build_prefix=`pwd`
38+
if [ "${{ runner.os }}" = "Linux" ]; then
39+
sudo chown $USER:$USER /mnt/
40+
build_prefix=/mnt/
41+
fi
42+
echo "build-prefix=$build_prefix" >> $GITHUB_OUTPUT
43+
44+
- name: Download Previous Stage Artifact
45+
if: ${{ inputs.previous-artifact }}
46+
id: download
47+
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
48+
with:
49+
pattern: ${{ runner.os }}-${{ runner.arch }}-${{ inputs.previous-artifact }}-*
50+
merge-multiple: true
51+
52+
- name: Unpack Artifact
53+
if: ${{ steps.download.outputs.download-path }}
54+
shell: bash
55+
run: |
56+
tar --zstd -xf llvm-project.tar.zst
57+
rm llvm-project.tar.zst
58+
tar --zstd -C ${{ steps.build-prefix.outputs.build-prefix}} -xf build.tar.zst
59+
rm build.tar.zst

0 commit comments

Comments
 (0)