Skip to content

Commit

Permalink
ci: shared jobs with msys2 windows build (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbaliasnikov authored Oct 21, 2024
1 parent a63571d commit 284c13f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 77 deletions.
86 changes: 11 additions & 75 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,16 @@ jobs:
runner: [self-hosted, macOS, ARM64]
release-suffix: macosx-arm64
- name: "Linux x86"
runner: matterlabs-ci-runner
runner: matterlabs-ci-runner-high-performance
image: matterlabs/llvm_runner:ubuntu20-llvm17-latest
release-suffix: linux-amd64
- name: "Linux ARM64"
runner: matterlabs-ci-runner-arm
image: matterlabs/llvm_runner:ubuntu20-llvm17-latest
release-suffix: linux-arm64
- name: Windows
runner: windows-2019-github-hosted-64core
release-suffix: windows-amd64
runs-on: ${{ matrix.runner }}
container:
image: ${{ matrix.image || '' }}
Expand All @@ -89,89 +92,22 @@ jobs:
with:
submodules: recursive

- name: Prepare Windows env
if: runner.os == 'Windows'
uses: matter-labs/era-compiler-ci/.github/actions/prepare-msys@v1

- name: Building the Solidity compiler
uses: ./.github/actions/solc-build
uses: matter-labs/era-compiler-ci/.github/actions/build-solc@v1
with:
release-suffix: ${{ matrix.release-suffix }}
zksync-version: ${{ needs.setup.outputs.zksync-version }}
solc-version: ${{ needs.setup.outputs.solc-version }}

build-windows:
name: Windows
needs: setup
if: needs.setup.outputs.skip-windows == 'false'
runs-on: windows-2019-github-hosted-16core
steps:

- name: Checkout source
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "15.0.7"

- name: Prepare environment
run: |
git config --global user.email "[email protected]"
git fetch --all
# try to apply win patch
git cherry-pick 860226e25dca397b5afd70680530963712aff050 || git cherry-pick --abort
# latest llvm for MSVC
git clone -q --depth=1 --branch=main https://github.com/zufuliu/llvm-utils.git c:\projects\llvm-utils
Invoke-Item "c:\projects\llvm-utils\VS2017\install.bat"
clang --version
- name: Install windows Deps
run: |
if ( -not (Test-Path "deps\boost") ) {
New-Item -ItemType Directory -Force -Path "deps"
Invoke-WebRequest -URI "https://github.com/Kitware/CMake/releases/download/v3.27.1/cmake-3.27.1-windows-x86_64.zip" -OutFile cmake.zip
tar -xf cmake.zip
mv cmake-3.27.1-windows-x86_64 "deps\cmake"
# and serving it a page that requires JavaScript.
Invoke-WebRequest -URI "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.zip" -OutFile boost.zip
tar -xf boost.zip
cd boost_1_77_0
.\bootstrap.bat --with-toolset=clang
.\b2 -j4 -d0 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" link=static runtime-link=static variant=release threading=multi address-model=64 --prefix="..\deps\boost" --with-filesystem --with-system --with-program_options --with-test --with-regex --with-thread install
if ( -not $? ) { throw "Error building boost." }
cd ..
}
- name: Building the Solidity compiler
run: |
$env:path += ";deps\cmake\bin\"
$env:CXXFLAGS="-Wno-narrowing -Qunused-arguments -Wno-everything -DBOOST_REGEX_NO_LIB -D_REGEX_MAX_STACK_COUNT=200000L -DJSON_USE_INT64_DOUBLE_CONVERSION -std=c++17 -stdlib=libc++"
mkdir build
cd build
$boost_dir=(Resolve-Path ..\deps\boost\lib\cmake\Boost-*)
cmake .. -D SOL_VERSION_ZKSYNC="${{ needs.setup.outputs.zksync-version }}" -D USE_Z3="OFF" -DBoost_DIR="$boost_dir\" -DBoost_USE_STATIC_RUNTIME=1 -DBoost_USE_STATIC_LIBS=1 -DBoost_COMPILER=clang15 -T LLVM_v142 -DPEDANTIC=OFF -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
cmake --build . -j 16 --target install --config Release
- name: Prepare binary file name
run: |
mkdir -p releases\windows-amd64
ls .\build\solc\Release\
.\build\solc\Release\solc.exe --version
mv .\build\solc\Release\solc.exe releases\windows-amd64\solc-windows-amd64-${{ needs.setup.outputs.solc-version }}-${{ needs.setup.outputs.zksync-version }}.exe
- uses: actions/upload-artifact@v4
with:
name: release-windows-amd64
path: releases
boost-version: 1.83.0

release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [build, build-windows]
needs: build
steps:

- name: Checkout
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,21 @@ jobs:
- name: Building the Solidity compiler
if: matrix.type == 'candidate'
uses: ./.github/actions/solc-build
uses: matter-labs/era-compiler-ci/.github/actions/build-solc@v1
with:
solc-version: ${{ steps.project_version.outputs.solc-version }}
zksync-version: 1.0.${{ github.run_id }}
build-type: ${{ matrix.type }}
boost-version: 1.83.0

- name: Building the Solidity compiler
if: matrix.type == 'reference'
uses: matter-labs/era-solidity/.github/actions/solc-build@latest-ci
uses: matter-labs/era-compiler-ci/.github/actions/build-solc@v1
with:
solc-version: ${{ steps.project_version.outputs.solc-version }}
zksync-version: 1.0.${{ github.run_id }}
build-type: ${{ matrix.type }}
boost-version: 1.83.0

# Integration tests workflow call from the era-compiler-ci repository
# This is a common part of the integration tests workflow for all repositories
Expand Down
1 change: 1 addition & 0 deletions libyul/YulString.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <fmt/format.h>

#include <cstdint>
#include <unordered_map>
#include <memory>
#include <vector>
Expand Down

0 comments on commit 284c13f

Please sign in to comment.