From cb4925f4cf67a82d8206622e3f1548fe8b7efe66 Mon Sep 17 00:00:00 2001 From: Bhargava Shastry Date: Tue, 24 Sep 2019 14:31:22 +0200 Subject: [PATCH] Add clang build and test CIs --- .circleci/config.yml | 44 +++++++++++++++++++++++++++++--- cmake/toolchains/libfuzzer.cmake | 4 +-- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f1c070fa0..47c6518ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,6 +115,17 @@ defaults: - store_test_results: *store_test_results - store_artifacts: *artifacts_test_results + - test_ubuntu1904_clang: &test_ubuntu1904_clang + docker: + - image: ethereum/solidity-buildpack-deps:ubuntu1904-clang + steps: + - checkout + - attach_workspace: + at: build + - run: *run_soltest + - store_test_results: *store_test_results + - store_artifacts: *artifacts_test_results + - test_ubuntu1904_all: &test_ubuntu1904 docker: - image: ethereum/solidity-buildpack-deps:ubuntu1904 @@ -151,6 +162,11 @@ defaults: requires: - b_ubu + - workflow_ubuntu1904_clang: &workflow_ubuntu1904_clang + <<: *workflow_trigger_on_tags + requires: + - b_ubu_clang + - workflow_ubuntu1904_release: &workflow_ubuntu1904_release <<: *workflow_trigger_on_tags requires: @@ -280,6 +296,18 @@ jobs: pip install --user z3-solver - run: *run_proofs + b_ubu_clang: &build_ubuntu1904_clang + docker: + - image: ethereum/solidity-buildpack-deps:ubuntu1904-clang + environment: + CC: clang + CXX: clang++ + steps: + - checkout + - run: *run_build + - store_artifacts: *artifacts_solc + - persist_to_workspace: *artifacts_executables + b_ubu: &build_ubuntu1904 docker: - image: ethereum/solidity-buildpack-deps:ubuntu1904 @@ -349,11 +377,11 @@ jobs: - run: *run_build b_ubu_ossfuzz: - <<: *build_ubuntu1904 + <<: *build_ubuntu1904_clang environment: TERM: xterm - CC: /usr/bin/clang-8 - CXX: /usr/bin/clang++-8 + CC: clang + CXX: clang++ CMAKE_OPTIONS: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/libfuzzer.cmake steps: - checkout @@ -362,7 +390,7 @@ jobs: - persist_to_workspace: *artifacts_executables_ossfuzz t_ubu_ossfuzz: &t_ubu_ossfuzz - <<: *test_ubuntu1904 + <<: *test_ubuntu1904_clang steps: - checkout - attach_workspace: @@ -495,6 +523,12 @@ jobs: t_ubu_soltest: &t_ubu_soltest <<: *test_ubuntu1904 + t_ubu_clang_soltest: &t_ubu_clang_soltest + <<: *test_ubuntu1904_clang + environment: + EVM: constantinople + OPTIMIZE: 0 + t_ubu_release_soltest: &t_ubu_release_soltest <<: *t_ubu_soltest @@ -632,6 +666,8 @@ workflows: - b_ubu18: *workflow_trigger_on_tags - t_ubu_cli: *workflow_ubuntu1904 - t_ubu_soltest: *workflow_ubuntu1904 + - b_ubu_clang: *workflow_trigger_on_tags + - t_ubu_clang_soltest: *workflow_ubuntu1904_clang # Ubuntu fake release build and tests - b_ubu_release: *workflow_trigger_on_tags diff --git a/cmake/toolchains/libfuzzer.cmake b/cmake/toolchains/libfuzzer.cmake index 8a295e05b..354e6d09b 100644 --- a/cmake/toolchains/libfuzzer.cmake +++ b/cmake/toolchains/libfuzzer.cmake @@ -1,7 +1,7 @@ # Inherit default options include("${CMAKE_CURRENT_LIST_DIR}/default.cmake") -# Disable Z3 and CVC4 since none of the existing fuzzers need them -set(USE_Z3 OFF CACHE BOOL "Disable Z3" FORCE) +# Enable Z3, disable CVC4 +set(USE_Z3 ON CACHE BOOL "Enable Z3" FORCE) set(USE_CVC4 OFF CACHE BOOL "Disable CVC4" FORCE) # Build fuzzing binaries set(OSSFUZZ ON CACHE BOOL "Enable fuzzer build" FORCE)