10000 Update to Ubuntu 20.04, add LLVM 14, Update Rust (#16) · awakecoding/llvm-prebuilt@7924558 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7924558

Browse files
awakecodingMarc-André Moreau
and
Marc-André Moreau
authored
Update to Ubuntu 20.04, add LLVM 14, Update Rust (#16)
* fix llvm 12 patch * major cleanup and update to include ubuntu 22.04 * improve Rust prebuilt workflow * try fixing llvm-prebuilt * update * try updating halide * fix darling * update Rust * update llvm * try adding llvm 14 * update Linux toolchain files * update patch for Rust * try fixing LLVM 14 * try escaping Windows path * try and fix lld exported targets Co-authored-by: Marc-André Moreau <mamoreau@devolutions.net>
1 parent 35e408a commit 7924558

14 files changed

+191
-75
lines changed

.github/workflows/cctools-prebuilt.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ jobs:
88
fail-fast: false
99
matrix:
1010
arch: [ x86_64 ]
11-
os: [ ubuntu-20.04 ]
11+
os: [ ubuntu-20.04, ubuntu-22.04 ]
1212

1313
include:
1414
- os: ubuntu-20.04
1515
runner: ubuntu-20.04
16+
- os: ubuntu-22.04
17+
runner: ubuntu-22.04
1618

1719
steps:
1820
- name: Configure Linux runner

.github/workflows/darling-prebuilt.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
2929
- name: Install clang+llvm
3030
run: |
31-
CLANG_LLVM_OS="ubuntu-$(lsb_release -rs)"
31+
CLANG_LLVM_OS="ubuntu-20.04"
3232
CLANG_LLVM_BASE_URL="https://github.com/awakecoding/llvm-prebuilt/releases/download/v2021.2.4"
3333
CLANG_LLVM_NAME="clang+llvm-12.0.1-x86_64-${CLANG_LLVM_OS}"
3434
wget -q "${CLANG_LLVM_BASE_URL}/${CLANG_LLVM_NAME}.tar.xz"
@@ -39,7 +39,7 @@ jobs:
3939
echo "CXX=clang++" >> $GITHUB_ENV
4040
4141
- name: Clone Darling
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
4343
with:
4444
repository: darlinghq/darling
4545
ref: master

.github/workflows/halide-prebuilt.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@ name: halide prebuilt
22
on: workflow_dispatch
33
jobs:
44
build:
5-
name: halide [${{matrix.arch}}-${{matrix.os}}]
5+
name: halide [${{matrix.arch}}-${{matrix.os}}-${{matrix.version}}]
66
runs-on: ${{matrix.runner}}
77
strategy:
88
fail-fast: false
99
matrix:
1010
arch: [ x86_64 ]
11-
os: [ windows, macos, ubuntu-20.04 ]
12-
version: [ 12.0.1 ]
11+
os: [ windows, macos, ubuntu-20.04, ubuntu-22.04 ]
12+
version: [ 12.0.1, 14.0.0 ]
1313

1414
include:
1515
- os: windows
16-
runner: windows-2022
16+
runner: windows-2019
1717
- os: macos
1818
runner: macos-latest
1919
- os: ubuntu-20.04
2020
runner: ubuntu-20.04
21+
- os: ubuntu-22.04
22+
runner: ubuntu-22.04
2123

2224
steps:
2325
- name: Configure Windows runner
@@ -65,7 +67,7 @@ jobs:
6567
- name: Install clang+llvm
6668
if: runner.os == 'Linux'
6769
run: |
68-
CLANG_LLVM_OS="ubuntu-$(lsb_release -rs)"
70+
CLANG_LLVM_OS="ubuntu-20.04"
6971
CLANG_LLVM_BASE_URL="https://github.com/awakecoding/llvm-prebuilt/releases/download/v2021.2.4"
7072
CLANG_LLVM_NAME="clang+llvm-12.0.1-x86_64-${CLANG_LLVM_OS}"
7173
wget -q "${CLANG_LLVM_BASE_URL}/${CLANG_LLVM_NAME}.tar.xz"

.github/workflows/llvm-prebuilt.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,23 @@ jobs:
88
fail-fast: false
99
matrix:
1010
arch: [ x86_64, aarch64 ]
11-
os: [ windows, macos, ubuntu-20.04 ]
12-
version: [ 12.0.1 ]
11+
os: [ windows, macos, ubuntu-20.04, ubuntu-22.04 ]
12+
version: [ 12.0.1, 14.0.6 ]
1313

1414
include:
1515
- version: 12.0.1
1616
branch: release/12.x
17+
- version: 14.0.6
18+
branch: release/14.x
1719

1820
- os: windows
1921
runner: windows-2022
2022
- os: macos
2123
runner: macos-latest
2224
- os: ubuntu-20.04
2325
runner: ubuntu-20.04
26+
- os: ubuntu-22.04
27+
runner: ubuntu-22.04
2428

2529
- arch: x86_64
2630
os: windows
@@ -47,19 +51,27 @@ jobs:
4751
brew install ninja
4852
echo "MACOSX_DEPLOYMENT_TARGET=10.12" >> $GITHUB_ENV
4953
50-
- name: Configure Ubuntu 20.04 runner
51-
if: matrix.os == 'ubuntu-20.04'
54+
- name: Configure Linux runner
55+
if: runner.os == 'Linux'
5256
shell: pwsh
5357
run: |
5458
sudo apt update
55-
sudo apt install xz-utils libxml2-dev
59+
sudo apt install zstd xz-utils libxml2-dev
5 10000 660
sudo apt install ninja-build
5761
sudo apt install g++-aarch64-linux-gnu
5862
mkdir libxml2-dev-arm64 && cd libxml2-dev-arm64
59-
$LibXmlDebFile = "libxml2-dev_2.9.10+dfsg-5ubuntu0.20.04.1_arm64.deb"
63+
$LibXmlDebFile = if ($(lsb_release -rs) -eq '20.04') {
64+
"libxml2-dev_2.9.10+dfsg-5ubuntu0.20.04.4_arm64.deb"
65+
} else {
66+
"libxml2-dev_2.9.13+dfsg-1build1_arm64.deb"
67+
}
6068
wget -q "http://ports.ubuntu.com/pool/main/libx/libxml2/$LibXmlDebFile"
6169
ar -x "$LibXmlDebFile"
62-
tar -xf data.tar.xz
70+
if (Test-Path 'data.tar.zst') {
71+
tar --use-compress-program=unzstd -xf data.tar.zst
72+
} else {
73+
tar -xf data.tar.xz
74+
}
6375
sudo cp -R ./usr/lib/aarch64-linux-gnu/ /usr/lib/aarch64-linux-gnu
6476
6577
- name: Clone project
@@ -75,8 +87,13 @@ jobs:
7587
path: llvm-project
7688

7789
- name: Patch LLVM
90+
shell: pwsh
7891
run: |
79-
git -C llvm-project apply ../llvm-prebuilt/patches/llvm-add-lld-install-targets.patch
92+
if ('${{matrix.version}}' -eq '12.0.1') {
93+
git -C llvm-project apply ../llvm-prebuilt/patches/llvm-12-add-lld-install-targets.patch
94+
} else {
95+
git -C llvm-project apply ../llvm-prebuilt/patches/llvm-14-add-lld-install-targets.patch
96+
}
8097
8198
- name: Enable Windows host environment
8299
if: runner.os == 'Windows'
@@ -99,6 +116,7 @@ jobs:
99116
echo "LLVM_TABLEGEN=$HostBinPath/llvm-tblgen$ExeExt" >> $Env:GITHUB_ENV
100117
echo "CLANG_TABLEGEN=$HostBinPath/clang-tblgen$ExeExt" >> $Env:GITHUB_ENV
101118
echo "LLVM_CONFIG_PATH=$HostBinPath/llvm-config$ExeExt" >> $Env:GITHUB_ENV
119+
echo "LLVM_VERSION=${{matrix.version}}" >> $Env:GITHUB_ENV
102120
103121
- name: Enable Windows target environment
104122
if: runner.os == 'Windows'

.github/workflows/msvc-bundle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on: workflow_dispatch
33
jobs:
44
build:
55
name: MSVC bundle
6-
runs-on: windows-2019
6+
runs-on: windows-2022
77
steps:
88
- name: Configure Windows runner
99
run: |

.github/workflows/rust-prebuilt.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: Rust prebuilt
22
on: workflow_dispatch
33
jobs:
44
build:
5-
name: Rust [${{matrix.arch}}-${{matrix.os}}]
5+
name: Rust [${{matrix.arch}}-${{matrix.os}}-${{matrix.version}}]
66
runs-on: ${{matrix.runner}}
77
strategy:
88
fail-fast: false
99
matrix:
1010
arch: [ x86_64 ]
11-
os: [ windows, macos, ubuntu-20.04 ]
12-
version: [ 1.63.0 ]
11+
os: [ windows, macos, ubuntu-20.04, ubuntu-22.04 ]
12+
version: [ 1.64.0 ]
1313

1414
include:
1515
- os: windows
@@ -18,6 +18,8 @@ jobs:
1818
runner: macos-latest
1919
- os: ubuntu-20.04
2020
runner: ubuntu-20.04
21+
- os: ubuntu-22.04
22+
runner: ubuntu-22.04
2123

2224
steps:
2325
- name: Configure Windows runner
@@ -26,6 +28,8 @@ jobs:
2628
run: |
2729
choco install ninja 7zip
2830
Install-Module VsDevShell -Force
31+
docker system prune -a -f # free some space on C:\
7802 32+
New-Item -Path "C:\rust" -ItemType Directory | Out-Null
2933
3034
- name: Configure macOS runner
3135
if: runner.os == 'macOS'
@@ -39,6 +43,13 @@ jobs:
3943
sudo apt update
4044
sudo apt install ninja-build xz-utils
4145
46+
- name: Setup dynamic variables
47+
id: dynamic-variables
48+
shell: pwsh
49+
run: |
50+
$RustBuildDir = if ($IsWindows) { "C:\rust" } else { "${{runner.temp}}" }
51+
echo "::set-output name=rust-build-dir::$RustBuildDir"
52+
4253
- name: Setup Python
4354
uses: actions/setup-python@v4
4455
with:
@@ -59,25 +70,28 @@ jobs:
5970
path: rust
6071

6172
- name: Patch Rust
73+
shell: pwsh
6274
run: |
63-
git -C rust apply ../llvm-prebuilt/patches/rust-allow-dynamic-linking-for-ios-targets.patch
64-
git -C rust apply ../llvm-prebuilt/patches/rust-bootstrap-add-dist-dirs-env-variables.patch
75+
git -C rust apply ../llvm-prebuilt/patches/rust-${{matrix.version}}-allow-dynamic-linking-for-ios-targets.patch
6576
6677
- name: Configure Rust
6778
shell: pwsh
6879
working-directory: rust
6980
run: |
81+
$RustBuildDir = "${{steps.dynamic-variables.outputs.rust-build-dir}}".Replace('\','\\')
7082
$config = @(
7183
"changelog-seen=2",
7284
"[llvm]",
7385
"download-ci-llvm=false",
7486
"ninja=true",
7587
"targets=`"X86;ARM;AArch64;WebAssembly`""
7688
"[build]",
89+
"docs=false",
90+
"build-dir=`"$RustBuildDir`"",
7791
"[install]",
78-
"prefix=`"/opt/rust`"",
7992
"[rust]",
80-
"[target.x86_64-unknown-linux-gnu]",
93+
"channel=`"stable`"",
94+
"dist-src=false",
8195
"[dist]",
8296
"src-tarball=false",
8397
"compression-formats=[`"xz`"]"
@@ -93,9 +107,6 @@ jobs:
93107
94108
- name: Package Rust
95109
shell: pwsh
96-
env:
97-
RUST_OUT_DIST_DIR: ${{ runner.temp }}/rust-dist
98-
RUST_TMP_DIST_DIR: ${{ runner.temp }}/temp-dist
99110
working-directory: rust
100111
run: |
101112
Remove-Item Env:GITHUB_ACTIONS
@@ -105,4 +116,4 @@ jobs:
105116
uses: actions/upload-artifact@v3
106117
with:
107118
name: rust-${{matrix.version}}-${{matrix.arch}}-${{matrix.os}}
108-
path: ${{ runner.temp }}/rust-dist
119+
path: ${{steps.dynamic-variables.outputs.rust-build-dir}}/build/dist

.github/workflows/xcode-bundle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on: workflow_dispatch
33
jobs:
44
build:
55
name: Xcode bundle
6-
runs-on: macos-10.15
6+
runs-on: macos-latest
77
steps:
88
- name: Copy Xcode toolchain
99
run: |
File renamed without changes.

cmake/llvm-distribution.cmake

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ if(DEFINED ENV{LLVM_CONFIG_PATH})
1818
message(STATUS "LLVM_CONFIG_PATH: ${LLVM_CONFIG_PATH}")
1919
endif()
2020

21+
if(DEFINED ENV{LLVM_VERSION})
22+
set(LLVM_VERSION $ENV{LLVM_VERSION} CACHE FILEPATH "")
23+
message(STATUS "LLVM_VERSION: ${LLVM_VERSION}")
24+
endif()
25+
2126
if(CMAKE_INSTALL_PREFIX)
2227
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
2328
endif()
@@ -112,18 +117,28 @@ set(LLVM_TOOLCHAIN_TOOLS
112117
${LLVM_BINUTILS_COMPONENTS}
113118
CACHE STRING "")
114119

115-
set(LLD_EXPORTED_TARGETS
116-
lldCommon
117-
lldCore
118-
lldDriver
119-
lldMachO
120-
lldYAML
121-
lldReaderWriter
122-
lldCOFF
123-
lldELF
124-
lldMachO2
125-
lldMinGW
126-
lldWasm)
120+
if (${LLVM_VERSION} STREQUAL "12.0.1")
121+
set(LLD_EXPORTED_TARGETS
122+
lldCommon
123+
lldCore
124+
lldDriver
125+
lldMachO
126+
lldYAML
127+
lldReaderWriter
128+
lldCOFF
129+
lldELF
130+
lldMachO2
131+
lldMinGW
132+
lldWasm)
133+
else()
134+
set(LLD_EXPORTED_TARGETS
135+
lldCommon
136+
lldCOFF
137+
lldELF
138+
lldMachO
139+
lldMinGW
140+
lldWasm)
141+
endif()
127142

128143
set(LLVM_DEVELOPMENT_COMPONENTS
129144
cmake-exports
File renamed without changes.

0 commit comments

Comments
 (0)
0