diff --git a/.github/workflows/arm_runner.yml b/.github/workflows/arm_runner.yml index 74155f00e0..c361391dbb 100644 --- a/.github/workflows/arm_runner.yml +++ b/.github/workflows/arm_runner.yml @@ -17,43 +17,52 @@ on: - "README.md" release: types: [published, created, edited] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true env: CCACHE_DIR: ${{ github.workspace }}/ccache jobs: build: name: build_arm - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] + runs-on: self-hosted-arm-2.0 steps: - uses: actions/checkout@v4 with: fetch-depth: 5 - - uses: actions/cache@v3 id: cache with: - path: $RUNNER_TEMP/deps/src - key: deps-v10-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }} + path: deps/src + key: deps-aarch64-v0-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/arm_runner.yml') }} restore-keys: | - deps-v10-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }} - deps-v10-${{ runner.temp }}-${{ github.base_ref }}- - deps-v10-${{ runner.temp }}- - - uses: pguyot/arm-runner-action@v2 + deps-aarch64-v0-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/arm_runner.yml') }} + deps-aarch64-v0-${{ runner.temp }}-${{ github.base_ref }}- + deps-aarch64-v0-${{ runner.temp }}- + - name: install ubuntu dependencies + run: sudo apt install -y g++ libssl-dev openssl git build-essential autoconf texinfo flex patch bison libgmp-dev zlib1g-dev automake libtool curl && sudo apt -y remove libtbb-dev + - name: Setup cmake + run: curl -sSL https://cmake.org/files/v3.21/cmake-3.21.0-linux-aarch64.tar.gz | sudo tar -xzC /usr + - name: configure + run: export PATH=$PATH:/usr/cmake-3.21.0-linux-aarch64/bin;cmake . + - name: compile + run: make -j4 + - name: tar fisco-bcos for ubuntu + run: cp tools/build_chain.sh bin/ && cd bin && strip fisco-bcos && tar -zcf fisco-bcos.tar.gz fisco-bcos build_chain.sh + - uses: actions/upload-artifact@v4 + with: + name: fisco-bcos.tar.gz + path: bin/fisco-bcos.tar.gz + - name: run uint tests + run: CTEST_OUTPUT_ON_FAILURE=TRUE make test + - name: configure without tbb + run: export PATH=$PATH:/usr/cmake-3.21.0-linux-aarch64/bin;cmake . -DWITH_TBB=OFF + - name: compile + run: make -j4 + - name: tar fisco-bcos for ubuntu + run: cp tools/build_chain.sh bin/ && cd bin && strip fisco-bcos && tar -zcf fisco-bcos.tar.gz fisco-bcos build_chain.sh + - uses: actions/upload-artifact@v4 with: - base_image: raspios_lite_arm64:latest - commands: | - # install ubuntu dependencies - sudo apt install -y g++ libssl-dev openssl git build-essential autoconf texinfo flex patch bison libgmp-dev zlib1g-dev automake libtool cmake - # configure and compile - cmake . -DTESTS=ON -DARCH_NATIVE=ON; make -j2 - # run test - CTEST_OUTPUT_ON_FAILURE=TRUE make test - # - name: tar fisco-bcos for Linux - # run: cp tools/build_chain.sh bin/ && cd bin && strip fisco-bcos && tar -zcf fisco-bcos.tar.gz fisco-bcos build_chain.sh - # - uses: actions/upload-artifact@v2 - # with: - # name: fisco-bcos.tar.gz - # path: bin/fisco-bcos.tar.gz + name: fisco-bcos-without-tbb.tar.gz + path: bin/fisco-bcos.tar.gz diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a7abb62e37..efc7bdc6ee 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -17,16 +17,16 @@ on: - "README.md" release: types: [published, created, edited] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true env: CCACHE_DIR: ${{ github.workspace }}/ccache jobs: build: name: build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: @@ -73,11 +73,8 @@ jobs: name: fisco-bcos.tar.gz path: bin/fisco-bcos.tar.gz build_macOS: - name: build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest] + name: build_macOS + runs-on: macos-latest steps: - uses: actions/checkout@v2 with: @@ -105,9 +102,13 @@ jobs: ccache-v4-${{ runner.temp }}- - name: install macOS dependencies if: runner.os == 'macOS' - run: brew install openssl@1.1 ccache gmp cmake zlib + run: brew install openssl@1.1 ccache gmp zlib cmake + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v2 + # with: + # cmake-version: '3.21.0' - name: configure - run: CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -DTESTS=ON -DCMAKE_BUILD_TYPE=Release . + run: cmake -DTESTS=ON . - name: compile run: make -j2 - name: run uint tests @@ -147,6 +148,10 @@ jobs: ccache-v2-notest-${{ runner.temp }}- - name: install macOS dependencies run: brew install openssl@1.1 ccache cmake + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v2 + # with: + # cmake-version: '3.21.0' - name: configure run: cmake . - name: compile @@ -189,13 +194,13 @@ jobs: - name: install ubuntu dependencies run: sudo apt install -y g++ libssl-dev openssl git build-essential autoconf texinfo flex patch bison libgmp-dev zlib1g-dev automake libtool && sudo apt -y remove libtbb-dev - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.14 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.21.0' - name: configure run: cmake . -DBUILD_STATIC=ON - name: compile - run: make -j2 + run: export SDKROOT="`xcrun --show-sdk-path`";make -j2 - name: run integration testing run: cd tools && bash ci/ci_check.sh - name: tar fisco-bcos for Linux diff --git a/cmake/Options.cmake b/cmake/Options.cmake index ba5950cefa..9188625862 100644 --- a/cmake/Options.cmake +++ b/cmake/Options.cmake @@ -61,11 +61,15 @@ macro(configure_project) #ARCH TYPE eth_default_option(ARCH_NATIVE OFF) set(USE_LD_GOLD ON) + # if aarch64 set arch_native on + if("${ARCHITECTURE}" STREQUAL "aarch64" OR "${ARCHITECTURE}" STREQUAL "arm64") + set(ARCH_NATIVE ON) + endif() if(ARCH_NATIVE) if(APPLE) set(MARCH_TYPE "-mtune=generic -fvisibility=hidden -fvisibility-inlines-hidden") else() - set(MARCH_TYPE "-march=native -mtune=generic -fvisibility=hidden -fvisibility-inlines-hidden") + set(MARCH_TYPE "-march=native") set(USE_LD_GOLD OFF) endif() set(COMPILE_OPTIONS "native") @@ -106,6 +110,9 @@ macro(configure_project) endif() eth_default_option(WITH_URING OFF) eth_default_option(WITH_TBB ON) + if(TESTS) + set(WITH_TBB ON) + endif() if (WITH_TBB) add_definitions(-DWITH_TBB) endif() diff --git a/cmake/ProjectBoost.cmake b/cmake/ProjectBoost.cmake index 45aac28c75..30d42df7bd 100644 --- a/cmake/ProjectBoost.cmake +++ b/cmake/ProjectBoost.cmake @@ -54,7 +54,7 @@ ExternalProject_Add(boost DOWNLOAD_NO_PROGRESS 1 URL https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85_0.tar.bz2 https://jaist.dl.sourceforge.net/project/boost/boost/1.85.0/boost_1_85_0.tar.bz2 - # https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/FISCO-BCOS/FISCO-BCOS/deps/boost_1_85_0.tar.bz2 + https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/FISCO-BCOS/FISCO-BCOS/deps/boost_1_85_0.tar.bz2 URL_HASH SHA256=7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617 BUILD_IN_SOURCE 1 CONFIGURE_COMMAND ${BOOST_BOOTSTRAP_COMMAND} diff --git a/cmake/ProjectCryptopp.cmake b/cmake/ProjectCryptopp.cmake index c5890aa5d5..a06b8f2915 100644 --- a/cmake/ProjectCryptopp.cmake +++ b/cmake/ProjectCryptopp.cmake @@ -152,8 +152,8 @@ ExternalProject_Add(cryptopp -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} BUILD_COMMAND ${CMAKE_COMMAND} --build --config Release INSTALL_COMMAND ${CMAKE_COMMAND} --build --config Release --target install - LOG_CONFIGURE 1 - LOG_BUILD 1 + LOG_CONFIGURE 0 + LOG_BUILD 0 LOG_INSTALL 1 ${_overwrite_install_command} BUILD_BYPRODUCTS "${CRYPTOPP_LIBRARY}" diff --git a/cmake/ProjectEVMC.cmake b/cmake/ProjectEVMC.cmake index 3a5d3e4983..4faaf88224 100644 --- a/cmake/ProjectEVMC.cmake +++ b/cmake/ProjectEVMC.cmake @@ -1,6 +1,12 @@ include(ExternalProject) include(GNUInstallDirs) +if (APPLE) + set(SED_CMMAND sed -i .bkp) +else() + set(SED_CMMAND sed -i) +endif() + ExternalProject_Add(evmc PREFIX ${CMAKE_SOURCE_DIR}/deps DOWNLOAD_NO_PROGRESS 1 @@ -10,6 +16,7 @@ ExternalProject_Add(evmc URL_HASH SHA256=bc75110885ac5524dcbe8af0d3670add5b414697d8154ec2e885b1d6806f9332 # GIT_REPOSITORY https://github.com/FISCO-BCOS/evmc.git # GIT_TAG e0bd9d5dc68ec3a00fe9a3c5e81c98946449a20d + PATCH_COMMAND ${SED_CMMAND} "s#evmc_last_error_msg()#evmc_last_error_msg(void)#g" include/evmc/loader.h COMMAND ${SED_CMMAND} "s#evmc_last_error_msg()#evmc_last_error_msg(void)#g" lib/loader/loader.c CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DHUNTER_USE_CACHE_SERVERS=NO BUILD_IN_SOURCE 1 diff --git a/cmake/ProjectJsonCpp.cmake b/cmake/ProjectJsonCpp.cmake index 93f5f333f2..f1a044ec7c 100644 --- a/cmake/ProjectJsonCpp.cmake +++ b/cmake/ProjectJsonCpp.cmake @@ -46,8 +46,8 @@ ExternalProject_Add(jsoncpp -DJSONCPP_WITH_STRICT_ISO=OFF -DCMAKE_C_FLAGS=-Wno-error -Wno-implicit-int-float-conversion #-Wa,-march=generic64 -DCMAKE_CXX_FLAGS=-Wno-error -Wno-implicit-int-float-conversion #-Wa,-march=generic64 - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -Wno-error - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -Wno-error + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} LOG_CONFIGURE 1 LOG_BUILD 1 BUILD_COMMAND "" diff --git a/cmake/ProjectTBB.cmake b/cmake/ProjectTBB.cmake index 250fbc20b5..88945c1ac1 100644 --- a/cmake/ProjectTBB.cmake +++ b/cmake/ProjectTBB.cmake @@ -5,10 +5,16 @@ if (APPLE) set(ENABLE_STD_LIB stdlib=libc++) endif() +if(WITH_TBB) + set(TBB_BUILD_CMD make extra_inc=big_iron.inc ${ENABLE_STD_LIB}) +else() + set(TBB_BUILD_CMD "") +endif() + ExternalProject_Add(tbb PREFIX ${CMAKE_SOURCE_DIR}/deps DOWNLOAD_NO_PROGRESS 1 - DOWNLOAD_NAME v2021.6.0-rc1 + DOWNLOAD_NAME oneTBB-2021.12.0.tar.gz # TODO: add wb cdn link URL https://codeload.github.com/oneapi-src/oneTBB/tar.gz/refs/tags/v2021.12.0 https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/FISCO-BCOS/FISCO-BCOS/deps/oneTBB-2021.12.tar.gz @@ -27,19 +33,23 @@ ExternalProject_Add(tbb -DTBB_EXAMPLES=OFF -DTBB_BENCH=OFF #CONFIGURE_COMMAND "" - BUILD_COMMAND make extra_inc=big_iron.inc ${ENABLE_STD_LIB} + BUILD_COMMAND ${TBB_BUILD_CMD} INSTALL_COMMAND bash -c "/bin/cp -f */libtbb.${TBB_LIB_SUFFIX}* ${CMAKE_SOURCE_DIR}/deps/lib/" BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/deps/lib/libtbb.${TBB_LIB_SUFFIX} ) ExternalProject_Get_Property(tbb SOURCE_DIR) -add_library(TBB STATIC IMPORTED) set(TBB_INCLUDE_DIR ${SOURCE_DIR}/include) set(TBB_LIBRARY ${CMAKE_SOURCE_DIR}/deps/lib/libtbb.${TBB_LIB_SUFFIX}) file(MAKE_DIRECTORY ${TBB_INCLUDE_DIR}) # Must exist. file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/deps/lib/) # Must exist. - -set_property(TARGET TBB PROPERTY IMPORTED_LOCATION ${TBB_LIBRARY}) -set_property(TARGET TBB PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIR}) +if (WITH_TBB) + add_library(TBB STATIC IMPORTED) + set_property(TARGET TBB PROPERTY IMPORTED_LOCATION ${TBB_LIBRARY}) + set_property(TARGET TBB PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIR}) +else() + add_library(TBB INTERFACE) + target_include_directories(TBB INTERFACE ${TBB_INCLUDE_DIR}) +endif() add_dependencies(TBB tbb) unset(SOURCE_DIR) diff --git a/test/unittests/libstorage/test_CachedStorage.cpp b/test/unittests/libstorage/test_CachedStorage.cpp index c5c1e8b24b..bd283ce8cf 100644 --- a/test/unittests/libstorage/test_CachedStorage.cpp +++ b/test/unittests/libstorage/test_CachedStorage.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +// #include #include #include #include diff --git a/test/unittests/libstorage/test_Entry.cpp b/test/unittests/libstorage/test_Entry.cpp index 7063b97070..c285fcaaba 100644 --- a/test/unittests/libstorage/test_Entry.cpp +++ b/test/unittests/libstorage/test_Entry.cpp @@ -22,7 +22,7 @@ #include "Common.h" #include #include -#include +// #include #include using namespace dev; diff --git a/test/unittests/libstorage/test_MemoryTable2.cpp b/test/unittests/libstorage/test_MemoryTable2.cpp index 3ef7a95dae..0c6580976b 100644 --- a/test/unittests/libstorage/test_MemoryTable2.cpp +++ b/test/unittests/libstorage/test_MemoryTable2.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/tools/build_chain.sh b/tools/build_chain.sh index 016f3baff5..afe329bd49 100755 --- a/tools/build_chain.sh +++ b/tools/build_chain.sh @@ -1327,7 +1327,7 @@ while getopts "v:V:f" option;do esac done -default_version=2.10.0 +default_version=2.11.0 download_version=\${default_version} sm_crypto=\$(cat "\${SHELL_FOLDER}"/node*/config.ini | grep sm_crypto_channel= | cut -d = -f 2 | head -n 1) download_link=https://github.com/FISCO-BCOS/console/releases/download/v\${download_version}/\${package_name}