diff --git a/.github/actions/solc-build/action.yml b/.github/actions/solc-build/action.yml deleted file mode 100644 index 6c575d305e..0000000000 --- a/.github/actions/solc-build/action.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: 'Build' -description: 'Builds solc executable.' -inputs: - release-suffix: - description: 'Release suffix.' - required: false - default: '' - zksync-version: - description: 'Release version.' - required: true - solc-version: - description: 'Solidity version.' - required: true - build-type: - description: 'Build type: candidate or reference' - required: false - default: 'candidate' - extra-args: - description: 'Extra arguments for cmake.' - required: false - default: '' -runs: - using: "composite" - steps: - - - name: Install Boost (MacOS ARM64) - if: runner.os == 'macOS' - shell: bash - env: - BOOST_DOWNLOAD_URL: "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source" - BOOST_FILENAME: "boost_1_71_0" - run: | - curl -L -o ${BOOST_FILENAME}.tar.gz "${BOOST_DOWNLOAD_URL}/${BOOST_FILENAME}.tar.gz" - tar xzf "${BOOST_FILENAME}.tar.gz" && cd ${BOOST_FILENAME} - if [ ${RUNNER_ARCH} = ARM64 ]; then - ./bootstrap.sh --prefix=${PWD}/boost - else - ./bootstrap.sh --prefix=/usr/local --with-python-version=2.7 - fi - ./b2 link=static runtime-link=static -j$(sysctl -n hw.ncpu) - ./b2 install -j$(sysctl -n hw.ncpu) - - - name: Build solc - shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} - env: - CXXFLAGS: "-Wno-narrowing" - CMAKE_CXX_FLAGS: "-DJSON_USE_INT64_DOUBLE_CONVERSION" - run: | - mkdir -p ./build - cd ./build - [ ${RUNNER_OS} = macOS ] && PARALLEL=$(sysctl -n hw.ncpu) || PARALLEL=$(nproc) - [ ${RUNNER_OS} = Linux ] && COMPILER_FLAGS="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++" - cmake .. \ - -DCMAKE_BUILD_TYPE="Release" ${COMPILER_FLAGS} \ - -DSOL_VERSION_ZKSYNC="${{ inputs.solc-version }}-${{ inputs.zksync-version }}" \ - -DSOLC_VERSION_ZKEVM="${{ inputs.solc-version }}-${{ inputs.zksync-version }}" \ - -DSOL_VERSION_ZKEVM="${{ inputs.solc-version }}-${{ inputs.zksync-version }}" \ - -DUSE_Z3=OFF \ - -DUSE_CVC4=OFF \ - -DTESTS=0 \ - -DBoost_NO_BOOST_CMAKE=TRUE \ - -DSOLC_LINK_STATIC=1 \ - -DSTATIC_LINKING=1 \ - -DPEDANTIC=OFF ${{ inputs.extra-args}} - if [[ ${{ inputs.solc-version}} == "0.4"* ]]; then - cmake --build . --config Release --parallel ${PARALLEL} --target jsoncpp-project - cmake --build . --config Release --parallel ${PARALLEL} --target range-v3-project - fi - cmake --build . --config Release --parallel ${PARALLEL} --target solc - [ "$RUNNER_OS" = "Windows" ] && WIN_SUFFIX=".exe" - cp ./solc/solc${WIN_SUFFIX} ./solc/solc-${{ inputs.solc-version }}-${{ inputs.build-type }}${WIN_SUFFIX} - - - name: Upload binary for testing - if: inputs.release-suffix == '' - uses: actions/upload-artifact@v4 - with: - name: solc-${{ inputs.solc-version }}-${{ inputs.build-type }} - path: ./build/solc/solc-${{ inputs.solc-version }}-${{ inputs.build-type }} - - - name: Prepare binary - if: inputs.release-suffix != '' - shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} - run: | - [ "$RUNNER_OS" = "Windows" ] && WIN_SUFFIX=".exe" - SOLC_BIN="./build/solc/solc${WIN_SUFFIX}" - mkdir -p ./releases/${{ inputs.release-suffix }} - strip "${SOLC_BIN}" - ${SOLC_BIN} --version - mv ${SOLC_BIN} ./releases/${{ inputs.release-suffix }}/solc-${{ inputs.release-suffix }}-${{ inputs.solc-version}}-${{ inputs.zksync-version }}${WIN_SUFFIX} - - - name: Upload binary for release - if: inputs.release-suffix != '' - uses: actions/upload-artifact@v4 - with: - name: release-${{ inputs.release-suffix }} - path: releases diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index a176d7b624..8fe41f6ced 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.77.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..2ced77b132 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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 diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index 89884ed7e1..17219dfde8 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -53,9 +53,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA add_compile_options(-Wsign-conversion) add_compile_options(-Wconversion) - eth_add_cxx_compiler_flag_if_supported( - $<$:-Wextra-semi> - ) eth_add_cxx_compiler_flag_if_supported(-Wfinal-dtor-non-final-class) eth_add_cxx_compiler_flag_if_supported(-Wnewline-eof) eth_add_cxx_compiler_flag_if_supported(-Wsuggest-destructor-override) @@ -149,7 +146,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}") diff --git a/liblangutil/Token.h b/liblangutil/Token.h index eb8015f4d4..9364d6790a 100644 --- a/liblangutil/Token.h +++ b/liblangutil/Token.h @@ -44,6 +44,7 @@ #include +#include #include #include #include diff --git a/libsolutil/Common.h b/libsolutil/Common.h index 5c78146137..24a86d9c59 100644 --- a/libsolutil/Common.h +++ b/libsolutil/Common.h @@ -45,6 +45,7 @@ #error "Unsupported Boost version. At least 1.65 required." #endif +#include #include #include #include diff --git a/libyul/YulString.h b/libyul/YulString.h index 5522e34849..8dd96c97b4 100644 --- a/libyul/YulString.h +++ b/libyul/YulString.h @@ -23,6 +23,7 @@ #include +#include #include #include #include diff --git a/libyul/backends/wasm/BinaryTransform.h b/libyul/backends/wasm/BinaryTransform.h index d164c11bf6..820bcd990b 100644 --- a/libyul/backends/wasm/BinaryTransform.h +++ b/libyul/backends/wasm/BinaryTransform.h @@ -25,6 +25,7 @@ #include +#include #include #include