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: shared jobs with msys2 windows build [0.8.14] #718

Merged
merged 3 commits into from
Oct 21, 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
96 changes: 0 additions & 96 deletions .github/actions/solc-build/action.yml

This file was deleted.

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-64core
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 32 --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.77.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.77.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.77.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
2 changes: 1 addition & 1 deletion cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
endif()

# The major alternative compiler to GCC/Clang is Microsoft's Visual C++ compiler, only available on Windows.
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Windows") # FIXME: This breaks the MSVC build
if (DEFINED MSVC) # FIXME: This breaks the MSVC build
# Remove NDEBUG from RELWITHDEBINFO (to enable asserts)
# CMAKE_CXX_FLAGS_RELWITHDEBINFO for GCC/Clang does not include NDEBUG
string(REPLACE "/DNDEBUG" " " CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
Expand Down
1 change: 1 addition & 0 deletions liblangutil/Token.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

#include <liblangutil/UndefMacros.h>

#include <cstdint>
#include <iosfwd>
#include <string>
#include <tuple>
Expand Down
1 change: 1 addition & 0 deletions libsolutil/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#error "Unsupported Boost version. At least 1.65 required."
#endif

#include <cstdint>
#include <map>
#include <utility>
#include <vector>
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
1 change: 1 addition & 0 deletions libyul/backends/wasm/BinaryTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <libsolutil/Common.h>

#include <cstdint>
#include <vector>
#include <stack>

Expand Down