Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update llvm builder #17

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 12 additions & 30 deletions .github/actions/build-llvm/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: 'Build LLVM'
description: 'Builds backend LLVM framework'
inputs:
target:
description: 'Specific build target triplet.'
build-type:
description: 'LLVM build type: debug | release'
required: true
default: 'release'
target-env:
description: 'Target environment (gnu or musl).'
required: false
default: ''
default: 'gnu'
runs:
using: "composite"
steps:
Expand All @@ -13,20 +17,11 @@ runs:
run: brew install cmake ninja
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}

- name: Define build target
id: build-target
if: inputs.target != ''
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
run: |
rustup target add ${{ inputs.target }}
echo "target=--target ${{ inputs.target }}" >> $GITHUB_OUTPUT

- name: Clone LLVM framework
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
run: |
cargo install compiler-llvm-builder ${{ steps.build-target.outputs.target }} \
--git https://github.com/matter-labs/era-compiler-llvm-builder
zkevm-llvm clone
cargo install compiler-llvm-builder
zkevm-llvm clone --target-env ${{ inputs.target-env }}

- name: Define ccache key
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
Expand Down Expand Up @@ -55,26 +50,13 @@ runs:
verbose: 2
save: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v') }}

- name: Build LLVM Linux
if: ${{ runner.os == 'Linux' }}
uses: nick-fields/retry@v2
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_NOHASHDIR: "true"
CCACHE_COMPILERCHECK: "content"
LIBSTDCPP_SOURCE_PATH: "C:/a/_temp/msys64/mingw64/lib/libstdc++.a"
with:
timeout_minutes: 60
max_attempts: 16 # protection mechanism for sporadic dependencies download failure
command: zkevm-llvm build --targets 'EVM' --use-ccache

- name: Build LLVM MacOS and Windows
if: ${{ runner.os != 'Linux' }}
- name: Build LLVM
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_NOHASHDIR: "true"
CCACHE_COMPILERCHECK: "content"
LIBSTDCPP_SOURCE_PATH: "C:/a/_temp/msys64/mingw64/lib/libstdc++.a"
run: |
zkevm-llvm build --targets 'EVM' --use-ccache
[ "${{ inputs.build-type }}" = "debug" ] && DEBUG_ARG="--debug"
zkevm-llvm build --use-ccache --target-env ${{ inputs.target-env }} ${DEBUG_ARG}
7 changes: 4 additions & 3 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ concurrency:
jobs:
benchmarks:
strategy:
fail-fast: false
matrix:
type: ["reference", "candidate"]
name: ${{ matrix.type }}
runs-on: matterlabs-ci-runner
container:
image: matterlabs/llvm_runner:ubuntu22-llvm15-latest
image: matterlabs/llvm_runner:ubuntu22-llvm17-latest
options: -m 110g
env:
LLVM_BENCHMARK_MODE: ${{ github.event.inputs.compiler_llvm_benchmark_mode || '^M^B3' }}
Expand All @@ -61,7 +62,7 @@ jobs:
- name: Build LLVM
uses: ./.github/actions/build-llvm
with:
debug: ${{ github.event.inputs.llvm_build_type || 'release' }}
build-type: ${{ github.event.inputs.llvm_build_type || 'release' }}

- name: Benchmark
run: |
Expand All @@ -86,7 +87,7 @@ jobs:
permissions:
pull-requests: write
container:
image: matterlabs/llvm_runner:ubuntu22-llvm15-latest
image: matterlabs/llvm_runner:ubuntu22-llvm17-latest
needs: benchmarks
steps:
- name: Checking out the compiler-tester repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: [self-hosted, ci-runner-compiler]
timeout-minutes: 720
container:
image: matterlabs/llvm_runner:ubuntu22-llvm15-latest
image: matterlabs/llvm_runner:ubuntu22-llvm17-latest
options: -m 110g
steps:
- name: Checkout
Expand Down
Loading