Skip to content

Commit 4c2175f

Browse files
authored
[LLVM build] Merge back changes from llvm-head (#8612)
Just to keep the branches in sync
1 parent 340ca0d commit 4c2175f

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

.github/workflows/llvm-build.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
pull_request:
1010
paths:
1111
- .github/workflows/llvm-build.yml
12+
- .github/workflows/llvm-build/almalinux.Dockerfile
13+
- .github/workflows/llvm-build/centos.Dockerfile
1214
workflow_dispatch:
1315

1416
env:
@@ -135,6 +137,7 @@ jobs:
135137
-DLLVM_INSTALL_UTILS=ON
136138
-DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU"
137139
-DLLVM_ENABLE_TERMINFO=OFF
140+
-DLLVM_ENABLE_ZSTD=OFF
138141
llvm-project/llvm
139142
140143
ninja -C llvm-project/build check-mlir install
@@ -237,7 +240,11 @@ jobs:
237240
run: |
238241
# if this step crashes, it can leave behind a stale docker container
239242
docker container prune -f
240-
docker rmi -f $(docker images -q)
243+
244+
images=$(docker images -q)
245+
if [ -n "$images" ]; then
246+
docker rmi -f $images
247+
fi
241248
242249
docker build --tag llvm-build --build-arg llvm_dir=llvm-project \
243250
-f llvm-build/.github/workflows/llvm-build/almalinux.Dockerfile .
@@ -264,16 +271,16 @@ jobs:
264271
path: |
265272
${{ github.workspace }}/llvm-*-${{ matrix.config.target-os }}-${{ matrix.config.arch }}.tar.gz
266273
267-
- name: Azure Login
268-
if: ${{ (github.repository == 'triton-lang/triton') }}
274+
- name: Azure login
275+
if: ${{ (github.repository == 'triton-lang/triton') && github.ref_name == 'llvm-head' }}
269276
uses: azure/login@v2
270277
with:
271-
client-id: ${{ secrets.AZURE_CLIENT_ID }}
272-
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
273-
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
278+
client-id: ${{ secrets.AZURE_CLIENT_ID_LLVM }}
279+
tenant-id: ${{ secrets.AZURE_TENANT_ID_LLVM }}
280+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_LLVM }}
274281

275282
- name: Upload LLVM Artifacts to Azure
276-
if: ${{ (github.repository == 'triton-lang/triton') }}
283+
if: ${{ (github.repository == 'triton-lang/triton') && github.ref_name == 'llvm-head' }}
277284
shell: bash -el {0}
278285
run: |
279286
az storage blob upload --account-name oaitriton --auth-mode login --container-name public --file "${{ env.llvm_install_dir }}.tar.gz" --name "llvm-builds/${{ env.llvm_install_dir }}.tar.gz" --overwrite
@@ -282,7 +289,7 @@ jobs:
282289
echo "Blob URL: ${URL}"
283290
284291
- name: Azure Logout
285-
if: ${{ (github.repository == 'triton-lang/triton') }}
292+
if: ${{ (github.repository == 'triton-lang/triton') && github.ref_name == 'llvm-head' }}
286293
run: |
287294
az logout
288295
az cache purge

.github/workflows/llvm-build/almalinux.Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM almalinux:8
1+
# https://github.com/AlmaLinux/container-images/blob/9f9b3c8c8cf4a57fd42f362570ff47c75788031f/default/amd64/Dockerfile
2+
FROM almalinux:8.10-20250411
23
ARG llvm_dir=llvm-project
34
# Add the cache artifacts and the LLVM source tree to the container
45
ADD sccache /sccache
@@ -8,6 +9,7 @@ ENV SCCACHE_CACHE_SIZE="2G"
89

910
RUN dnf install --assumeyes llvm-toolset
1011
RUN dnf install --assumeyes python38-pip python38-devel git
12+
RUN alternatives --set python3 /usr/bin/python3.8
1113

1214
RUN python3 -m pip install --upgrade pip
1315
RUN python3 -m pip install --upgrade cmake ninja sccache lit
@@ -26,6 +28,8 @@ RUN cmake -GNinja -Bbuild \
2628
-DCMAKE_CXX_FLAGS="-Wno-everything" \
2729
-DCMAKE_LINKER=lld \
2830
-DCMAKE_INSTALL_PREFIX="/install" \
31+
-DPython3_EXECUTABLE="/usr/bin/python3.8" \
32+
-DPython_EXECUTABLE="/usr/bin/python3.8" \
2933
-DLLVM_BUILD_UTILS=ON \
3034
-DLLVM_BUILD_TOOLS=ON \
3135
-DLLVM_ENABLE_ASSERTIONS=ON \
@@ -34,6 +38,7 @@ RUN cmake -GNinja -Bbuild \
3438
-DLLVM_ENABLE_TERMINFO=OFF \
3539
-DLLVM_INSTALL_UTILS=ON \
3640
-DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU" \
41+
-DLLVM_ENABLE_ZSTD=OFF \
3742
/source/llvm-project/llvm
3843

3944
RUN ninja -C build install

0 commit comments

Comments
 (0)