-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update setup and build instructions
[skip ci]
- Loading branch information
1 parent
757fdc9
commit 5f3e60d
Showing
4 changed files
with
378 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
name: 'Build LLVM' | ||
description: 'Builds backend LLVM framework' | ||
inputs: | ||
build-type: | ||
description: 'LLVM build type: debug | release' | ||
required: true | ||
default: 'release' | ||
target-env: | ||
description: 'Target environment (gnu or musl).' | ||
required: false | ||
default: 'gnu' | ||
llvm-builder-version: | ||
description: 'Version of the LLVM builder to use.' | ||
required: false | ||
default: '1.0.24' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Prepare environment | ||
if: runner.os == 'macOS' | ||
run: brew install cmake ninja | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
|
||
- name: Clone LLVM framework | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
run: | | ||
cargo install compiler-llvm-builder@${{ inputs.llvm-builder-version }} | ||
zkevm-llvm clone --target-env ${{ inputs.target-env }} | ||
- name: Define ccache key | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
id: ccache-key | ||
run: | | ||
LLVM_BRANCH="$(git -C ./llvm rev-parse --abbrev-ref HEAD)" | ||
LLVM_SHORT_SHA="$(git -C ./llvm rev-parse --short HEAD)" | ||
echo "key=llvm-${LLVM_BRANCH}-${LLVM_SHORT_SHA}-${{ runner.os }}-${{ runner.arch }}" | tee -a "${GITHUB_OUTPUT}" | ||
- name: Prepare ccache installation | ||
if: runner.os == 'Linux' | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
run: apt update | ||
|
||
- name: Set up compiler cache | ||
uses: hendrikmuhs/[email protected] | ||
env: | ||
CCACHE_BASEDIR: ${{ github.workspace }} | ||
CCACHE_NOHASHDIR: "true" | ||
CCACHE_COMPILERCHECK: "content" | ||
with: | ||
key: ${{ steps.ccache-key.outputs.key }} | ||
restore-keys: ${{ steps.ccache-key.outputs.key }} | ||
append-timestamp: false | ||
max-size: "2G" | ||
verbose: 2 | ||
save: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v') }} | ||
|
||
- 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: | | ||
[ "${{ inputs.build-type }}" = "debug" ] && DEBUG_ARG="--debug" | ||
zkevm-llvm build --use-ccache --target-env ${{ inputs.target-env }} ${DEBUG_ARG} | ||
name: 'Build LLVM' | ||
description: 'Builds backend LLVM framework' | ||
inputs: | ||
build-type: | ||
description: 'LLVM build type: debug | release' | ||
required: true | ||
default: 'release' | ||
target-env: | ||
description: 'Target environment (gnu or musl).' | ||
required: false | ||
default: 'gnu' | ||
llvm-builder-version: | ||
description: 'Version of the LLVM builder to use.' | ||
required: false | ||
default: '1.0.24' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Prepare environment | ||
if: runner.os == 'macOS' | ||
run: brew install cmake ninja | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
|
||
- name: Clone LLVM framework | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
run: | | ||
cargo install compiler-llvm-builder@${{ inputs.llvm-builder-version }} | ||
zksync-llvm clone --target-env ${{ inputs.target-env }} | ||
- name: Define ccache key | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
id: ccache-key | ||
run: | | ||
LLVM_BRANCH="$(git -C ./llvm rev-parse --abbrev-ref HEAD)" | ||
LLVM_SHORT_SHA="$(git -C ./llvm rev-parse --short HEAD)" | ||
echo "key=llvm-${LLVM_BRANCH}-${LLVM_SHORT_SHA}-${{ runner.os }}-${{ runner.arch }}" | tee -a "${GITHUB_OUTPUT}" | ||
- name: Prepare ccache installation | ||
if: runner.os == 'Linux' | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
run: apt update | ||
|
||
- name: Set up compiler cache | ||
uses: hendrikmuhs/[email protected] | ||
env: | ||
CCACHE_BASEDIR: ${{ github.workspace }} | ||
CCACHE_NOHASHDIR: "true" | ||
CCACHE_COMPILERCHECK: "content" | ||
with: | ||
key: ${{ steps.ccache-key.outputs.key }} | ||
restore-keys: ${{ steps.ccache-key.outputs.key }} | ||
append-timestamp: false | ||
max-size: "2G" | ||
verbose: 2 | ||
save: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v') }} | ||
|
||
- 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: | | ||
[ "${{ inputs.build-type }}" = "debug" ] && DEBUG_ARG="--debug" | ||
zksync-llvm build --use-ccache --target-env ${{ inputs.target-env }} ${DEBUG_ARG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.