Skip to content

Commit 652f994

Browse files
authored
Merge pull request #677 from coldav/colin/build_installed_llvm
Change llvm over to a choice of install or cache, default PRs to install
2 parents c24c971 + e0f02ae commit 652f994

File tree

4 files changed

+50
-5
lines changed

4 files changed

+50
-5
lines changed

.github/actions/setup_build/action.yml

+20-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ inputs:
2323
cross_arch:
2424
description: 'Cross compilation architecture from: x86, arm, aarch64, riscv64. Default: "none" (no cross compile), will auto fetch native arch'
2525
default: "none"
26-
26+
llvm_source:
27+
description: 'source to get llvm from - one of install or cache'
28+
default: "cache"
29+
2730
runs:
2831
# We don't want a new docker just a list of steps, so mark as composite
2932
using: "composite"
@@ -73,17 +76,31 @@ runs:
7376
cat $GITHUB_OUTPUT
7477
7578
- name: load llvm native
76-
if: inputs.cross_arch != 'none'
79+
if: inputs.llvm_source == 'cache'
7780
uses: actions/cache/restore@v4
7881
with:
7982
path: llvm_install/**
8083
key: llvm-${{ inputs.os }}-${{ steps.set_llvm_key.outputs.key_version }}-${{ steps.set_llvm_key.outputs.key_native_arch }}-v${{ inputs.llvm_version }}-${{ inputs.llvm_build_type }}
8184
fail-on-cache-miss: true
85+
86+
- name: install llvm native
87+
if: inputs.llvm_source == 'install'
88+
shell: bash
89+
run: |
90+
set -x
91+
sudo apt update
92+
93+
sudo apt install -y llvm-${{ inputs.llvm_version }}-dev liblld-${{ inputs.llvm_version }}-dev libclang-${{ inputs.llvm_version }}-dev
94+
sudo apt install -y libpolly-${{ inputs.llvm_version }}-dev clang-${{ inputs.llvm_version }}
95+
96+
ln -s /usr/lib/llvm-${{ inputs.llvm_version }} llvm_install
97+
8298
- shell: bash
8399
if: inputs.cross_arch != 'none'
84100
run: mv llvm_install llvm_install_native
85101

86-
- name: load llvm
102+
- name: load llvm cross
103+
if: inputs.cross_arch != 'none' && inputs.llvm_source == 'cache'
87104
uses: actions/cache/restore@v4
88105
with:
89106
path: llvm_install/**

.github/workflows/pr_tests_cache.yml

+7
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
llvm_version: ${{ env.llvm_previous }}
4949
llvm_build_type: RelAssert
5050
save: true
51+
llvm_source: install
5152

5253
- name: build host_x86_64
5354
uses: ./.github/actions/do_build_pr/run_host_x86_64
@@ -82,6 +83,7 @@ jobs:
8283
llvm_version: ${{ env.llvm_current }}
8384
llvm_build_type: RelAssert
8485
save: true
86+
llvm_source: install
8587

8688
- name: build ubuntu_gcc_x86_64_riscv_fp16_cl3_0
8789
uses: ./.github/actions/do_build_pr/run_ubuntu_gcc_x86_64_riscv_fp16_cl3_0
@@ -119,6 +121,9 @@ jobs:
119121
llvm_build_type: RelAssert
120122
save: true
121123
cross_arch: x86
124+
# Whilst we still have caches use this for 32 bit x86
125+
# We may have to drop this or run just this part as part of the nightly.
126+
llvm_source: cache
122127

123128
- name: build ubuntu_clang_x86_llvm_latest_cl3_0_offline
124129
uses: ./.github/actions/do_build_pr/run_ubuntu_clang_x86_llvm_latest_cl3_0_offline
@@ -145,6 +150,7 @@ jobs:
145150
llvm_version: ${{ env.llvm_current }}
146151
llvm_build_type: RelAssert
147152
save: true
153+
llvm_source: install
148154

149155
- name: build ubuntu_gcc_aarch64_llvm_latest_cl3_0_fp16
150156
uses: ./.github/actions/do_build_pr/run_ubuntu_gcc_aarch64_llvm_latest_cl3_0_fp16
@@ -172,6 +178,7 @@ jobs:
172178
llvm_build_type: RelAssert
173179
save: true
174180
os: windows
181+
llvm_source: cache
175182
- name: build windows_msvc_x86_64_llvm_latest_cl3_0_offline
176183
uses: ./.github/actions/do_build_pr/run_windows_msvc_x86_64_llvm_latest_cl3_0_offline
177184
with:

.github/workflows/run_pr_tests.yml

+22-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,23 @@ on:
77
required: false
88
type: boolean
99
default: true
10-
10+
llvm_source:
11+
required: false
12+
description: 'method of sourcing llvm (install or cache), currently advisory until all converted'
13+
type: string
14+
default: 'install'
1115
# Allows you to run this workflow manually from the Actions tab
1216
workflow_dispatch:
1317
inputs:
1418
is_pull_request:
1519
required: false
1620
type: bool
1721
default: true
22+
llvm_source:
23+
required: false
24+
type: string
25+
description: 'method of sourcing llvm (install or cache), currently advisory until all converted'
26+
default: 'install'
1827

1928
permissions:
2029
packages: read
@@ -38,6 +47,7 @@ jobs:
3847
with:
3948
llvm_version: 18
4049
llvm_build_type: RelAssert
50+
llvm_source: ${{ inputs.llvm_source}}
4151

4252
- name: build
4353
uses: ./.github/actions/do_build_pr/run_host_x86_64
@@ -72,6 +82,7 @@ jobs:
7282
with:
7383
llvm_version: 18
7484
llvm_build_type: RelAssert
85+
llvm_source: ${{ inputs.llvm_source}}
7586

7687
- name: build riscv M1
7788
uses: ./.github/actions/do_build_pr/run_riscv_m1
@@ -102,6 +113,7 @@ jobs:
102113
with:
103114
llvm_version: 19
104115
llvm_build_type: RelAssert
116+
llvm_source: ${{ inputs.llvm_source}}
105117

106118
- name: build initial config files
107119
uses: ./.github/actions/do_build_ock
@@ -173,6 +185,7 @@ jobs:
173185
llvm_version: 19
174186
llvm_build_type: RelAssert
175187
os: windows
188+
llvm_source: cache
176189

177190
- name: build and test ock
178191
uses: ./.github/actions/do_build_pr/run_windows_msvc_x86_64_llvm_latest_cl3_0_offline
@@ -195,11 +208,13 @@ jobs:
195208
with:
196209
llvm_version: '18'
197210
llvm_build_type: RelAssert
211+
llvm_source: ${{ inputs.llvm_source}}
198212
- name: build ock
199213
uses: ./.github/actions/do_build_pr/run_ubuntu_gcc_x86_64_riscv_fp16_cl3_0_unitcl_vecz
200214

201215
# Based on: mr-ubuntu-clang-x86-llvm-previous-cl3-0-offline
202216
run-ubuntu-clang-x86-llvm-latest-cl3-0-offline:
217+
if: ${{ !inputs.is_pull_request }} # do not run as PR job due to cross where we always install
203218
runs-on: ubuntu-22.04
204219
container:
205220
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04-x86-64:latest
@@ -215,6 +230,7 @@ jobs:
215230
llvm_version: '19'
216231
llvm_build_type: RelAssert
217232
cross_arch: x86
233+
llvm_source: ${{ inputs.llvm_source}}
218234
- name: build and run ock
219235
uses: ./.github/actions/do_build_pr/run_ubuntu_clang_x86_llvm_latest_cl3_0_offline
220236

@@ -234,6 +250,7 @@ jobs:
234250
with:
235251
llvm_version: '19'
236252
llvm_build_type: RelAssert
253+
llvm_source: ${{ inputs.llvm_source}}
237254
- name: build and run ock
238255
uses: ./.github/actions/do_build_pr/run_ubuntu_gcc_x86_64_riscv_fp16_cl3_0
239256

@@ -253,6 +270,7 @@ jobs:
253270
with:
254271
llvm_version: '19'
255272
llvm_build_type: Release
273+
llvm_source: ${{ inputs.llvm_source}}
256274
- name: build and run ock
257275
uses: ./.github/actions/do_build_pr/run_ubuntu_gcc_x86_llvm_latest_x86_64_images_cl3_0_release
258276

@@ -272,7 +290,8 @@ jobs:
272290
with:
273291
llvm_version: '19'
274292
llvm_build_type: RelAssert
275-
- name: build and run ock
293+
llvm_source: ${{ inputs.llvm_source}}
294+
- name: build and run ock
276295
uses: ./.github/actions/do_build_pr/run_ubuntu_gcc_aarch64_llvm_latest_cl3_0_fp16
277296

278297
# Based on a combination of: mr-ubuntu-gcc-x86_64-clik
@@ -316,6 +335,7 @@ jobs:
316335
with:
317336
llvm_version: '19'
318337
llvm_build_type: RelAssert
338+
llvm_source: ${{ inputs.llvm_source}}
319339
- name: build ock
320340
uses: ./.github/actions/do_build_pr/run_ubuntu_gcc_x86_64_refsi_g1_wi_cl3_0
321341

.github/workflows/run_pr_tests_caller.yml

+1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ jobs:
2929
uses: ./.github/workflows/run_pr_tests.yml
3030
with:
3131
is_pull_request: ${{ github.event_name != 'schedule' }}
32+
llvm_source: ${{ github.event_name != 'schedule' && 'install' || 'cache'}}
3233

3334
# additional ones here for cron and/or push to main - also can be in different file.

0 commit comments

Comments
 (0)