Skip to content

Commit ef49e7f

Browse files
committed
ci: switch to ubuntu 22.04 + KyleMayes/install-llvm-action
Vendored z3 4.16 needs C++20. Ubuntu 20.04's gcc-9 is missing <span> and macOS's Apple Clang chokes on z3's templates. Install LLVM 18 via KyleMayes/install-llvm-action and route cc-rs / cmake through it (CC=clang, CXX=clang++). Skip the action on Windows where MSVC builds z3 fine. Drop the now-unneeded git-core PPA and libclang-dev/llvm-dev apt packages; 22.04 ships git 2.34+ which doesn't have the sparse-checkout bug.
1 parent 73893ef commit ef49e7f

1 file changed

Lines changed: 31 additions & 15 deletions

File tree

.github/workflows/release.yaml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
include:
2222
- target: x86_64-unknown-linux-gnu
2323
os: ubuntu-latest
24-
container: ubuntu:20.04
24+
container: ubuntu:22.04
2525
artifact: movy-linux-amd64
2626
archive: tar.gz
2727
- target: aarch64-unknown-linux-gnu
2828
os: ubuntu-22.04-arm
29-
container: ubuntu:20.04
29+
container: ubuntu:22.04
3030
artifact: movy-linux-arm64
3131
archive: tar.gz
3232
- target: x86_64-apple-darwin
@@ -48,23 +48,15 @@ jobs:
4848
runs-on: ${{ matrix.os }}
4949
container: ${{ matrix.container }}
5050
steps:
51-
- name: Install container dependencies (Ubuntu 20.04)
52-
if: matrix.container == 'ubuntu:20.04'
51+
- name: Install Ubuntu container dependencies
52+
if: matrix.container == 'ubuntu:22.04'
5353
shell: bash
5454
run: |
5555
apt-get update
5656
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
5757
curl ca-certificates xz-utils sudo gnupg \
58-
software-properties-common
59-
# The git that ships with 20.04 (2.25.1) has sparse-checkout bugs
60-
# that break move-package's git fetcher; pull a newer one from the
61-
# git-core PPA.
62-
add-apt-repository -y ppa:git-core/ppa
63-
apt-get update
64-
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
65-
git \
66-
build-essential cmake pkg-config python3 \
67-
libssl-dev libclang-dev clang llvm-dev
58+
git build-essential cmake pkg-config python3 \
59+
libssl-dev
6860
6961
- name: Install macOS dependencies
7062
if: runner.os == 'macOS'
@@ -74,10 +66,28 @@ jobs:
7466
- name: Install Windows dependencies
7567
if: runner.os == 'Windows'
7668
shell: pwsh
77-
run: choco install -y cmake llvm
69+
run: choco install -y cmake
7870

7971
- uses: actions/checkout@v4
8072

73+
# Vendored z3 needs C++20; Apple Clang chokes on z3's templates and
74+
# the stock distro clang on older runners is too old. Install a recent
75+
# LLVM toolchain everywhere except Windows (which uses MSVC) and route
76+
# cc-rs / cmake through it.
77+
- name: Install LLVM toolchain
78+
if: runner.os != 'Windows'
79+
uses: KyleMayes/install-llvm-action@v2
80+
with:
81+
version: "18"
82+
env: true
83+
84+
- name: Use installed clang as C/C++ compiler
85+
if: runner.os != 'Windows'
86+
shell: bash
87+
run: |
88+
echo "CC=clang" >> "$GITHUB_ENV"
89+
echo "CXX=clang++" >> "$GITHUB_ENV"
90+
8191
- name: Install Rust toolchain (unix)
8292
if: runner.os != 'Windows'
8393
shell: bash
@@ -121,6 +131,12 @@ jobs:
121131
shell: bash
122132
run: |
123133
export PATH="$HOME/.cargo/bin:$PATH"
134+
if [[ "${{ matrix.target }}" == "x86_64-apple-darwin" ]]; then
135+
# Cross-compile from arm64 macOS runner -> x86_64. Tell cmake to
136+
# build z3 as x86_64 and bindgen's clang to use the x86_64 SDK.
137+
export CMAKE_OSX_ARCHITECTURES=x86_64
138+
export BINDGEN_EXTRA_CLANG_ARGS="--target=x86_64-apple-darwin"
139+
fi
124140
cargo build --release --locked --target "${{ matrix.target }}" -p movy
125141
126142
- name: Build (windows)

0 commit comments

Comments
 (0)