ci: upgrade to llvm 19

This commit is contained in:
Li Jie
2025-04-02 20:08:05 +08:00
parent a6f1ad1c2c
commit ec20af3c4d
9 changed files with 34 additions and 32 deletions

View File

@@ -4,7 +4,7 @@ inputs:
llvm-version: llvm-version:
description: "LLVM version to install" description: "LLVM version to install"
required: true required: true
default: "18" default: "19"
runs: runs:
using: "composite" using: "composite"

View File

@@ -5,9 +5,9 @@ name: Go
on: on:
push: push:
branches: [ "**" ] branches: ["**"]
pull_request: pull_request:
branches: [ "**" ] branches: ["**"]
jobs: jobs:
test: test:
@@ -17,7 +17,7 @@ jobs:
os: os:
- macos-latest - macos-latest
- ubuntu-24.04 - ubuntu-24.04
llvm: [18] llvm: [19]
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
defaults: defaults:
run: run:
@@ -38,7 +38,7 @@ jobs:
- name: Set up Go - name: Set up Go
uses: ./.github/actions/setup-go uses: ./.github/actions/setup-go
with: with:
go-version: '1.24.0' go-version: "1.24.0"
- name: Build - name: Build
run: go build -v ./... run: go build -v ./...

View File

@@ -5,9 +5,9 @@ name: LLGo
on: on:
push: push:
branches: [ "**" ] branches: ["**"]
pull_request: pull_request:
branches: [ "**" ] branches: ["**"]
jobs: jobs:
download-model: download-model:
@@ -33,8 +33,8 @@ jobs:
os: os:
- macos-latest - macos-latest
- ubuntu-24.04 - ubuntu-24.04
llvm: [18] llvm: [19]
go: ['1.20.14', '1.21.13', '1.22.12', '1.23.6', '1.24.0'] go: ["1.20.14", "1.21.13", "1.22.12", "1.23.6", "1.24.0"]
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -58,7 +58,7 @@ jobs:
- name: Set up Go for build - name: Set up Go for build
uses: ./.github/actions/setup-go uses: ./.github/actions/setup-go
with: with:
go-version: '1.24.0' go-version: "1.24.0"
- name: Install - name: Install
working-directory: compiler working-directory: compiler
@@ -121,8 +121,8 @@ jobs:
os: os:
- macos-latest - macos-latest
- ubuntu-24.04 - ubuntu-24.04
llvm: [18] llvm: [19]
go: ['1.24.0'] go: ["1.24.0"]
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -141,7 +141,7 @@ jobs:
- name: Set up Go for build - name: Set up Go for build
uses: ./.github/actions/setup-go uses: ./.github/actions/setup-go
with: with:
go-version: '1.24.0' go-version: "1.24.0"
- name: Install - name: Install
working-directory: compiler working-directory: compiler
@@ -174,8 +174,8 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-24.04, macos-latest] os: [ubuntu-24.04, macos-latest]
llvm: [18] llvm: [19]
go: ['1.20.14', '1.21.13', '1.22.12', '1.23.6', '1.24.0'] go: ["1.20.14", "1.21.13", "1.22.12", "1.23.6", "1.24.0"]
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -187,7 +187,7 @@ jobs:
- name: Set up Go 1.23 for building llgo - name: Set up Go 1.23 for building llgo
uses: ./.github/actions/setup-go uses: ./.github/actions/setup-go
with: with:
go-version: '1.24.0' go-version: "1.24.0"
- name: Install llgo - name: Install llgo
working-directory: compiler working-directory: compiler
@@ -205,32 +205,32 @@ jobs:
uses: ./.github/actions/test-helloworld uses: ./.github/actions/test-helloworld
with: with:
go-version: ${{matrix.go}} go-version: ${{matrix.go}}
mod-version: '1.20' mod-version: "1.20"
- name: Test Hello World with go.mod 1.21 - name: Test Hello World with go.mod 1.21
if: startsWith(matrix.go, '1.21') || startsWith(matrix.go, '1.22') || startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') if: startsWith(matrix.go, '1.21') || startsWith(matrix.go, '1.22') || startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24')
uses: ./.github/actions/test-helloworld uses: ./.github/actions/test-helloworld
with: with:
go-version: ${{matrix.go}} go-version: ${{matrix.go}}
mod-version: '1.21' mod-version: "1.21"
- name: Test Hello World with go.mod 1.22 - name: Test Hello World with go.mod 1.22
if: startsWith(matrix.go, '1.22') || startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') if: startsWith(matrix.go, '1.22') || startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24')
uses: ./.github/actions/test-helloworld uses: ./.github/actions/test-helloworld
with: with:
go-version: ${{matrix.go}} go-version: ${{matrix.go}}
mod-version: '1.22' mod-version: "1.22"
- name: Test Hello World with go.mod 1.23 - name: Test Hello World with go.mod 1.23
if: startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') if: startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24')
uses: ./.github/actions/test-helloworld uses: ./.github/actions/test-helloworld
with: with:
go-version: ${{matrix.go}} go-version: ${{matrix.go}}
mod-version: '1.23' mod-version: "1.23"
- name: Test Hello World with go.mod 1.24 - name: Test Hello World with go.mod 1.24
if: startsWith(matrix.go, '1.24') if: startsWith(matrix.go, '1.24')
uses: ./.github/actions/test-helloworld uses: ./.github/actions/test-helloworld
with: with:
go-version: ${{matrix.go}} go-version: ${{matrix.go}}
mod-version: '1.24' mod-version: "1.24"

View File

@@ -6,12 +6,12 @@ TMPDIR="$(mktemp -d)"
export TMPDIR export TMPDIR
trap 'rm -rf "${TMPDIR}"' EXIT trap 'rm -rf "${TMPDIR}"' EXIT
DARWIN_AMD64_LLVM_PREFIX=.sysroot/darwin/amd64/usr/local/opt/llvm@18 DARWIN_AMD64_LLVM_PREFIX=.sysroot/darwin/amd64/usr/local/opt/llvm@19
DARWIN_ARM64_LLVM_PREFIX=.sysroot/darwin/arm64/opt/homebrew/opt/llvm@18 DARWIN_ARM64_LLVM_PREFIX=.sysroot/darwin/arm64/opt/homebrew/opt/llvm@19
mkdir -p "${DARWIN_AMD64_LLVM_PREFIX}" "${DARWIN_ARM64_LLVM_PREFIX}" mkdir -p "${DARWIN_AMD64_LLVM_PREFIX}" "${DARWIN_ARM64_LLVM_PREFIX}"
BREW_LLVM_FORMULA_JSON="$(mktemp)" BREW_LLVM_FORMULA_JSON="$(mktemp)"
curl -fsSL https://formulae.brew.sh/api/formula/llvm@18.json > "${BREW_LLVM_FORMULA_JSON}" curl -fsSL https://formulae.brew.sh/api/formula/llvm@19.json > "${BREW_LLVM_FORMULA_JSON}"
BREW_LLVM_AMD64_BOTTLE_URL=$(jq -r '.bottle.stable.files.sonoma.url' "${BREW_LLVM_FORMULA_JSON}") BREW_LLVM_AMD64_BOTTLE_URL=$(jq -r '.bottle.stable.files.sonoma.url' "${BREW_LLVM_FORMULA_JSON}")
BREW_LLVM_ARM64_BOTTLE_URL=$(jq -r '.bottle.stable.files.arm64_sonoma.url' "${BREW_LLVM_FORMULA_JSON}") BREW_LLVM_ARM64_BOTTLE_URL=$(jq -r '.bottle.stable.files.arm64_sonoma.url' "${BREW_LLVM_FORMULA_JSON}")
curl -fsSL -H "Authorization: Bearer QQ==" "${BREW_LLVM_AMD64_BOTTLE_URL}" | tar -xzf - --strip-components=2 -C "${DARWIN_AMD64_LLVM_PREFIX}" curl -fsSL -H "Authorization: Bearer QQ==" "${BREW_LLVM_AMD64_BOTTLE_URL}" | tar -xzf - --strip-components=2 -C "${DARWIN_AMD64_LLVM_PREFIX}"

View File

@@ -19,10 +19,10 @@ export DEBIAN_FRONTEND=noninteractive
apt-get update apt-get update
apt-get install -y lsb-release gnupg2 wget rsync apt-get install -y lsb-release gnupg2 wget rsync
echo "deb http://apt.llvm.org/\$(lsb_release -cs)/ llvm-toolchain-\$(lsb_release -cs)-18 main" | tee /etc/apt/sources.list.d/llvm.list echo "deb http://apt.llvm.org/\$(lsb_release -cs)/ llvm-toolchain-\$(lsb_release -cs)-19 main" | tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
apt-get update apt-get update
apt-get install -y llvm-18-dev apt-get install -y llvm-19-dev
error() { error() {
echo -e "\$1" >&2 echo -e "\$1" >&2

1
.gitignore vendored
View File

@@ -22,6 +22,7 @@ _tinygo/
_output/ _output/
build.dir/ build.dir/
.vscode/ .vscode/
.venv/
# Test binary, built with `go test -c` # Test binary, built with `go test -c`
*.test *.test

View File

@@ -359,7 +359,7 @@ Follow these steps to generate the `llgo` command (its usage is the same as the
```sh ```sh
brew update brew update
brew install llvm@18 bdw-gc openssl cjson libffi libuv pkg-config brew install llvm@19 bdw-gc openssl cjson libffi libuv pkg-config
brew install python@3.12 # optional brew install python@3.12 # optional
brew link --force libffi brew link --force libffi
curl https://raw.githubusercontent.com/goplus/llgo/refs/heads/main/install.sh | bash curl https://raw.githubusercontent.com/goplus/llgo/refs/heads/main/install.sh | bash
@@ -373,12 +373,13 @@ curl https://raw.githubusercontent.com/goplus/llgo/refs/heads/main/install.sh |
<!-- embedme doc/_readme/scripts/install_ubuntu.sh#L2-L1000 --> <!-- embedme doc/_readme/scripts/install_ubuntu.sh#L2-L1000 -->
```sh ```sh
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-18 main" | sudo tee /etc/apt/sources.list.d/llvm.list echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-19 main" | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update sudo apt-get update
sudo apt-get install -y llvm-18-dev clang-18 libclang-18-dev lld-18 pkg-config libgc-dev libssl-dev zlib1g-dev libcjson-dev libsqlite3-dev libunwind-dev libuv1-dev sudo apt-get install -y llvm-19-dev clang-19 libclang-19-dev lld-19 pkg-config libgc-dev libssl-dev zlib1g-dev libcjson-dev libsqlite3-dev libunwind-dev libuv1-dev
sudo apt-get install -y python3.12-dev # optional sudo apt-get install -y python3.12-dev # optional
curl https://raw.githubusercontent.com/goplus/llgo/refs/heads/main/install.sh | bash curl https://raw.githubusercontent.com/goplus/llgo/refs/heads/main/install.sh | bash
``` ```
#### Alpine Linux #### Alpine Linux

View File

@@ -1,6 +1,6 @@
# shellcheck disable=all # shellcheck disable=all
brew update brew update
brew install llvm@18 bdw-gc openssl cjson libffi libuv pkg-config brew install llvm@19 bdw-gc openssl cjson libffi libuv pkg-config
brew install python@3.12 # optional brew install python@3.12 # optional
brew link --force libffi brew link --force libffi
curl https://raw.githubusercontent.com/goplus/llgo/refs/heads/main/install.sh | bash curl https://raw.githubusercontent.com/goplus/llgo/refs/heads/main/install.sh | bash

View File

@@ -1,7 +1,7 @@
# shellcheck disable=all # shellcheck disable=all
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-18 main" | sudo tee /etc/apt/sources.list.d/llvm.list echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-19 main" | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update sudo apt-get update
sudo apt-get install -y llvm-18-dev clang-18 libclang-18-dev lld-18 pkg-config libgc-dev libssl-dev zlib1g-dev libcjson-dev libsqlite3-dev libunwind-dev libuv1-dev sudo apt-get install -y llvm-19-dev clang-19 libclang-19-dev lld-19 pkg-config libgc-dev libssl-dev zlib1g-dev libcjson-dev libsqlite3-dev libunwind-dev libuv1-dev
sudo apt-get install -y python3.12-dev # optional sudo apt-get install -y python3.12-dev # optional
curl https://raw.githubusercontent.com/goplus/llgo/refs/heads/main/install.sh | bash curl https://raw.githubusercontent.com/goplus/llgo/refs/heads/main/install.sh | bash