Skip to content

Commit

Permalink
ci: update llvm builder
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbaliasnikov committed May 1, 2024
1 parent 7c85964 commit bad7b95
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 34 deletions.
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: 'musl'
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}
6 changes: 3 additions & 3 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
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 +61,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 +86,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

0 comments on commit bad7b95

Please sign in to comment.