diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index a176d7b624..09c0f17d31 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -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 || '' }} @@ -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 "runner@github.com" - 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.74.0 release: runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') - needs: [build, build-windows] + needs: build steps: - name: Checkout diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bb008ee8ed..ffb4351d26 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -82,20 +82,16 @@ jobs: SOLC_VERSION=$(grep 'PROJECT_VERSION' CMakeLists.txt | grep -oP '(\d+\.\d+\.\d+)') echo "solc-version=${SOLC_VERSION}" | tee -a "${GITHUB_OUTPUT}" - - name: Building the Solidity compiler - if: matrix.type == 'candidate' - uses: ./.github/actions/solc-build - with: - solc-version: ${{ steps.project_version.outputs.solc-version }} - zksync-version: 1.0.${{ github.run_id }} - build-type: ${{ matrix.type }} + - name: Prepare Windows env + if: runner.os == 'Windows' + uses: matter-labs/era-compiler-ci/.github/actions/prepare-msys@v1 - 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 }} + solc-version: ${{ steps.project_version.outputs.solc-version }} + boost-version: 1.74.0 build-type: ${{ matrix.type }} # Integration tests workflow call from the era-compiler-ci repository diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index c78231ad65..6f102865b3 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -140,7 +140,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 add_compile_options(/MP) # enable parallel compilation add_compile_options(/EHsc) # specify Exception Handling Model in msvc diff --git a/liblangutil/SourceLocation.h b/liblangutil/SourceLocation.h index e6f97942ea..ec31ed9d45 100644 --- a/liblangutil/SourceLocation.h +++ b/liblangutil/SourceLocation.h @@ -29,6 +29,9 @@ #include #include +#include +#include +#include namespace solidity::langutil { diff --git a/libsolutil/Common.h b/libsolutil/Common.h index f2d9c1d843..e1b2e89483 100644 --- a/libsolutil/Common.h +++ b/libsolutil/Common.h @@ -46,6 +46,7 @@ #include +#include #include #include #include diff --git a/libyul/YulString.h b/libyul/YulString.h index 9166cff3d5..0a4c7b7edb 100644 --- a/libyul/YulString.h +++ b/libyul/YulString.h @@ -22,6 +22,8 @@ #include +#include + #include #include #include diff --git a/libyul/backends/wasm/BinaryTransform.h b/libyul/backends/wasm/BinaryTransform.h index d4e4375c28..ec74670d6d 100644 --- a/libyul/backends/wasm/BinaryTransform.h +++ b/libyul/backends/wasm/BinaryTransform.h @@ -24,6 +24,7 @@ #include +#include #include #include diff --git a/libyul/backends/wasm/WasmObjectCompiler.h b/libyul/backends/wasm/WasmObjectCompiler.h index c5932a976b..6a8eee3bb2 100644 --- a/libyul/backends/wasm/WasmObjectCompiler.h +++ b/libyul/backends/wasm/WasmObjectCompiler.h @@ -20,6 +20,7 @@ #pragma once +#include #include #include #include