Skip to content

Commit aa4ce2d

Browse files
committed
[LDC] CI: Simplify clang installation via apt.llvm.org repo, and ninja install
1 parent ea4e84c commit aa4ce2d

File tree

2 files changed

+23
-41
lines changed

2 files changed

+23
-41
lines changed

.github/actions/1-setup/action.yml

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: Install prerequisites
22
inputs:
3-
clang_version:
4-
required: true
53
arch:
64
required: true
75
runs:
@@ -17,50 +15,45 @@ runs:
1715
export DEBIAN_FRONTEND=noninteractive
1816
sudo apt-get -q update
1917
sudo -E apt-get -yq install \
20-
git-core curl xz-utils ninja-build g++ python3 pkgconf binutils-dev libxml2-dev libzstd-dev zlib1g-dev p7zip-full unzip
18+
git-core curl xz-utils g++ python3 pkgconf binutils-dev libxml2-dev libzstd-dev zlib1g-dev p7zip-full unzip \
19+
lsb-release wget software-properties-common gnupg # prerequisites of apt.llvm.org install script
2120
22-
# install a recent CMake version (Ubuntu 20's too old)
23-
curl -fL --retry 3 --max-time 300 -o cmake.tar.gz \
24-
https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-${{ inputs.arch }}.tar.gz
25-
mkdir cmake
26-
tar -xf cmake.tar.gz --strip 1 -C cmake
27-
rm cmake.tar.gz
28-
sudo ln -sf $PWD/cmake/bin/cmake /usr/bin/cmake
21+
# install a more recent CMake version in the AArch64 container (Ubuntu 20's too old)
22+
arch='${{ inputs.arch }}'
23+
if [[ $arch == aarch64 ]]; then
24+
curl -fL --retry 3 --max-time 300 -o cmake.tar.gz \
25+
https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-$arch.tar.gz
26+
mkdir cmake
27+
tar -xf cmake.tar.gz --strip 1 -C cmake
28+
rm cmake.tar.gz
29+
sudo ln -sf $PWD/cmake/bin/cmake /usr/bin/cmake
30+
fi
2931
30-
- name: 'Linux: Download & extract clang' # into ../clang
32+
- name: 'Linux: Install clang 19 from apt.llvm.org'
3133
if: runner.os == 'Linux'
3234
shell: bash
3335
run: |
3436
set -eux
3537
cd ..
36-
version='${{ inputs.clang_version }}'
37-
arch='${{ inputs.arch }}'
38-
extraSuffix=''
39-
if [[ $arch == x86_64 ]]; then
40-
extraSuffix='-ubuntu-18.04'
41-
fi
42-
curl -fL --retry 3 --max-time 300 -o clang.tar.xz \
43-
https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/clang+llvm-$version-$arch-linux-gnu$extraSuffix.tar.xz
44-
mkdir clang
45-
tar -xf clang.tar.xz --strip 1 -C clang
46-
rm clang.tar.xz
47-
clang/bin/clang --version
38+
curl -fL --retry 3 --max-time 30 -O https://apt.llvm.org/llvm.sh
39+
sudo bash llvm.sh 19
4840
4941
# use it as C(++) compiler for future steps
50-
echo "CC=$PWD/clang/bin/clang" >> $GITHUB_ENV
51-
echo "CXX=$PWD/clang/bin/clang++" >> $GITHUB_ENV
42+
echo "CC=clang-19" >> $GITHUB_ENV
43+
echo "CXX=clang++-19" >> $GITHUB_ENV
5244
5345
# make bundled lld the default linker
54-
sudo ln -sf "$PWD/clang/bin/ld.lld" /usr/bin/ld
46+
sudo ln -sf ld.lld-19 /usr/bin/ld
5547
ld --version
56-
- name: 'Windows: Install clang'
48+
49+
- name: 'Windows: Install clang v19.1.3 from GitHub'
5750
if: runner.os == 'Windows'
5851
shell: bash
5952
run: |
6053
set -eux
6154
cd ..
6255
curl -fL --retry 3 --max-time 300 -o clang.exe \
63-
https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ inputs.clang_version }}/LLVM-${{ inputs.clang_version }}-win64.exe
56+
https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.3/LLVM-19.1.3-win64.exe
6457
./clang.exe //S # double-slash for bash
6558
rm clang.exe
6659
@@ -78,9 +71,8 @@ runs:
7871
echo "ASMFLAGS=-m32" >> $GITHUB_ENV
7972
fi
8073
81-
- name: 'Non-Linux: Install ninja'
82-
if: runner.os != 'Linux'
83-
uses: seanmiddleditch/gha-setup-ninja@v4
74+
- name: Install ninja v1.12.1
75+
uses: Ahajha/gha-setup-ninja@69595b0cf872acdad8ce599142fbdc88724b9a2b
8476

8577
- name: 'Windows: Set LDC_VSDIR env variable'
8678
if: runner.os == 'Windows'

.github/workflows/ldc-release.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
env:
14-
# no recent official clang packages for Ubuntu 20
15-
CLANG_VERSION: 15.0.6
1614
# Prevent dependencies on some purely optional libraries, and a dependency on clang
1715
# for compiler-rt tests.
1816
BASE_CMAKE_FLAGS: >-
@@ -33,22 +31,18 @@ jobs:
3331
os: windows-2022
3432
arch: x64
3533
with_asserts: false
36-
clang_version: 19.1.3 # the MSVC headers require clang 16+
3734
- job_name: Windows x64 withAsserts
3835
os: windows-2022
3936
arch: x64
4037
with_asserts: true
41-
clang_version: 19.1.3 # the MSVC headers require clang 16+
4238
- job_name: Windows x86
4339
os: windows-2022
4440
arch: x86
4541
with_asserts: false
46-
clang_version: 19.1.3 # the MSVC headers require clang 16+
4742
- job_name: Windows x86 withAsserts
4843
os: windows-2022
4944
arch: x86
5045
with_asserts: true
51-
clang_version: 19.1.3 # the MSVC headers require clang 16+
5246
- job_name: Linux x86_64
5347
os: ubuntu-20.04
5448
arch: x86_64
@@ -62,13 +56,11 @@ jobs:
6256
container_image: ubuntu:20.04
6357
arch: aarch64
6458
with_asserts: false
65-
clang_version: 15.0.3 # 15.0.6 requires a more recent libstdc++.so.6 than shipped with Ubuntu 20
6659
- job_name: Linux aarch64 withAsserts
6760
os: ubuntu-22.04-arm # Ubuntu 20 not natively supported
6861
container_image: ubuntu:20.04
6962
arch: aarch64
7063
with_asserts: true
71-
clang_version: 15.0.3 # 15.0.6 requires a more recent libstdc++.so.6 than shipped with Ubuntu 20
7264
- job_name: macOS arm64
7365
os: macos-15
7466
arch: arm64
@@ -103,7 +95,6 @@ jobs:
10395
- name: Install prerequisites
10496
uses: ./.github/actions/1-setup
10597
with:
106-
clang_version: ${{ matrix.clang_version || env.CLANG_VERSION }}
10798
arch: ${{ matrix.arch }}
10899
# BOLT supports ELF binaries only, so include it for Linux packages only
109100
- name: Build & install LLVM incl. LLD, compiler-rt${{ runner.os == 'Linux' && ', BOLT' || '' }}
@@ -156,7 +147,6 @@ jobs:
156147
- name: Install prerequisites
157148
uses: ./.github/actions/1-setup
158149
with:
159-
clang_version: ${{ env.CLANG_VERSION }}
160150
arch: x86_64
161151
- name: Build native llvm-tblgen
162152
shell: bash

0 commit comments

Comments
 (0)