From bad7b95014c0b03d11c8650b2d73a532f253c031 Mon Sep 17 00:00:00 2001 From: Anton Baliasnikov Date: Wed, 1 May 2024 16:38:49 +0100 Subject: [PATCH] ci: update llvm builder --- .github/actions/build-llvm/action.yml | 42 ++++++++------------------- .github/workflows/benchmarks.yml | 6 ++-- .github/workflows/tests.yaml | 2 +- 3 files changed, 16 insertions(+), 34 deletions(-) diff --git a/.github/actions/build-llvm/action.yml b/.github/actions/build-llvm/action.yml index e491caf7..d80c67c3 100644 --- a/.github/actions/build-llvm/action.yml +++ b/.github/actions/build-llvm/action.yml @@ -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: @@ -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' }} @@ -55,21 +50,7 @@ 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 }} @@ -77,4 +58,5 @@ runs: 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} diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index dae4224d..77286ce3 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -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' }} @@ -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: | @@ -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 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index df715cf7..8fed9ed8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -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