diff --git a/.circleci/build_win.ps1 b/.circleci/build_win.ps1 index 9be967c97..730bb6319 100644 --- a/.circleci/build_win.ps1 +++ b/.circleci/build_win.ps1 @@ -20,7 +20,7 @@ cd build $boost_dir=(Resolve-Path $PSScriptRoot\..\deps\boost\lib\cmake\Boost-*) ..\deps\cmake\bin\cmake -G "Visual Studio 16 2019" -DBoost_DIR="$boost_dir\" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="$PSScriptRoot\..\upload" -DUSE_Z3=OFF .. if ( -not $? ) { throw "CMake configure failed." } -msbuild solidity.sln /p:Configuration=Release /m:5 /v:minimal +msbuild solidity.sln /p:Configuration=Release /m:10 /v:minimal if ( -not $? ) { throw "Build failed." } -..\deps\cmake\bin\cmake --build . -j 5 --target install --config Release +..\deps\cmake\bin\cmake --build . -j 10 --target install --config Release if ( -not $? ) { throw "Install target failed." } diff --git a/.circleci/config.yml b/.circleci/config.yml index cadd37ab2..5a8968dea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -226,6 +226,14 @@ defaults: - image: << pipeline.parameters.ubuntu-1604-clang-ossfuzz-docker-image >> environment: TERM: xterm + MAKEFLAGS: -j 3 + + - base_ubuntu1604_clang_small: &base_ubuntu1604_clang_small + <<: *base_ubuntu1604_clang + resource_class: small + environment: + TERM: xterm + MAKEFLAGS: -j 2 - base_ubuntu2004_clang: &base_ubuntu2004_clang docker: @@ -236,20 +244,44 @@ defaults: CXX: clang++ MAKEFLAGS: -j 3 - - base_ubuntu2004_clang_xlarge: &base_ubuntu2004_clang_xlarge + - base_ubuntu2004_clang_small: &base_ubuntu2004_clang_small <<: *base_ubuntu2004_clang - resource_class: xlarge + resource_class: small environment: TERM: xterm CC: clang CXX: clang++ - MAKEFLAGS: -j 10 + MAKEFLAGS: -j 2 + + - base_ubuntu2004_clang_large: &base_ubuntu2004_clang_large + <<: *base_ubuntu2004_clang + resource_class: large + environment: + TERM: xterm + CC: clang + CXX: clang++ + MAKEFLAGS: -j 5 - base_ubuntu2004: &base_ubuntu2004 docker: - image: << pipeline.parameters.ubuntu-2004-docker-image >> environment: TERM: xterm + MAKEFLAGS: -j 3 + + - base_ubuntu2004_small: &base_ubuntu2004_small + <<: *base_ubuntu2004 + resource_class: small + environment: + TERM: xterm + MAKEFLAGS: -j 2 + + - base_ubuntu2004_large: &base_ubuntu2004_large + <<: *base_ubuntu2004 + resource_class: large + environment: + TERM: xterm + MAKEFLAGS: -j 5 - base_ubuntu2004_xlarge: &base_ubuntu2004_xlarge <<: *base_ubuntu2004 @@ -258,29 +290,48 @@ defaults: TERM: xterm MAKEFLAGS: -j 10 - - base_buildpack_focal: &base_buildpack_focal + - base_buildpack_focal_small: &base_buildpack_focal_small docker: - image: buildpack-deps:focal + resource_class: small environment: TERM: xterm + MAKEFLAGS: -j 2 - - base_buildpack_latest: &base_buildpack_latest + - base_buildpack_latest_small: &base_buildpack_latest_small docker: - image: buildpack-deps:latest + resource_class: small environment: TERM: xterm + MAKEFLAGS: -j 2 - base_archlinux: &base_archlinux docker: - image: archlinux:base environment: TERM: xterm + MAKEFLAGS: -j 3 + + - base_archlinux_large: &base_archlinux_large + docker: + - image: archlinux:base + resource_class: large + environment: + TERM: xterm + MAKEFLAGS: -j 5 - base_win_powershell: &base_win_powershell executor: name: win/default shell: powershell.exe + - base_win_powershell_large: &base_win_powershell_large + executor: + name: win/default + shell: powershell.exe + size: large + - base_win_cmd: &base_win_cmd executor: name: win/default @@ -291,26 +342,31 @@ defaults: xcode: "11.0.0" environment: TERM: xterm + MAKEFLAGS: -j 5 - - base_ems_xlarge: &base_ems_xlarge + - base_ems_large: &base_ems_large docker: - image: << pipeline.parameters.emscripten-docker-image >> - resource_class: xlarge + resource_class: large environment: TERM: xterm - MAKEFLAGS: -j 10 + MAKEFLAGS: -j 5 - - base_python: &base_python + - base_python_small: &base_python_small docker: - image: circleci/python:3.6 + resource_class: small environment: TERM: xterm + MAKEFLAGS: -j 2 - - base_node_latest: &base_node_latest + - base_node_latest_small: &base_node_latest_small docker: - image: circleci/node + resource_class: small environment: TERM: xterm + MAKEFLAGS: -j 2 # -------------------------------------------------------------------------- # Workflow Templates @@ -394,7 +450,7 @@ defaults: jobs: chk_spelling: - <<: *base_python + <<: *base_python_small steps: - checkout - attach_workspace: @@ -409,7 +465,7 @@ jobs: - gitter_notify_failure_unless_pr chk_docs_examples: - <<: *base_node_latest + <<: *base_node_latest_small steps: - checkout - attach_workspace: @@ -423,7 +479,7 @@ jobs: - gitter_notify_failure_unless_pr chk_coding_style: - <<: *base_buildpack_focal + <<: *base_buildpack_focal_small steps: - checkout - run: @@ -441,7 +497,7 @@ jobs: - gitter_notify_failure_unless_pr chk_errorcodes: - <<: *base_python + <<: *base_python_small steps: - checkout - run: @@ -450,7 +506,7 @@ jobs: - gitter_notify_failure_unless_pr chk_pylint: - <<: *base_buildpack_focal + <<: *base_buildpack_focal_small steps: - checkout - run: @@ -466,7 +522,7 @@ jobs: - gitter_notify_failure_unless_pr chk_antlr_grammar: - <<: *base_buildpack_focal + <<: *base_buildpack_focal_small steps: - checkout - run: @@ -478,7 +534,7 @@ jobs: - gitter_notify_failure_unless_pr chk_buglist: - <<: *base_node_latest + <<: *base_node_latest_small steps: - checkout - run: @@ -493,7 +549,7 @@ jobs: - gitter_notify_failure_unless_pr chk_proofs: - <<: *base_buildpack_latest + <<: *base_buildpack_latest_small steps: - checkout - run: @@ -506,14 +562,14 @@ jobs: - gitter_notify_failure_unless_pr chk_docs_pragma_min_version: - <<: *base_ubuntu2004 + <<: *base_ubuntu2004_small steps: - checkout - run: *run_docs_pragma_min_version - gitter_notify_failure_unless_pr t_ubu_pyscripts: - <<: *base_ubuntu2004 + <<: *base_ubuntu2004_small steps: - checkout - run: @@ -532,6 +588,8 @@ jobs: - gitter_notify_failure_unless_pr b_ubu: &b_ubu + # this runs 2x faster on xlarge but takes 4x more resources (compared to medium). + # Enough other jobs depend on it that it's worth it though. <<: *base_ubuntu2004_xlarge steps: - checkout @@ -544,10 +602,11 @@ jobs: # x64 ASAN build, for testing for memory related bugs b_ubu_asan: &b_ubu_asan - <<: *base_ubuntu2004_xlarge + # Runs slightly faster on large and xlarge but we only run it nightly so efficiency matters more. + <<: *base_ubuntu2004 environment: CMAKE_OPTIONS: -DSANITIZE=address - MAKEFLAGS: -j 10 + MAKEFLAGS: -j 3 CMAKE_BUILD_TYPE: Release steps: - checkout @@ -557,7 +616,7 @@ jobs: - gitter_notify_failure_unless_pr b_ubu_clang: &b_ubu_clang - <<: *base_ubuntu2004_clang_xlarge + <<: *base_ubuntu2004_clang_large steps: - checkout - run: *run_build @@ -566,6 +625,7 @@ jobs: - gitter_notify_failure_unless_pr b_ubu_asan_clang: &b_ubu_asan_clang + # This runs a bit faster on large and xlarge but on nightly efficiency matters more. <<: *base_ubuntu2004_clang environment: CC: clang @@ -580,6 +640,7 @@ jobs: - gitter_notify_failure_unless_pr b_ubu_ubsan_clang: &b_ubu_ubsan_clang + # This runs a bit faster on large and xlarge but on nightly efficiency matters more. <<: *base_ubuntu2004_clang environment: CC: clang @@ -600,9 +661,10 @@ jobs: MAKEFLAGS: -j 10 b_ubu_static: - <<: *base_ubuntu2004_xlarge + # Runs 2x faster on large and 3x on xlarge but no other jobs depend on it we can live with medium. + <<: *base_ubuntu2004 environment: - MAKEFLAGS: -j 10 + MAKEFLAGS: -j 3 CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DUSE_Z3_DLOPEN=ON -DUSE_CVC4=OFF -DSOLC_STATIC_STDLIBS=ON steps: - checkout @@ -614,11 +676,12 @@ jobs: - gitter_notify_failure_unless_pr b_ubu_codecov: - <<: *base_ubuntu2004_xlarge + # Runs ~30% faster on large but we only run it nightly so efficiency matters more. + <<: *base_ubuntu2004 environment: COVERAGE: ON CMAKE_BUILD_TYPE: Debug - MAKEFLAGS: -j 10 + MAKEFLAGS: -j 3 steps: - checkout - run: *run_build @@ -651,11 +714,11 @@ jobs: # Builds in C++20 mode and uses debug build in order to speed up. # Do *NOT* store any artifacts or workspace as we don't run tests on this build. b_ubu_cxx20: - <<: *base_ubuntu2004_xlarge + <<: *base_ubuntu2004_large environment: CMAKE_BUILD_TYPE: Debug CMAKE_OPTIONS: -DCMAKE_CXX_STANDARD=20 -DUSE_CVC4=OFF - MAKEFLAGS: -j 10 + MAKEFLAGS: -j 5 steps: - checkout - run: *run_build @@ -671,7 +734,7 @@ jobs: - gitter_notify_failure_unless_pr t_ubu_ossfuzz: &t_ubu_ossfuzz - <<: *base_ubuntu1604_clang + <<: *base_ubuntu1604_clang_small steps: - checkout - attach_workspace: @@ -688,10 +751,10 @@ jobs: - gitter_notify_success_unless_pr b_archlinux: - <<: *base_archlinux + <<: *base_archlinux_large environment: TERM: xterm - MAKEFLAGS: -j 3 + MAKEFLAGS: -j 5 steps: - run: name: Install build dependencies @@ -772,7 +835,7 @@ jobs: - gitter_notify_failure_unless_pr b_ems: - <<: *base_ems_xlarge + <<: *base_ems_large steps: - checkout - run: @@ -793,7 +856,7 @@ jobs: - gitter_notify_failure_unless_pr b_docs: - <<: *base_ubuntu2004 + <<: *base_ubuntu2004_small steps: - checkout - run: *setup_prerelease_commit_hash @@ -850,14 +913,15 @@ jobs: <<: *t_ubu_soltest_all t_ubu_cli: &t_ubu_cli - <<: *base_ubuntu2004 + <<: *base_ubuntu2004_small <<: *steps_cmdline_tests t_ubu_release_cli: &t_ubu_release_cli <<: *t_ubu_cli t_ubu_asan_cli: - <<: *base_ubuntu2004 + # Runs slightly faster on medium but we only run it nightly so efficiency matters more. + <<: *base_ubuntu2004_small environment: TERM: xterm ASAN_OPTIONS: check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2 @@ -889,10 +953,11 @@ jobs: <<: *steps_soltest t_ubu_ubsan_clang_cli: - <<: *base_ubuntu2004_clang + <<: *base_ubuntu2004_clang_small <<: *steps_cmdline_tests t_ems_solcjs: + # Unlike other t_ems jobs this one actually runs 2x faster on medium (compared to small). <<: *base_ubuntu2004 steps: - checkout @@ -913,7 +978,7 @@ jobs: - gitter_notify_failure_unless_pr t_ems_ext_hardhat: - <<: *base_node_latest + <<: *base_node_latest_small environment: TERM: xterm HARDHAT_TESTS_SOLC_PATH: /tmp/workspace/soljson.js @@ -948,8 +1013,12 @@ jobs: nodejs_version: type: string default: latest + resource_class: + type: string + default: small docker: - image: circleci/node:<> + resource_class: <> # NOTE: Each external test does 3 separate compile&test runs parallelism: 3 environment: @@ -971,7 +1040,7 @@ jobs: - gitter_notify_failure_unless_pr b_win: &b_win - <<: *base_win_powershell + <<: *base_win_powershell_large steps: # NOTE: Not disabling git's core.autocrlf here because we want to build using the typical Windows config. - checkout @@ -1028,7 +1097,7 @@ jobs: <<: *t_win_soltest b_bytecode_ubu: - <<: *base_ubuntu2004 + <<: *base_ubuntu2004_small steps: - checkout - attach_workspace: @@ -1094,7 +1163,7 @@ jobs: - gitter_notify_failure_unless_pr b_bytecode_ems: - <<: *base_node_latest + <<: *base_node_latest_small environment: SOLC_EMSCRIPTEN: "On" steps: @@ -1111,7 +1180,7 @@ jobs: - gitter_notify_failure_unless_pr t_bytecode_compare: - <<: *base_ubuntu2004 + <<: *base_ubuntu2004_small environment: REPORT_FILES: | bytecode-report-emscripten.txt @@ -1251,6 +1320,7 @@ workflows: project: zeppelin # NOTE: Tests crash on nodejs 17: "Error: error:0308010C:digital envelope routines::unsupported" nodejs_version: '16' + resource_class: medium - t_ems_ext: <<: *workflow_emscripten name: t_ems_test_ext_ens @@ -1321,3 +1391,4 @@ workflows: <<: *workflow_emscripten name: t_ems_test_ext_colony project: colony + resource_class: medium