Skip to content

Commit 9a2363a

Browse files
committed
Add GitHub workflow for Arch Linux package validation on tag push
Runs on tag creation (v*) using an archlinux:latest container. Derives the matching LLVM release/N.x branch from the tag's major version, builds eld targets, and verifies all expected outputs exist. No binary artifacts are published. Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
1 parent 7d90f12 commit 9a2363a

1 file changed

Lines changed: 91 additions & 0 deletions

File tree

.github/workflows/arch-package.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Arch Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
arch-pkgbuild:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: archlinux:latest
13+
14+
steps:
15+
- name: Install build dependencies
16+
run: |
17+
pacman -Syu --noconfirm base-devel cmake ninja clang python git
18+
19+
- name: Derive LLVM branch from tag
20+
id: llvm
21+
run: |
22+
TAG="${GITHUB_REF_NAME}"
23+
# Extract major version: v22.1.0-rc1 -> 22
24+
MAJOR="${TAG#v}"
25+
MAJOR="${MAJOR%%.*}"
26+
echo "branch=release/${MAJOR}.x" >> "$GITHUB_OUTPUT"
27+
echo "Using LLVM branch: release/${MAJOR}.x for tag ${TAG}"
28+
29+
- name: Checkout eld
30+
uses: actions/checkout@v4
31+
with:
32+
path: eld-src
33+
34+
- name: Checkout llvm-project
35+
uses: actions/checkout@v4
36+
with:
37+
repository: llvm/llvm-project
38+
ref: ${{ steps.llvm.outputs.branch }}
39+
path: llvm-project
40+
41+
- name: Set up build tree
42+
run: |
43+
ln -sfn "${GITHUB_WORKSPACE}/eld-src" \
44+
"${GITHUB_WORKSPACE}/llvm-project/llvm/tools/eld"
45+
46+
- name: Configure
47+
working-directory: ${{ github.workspace }}
48+
run: |
49+
cmake -G Ninja \
50+
-DCMAKE_BUILD_TYPE=Release \
51+
-DCMAKE_INSTALL_PREFIX=/usr \
52+
-DCMAKE_C_COMPILER=clang \
53+
-DCMAKE_CXX_COMPILER=clang++ \
54+
-DLLVM_ENABLE_PROJECTS='llvm;clang' \
55+
-DLLVM_TARGETS_TO_BUILD='ARM;AArch64;RISCV;Hexagon;X86' \
56+
-DLLVM_ENABLE_ASSERTIONS=OFF \
57+
-DELD_ENABLE_SYMBOL_VERSIONING=ON \
58+
-Wno-dev \
59+
-B obj \
60+
-S llvm-project/llvm
61+
62+
- name: Build eld
63+
run: |
64+
cmake --build obj --target ld.eld
65+
cmake --build obj --target LW
66+
cmake --build obj --target LSParserVerifier
67+
68+
- name: Verify build outputs
69+
run: |
70+
echo "--- Binaries ---"
71+
test -x obj/bin/ld.eld
72+
test -x obj/bin/LSParserVerifier
73+
test -f obj/lib/libLW.so.4
74+
test -L obj/lib/libLW.so
75+
76+
echo "--- Version ---"
77+
obj/bin/ld.eld --version
78+
79+
echo "--- Symlinks ---"
80+
for link in arm-link aarch64-link hexagon-link riscv-link x86_64-link; do
81+
test -L "obj/bin/${link}" || test -x "obj/bin/${link}"
82+
done
83+
84+
echo "--- Plugin headers ---"
85+
test -f obj/tools/eld/include/eld/PluginAPI/PluginBase.h
86+
87+
echo "All arch package build outputs verified."
88+
89+
- name: Clean up
90+
if: always()
91+
run: rm -rf obj llvm-project eld-src

0 commit comments

Comments
 (0)