Skip to content

Commit

Permalink
Merge branch 'develop' into publish_prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermelawless committed Jan 28, 2020
2 parents 82c6cf5 + d41d4c5 commit 728a28c
Show file tree
Hide file tree
Showing 67 changed files with 2,979 additions and 429 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Fetch Deps
run: ci/actions/linux/install_deps.sh
- name: Run Tests
run: docker run -v ${PWD}:/workspace nanocurrency/nano-env:clang /bin/bash -c "cd /workspace && RELEASE=0 ASAN=0 TSAN=0 ./ci/build-travis.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5 ${PWD}"
run: docker run -v ${PWD}:/workspace nanocurrency/nano-env:clang /bin/bash -c "cd /workspace && ./ci/build-travis.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5 ${PWD}"

windows_test:
runs-on: windows-latest
Expand Down
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ execute_process(
)

option (CI_BUILD false)
set (CI_TEST 0 CACHE STRING "")

set (CPACK_PACKAGE_VERSION_MAJOR "21")
set (CPACK_PACKAGE_VERSION_MINOR "0")
Expand All @@ -37,6 +38,7 @@ set (NANO_ROCKSDB OFF CACHE BOOL "")
set (NANO_POW_SERVER OFF CACHE BOOL "")
set (NANO_WARN_TO_ERR OFF CACHE BOOL "")
set (NANO_TIMED_LOCKS 0 CACHE STRING "")
set (NANO_FUZZER_TEST OFF CACHE BOOL "")

option (NANO_STACKTRACE_BACKTRACE "Use BOOST_STACKTRACE_USE_BACKTRACE in stacktraces, for POSIX" OFF)
if (NANO_STACKTRACE_BACKTRACE)
Expand Down Expand Up @@ -109,6 +111,11 @@ else ()
add_definitions(-DED25519_NO_INLINE_ASM)
endif()

if (NANO_FUZZER_TEST)
add_compile_options (-fsanitize=fuzzer-no-link -fno-omit-frame-pointer)
add_definitions (-DNANO_FUZZER_TEST)
endif ()

if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86(_64)?)$")
if (NANO_SIMD_OPTIMIZATIONS OR RAIBLOCKS_SIMD_OPTIMIZATIONS OR ENABLE_AVX2)
add_compile_options(-msse4)
Expand Down Expand Up @@ -174,6 +181,9 @@ else ()
set (PLATFORM_LINK_FLAGS "${PLATFORM_LINK_FLAGS} -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/tsan_clang_blacklist")
endif()
endif()
if (NANO_FUZZER_TEST)
set (PLATFORM_LINK_FLAGS "${PLATFORM_LINK_FLAGS} -fsanitize=fuzzer-no-link")
endif ()
endif ()

SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINK_FLAGS}" )
Expand Down Expand Up @@ -351,6 +361,14 @@ add_subdirectory(nano/nano_node)
add_subdirectory(nano/rpc)
add_subdirectory(nano/nano_rpc)

if (NANO_FUZZER_TEST)
if (NOT WIN32)
add_subdirectory (nano/fuzzer_test)
else ()
message (WARNING "Fuzzing is not supported on Windows")
endif ()
endif ()

if (NANO_TEST OR RAIBLOCKS_TEST)
if(WIN32)
if(MSVC_VERSION)
Expand Down
4 changes: 2 additions & 2 deletions ci/actions/windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (${env:artifact} -eq 1) {
}
$env:NETWORK_CFG = "test"
$env:NANO_TEST = "-DNANO_TEST=ON"
$env:CI = "-DCI_BUILD=OFF"
$env:CI = '-DCI_TEST="1"'
$env:RUN = "test"
}

Expand All @@ -39,7 +39,7 @@ if (${LastExitCode} -ne 0) {

if (${env:RUN} -eq "artifact") {
$p = Get-Location
Invoke-WebRequest -Uri https://aka.ms/vs/15/release/vc_redist.x64.exe -OutFile "$p\vc_redist.x64.exe"
Invoke-WebRequest -Uri https://aka.ms/vs/16/release/vc_redist.x64.exe -OutFile "$p\vc_redist.x64.exe"
}

& ..\ci\actions\windows\build.bat
Expand Down
2 changes: 1 addition & 1 deletion ci/build-travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ else
ROCKSDB=""
fi


cmake \
-G'Unix Makefiles' \
-DACTIVE_NETWORK=nano_test_network \
Expand All @@ -61,6 +60,7 @@ cmake \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DBOOST_ROOT=/tmp/boost/ \
-DQt5_DIR=${qt_dir} \
-DCI_TEST="1" \
${SANITIZERS} \
..

Expand Down
22 changes: 22 additions & 0 deletions docker/ci/Dockerfile-clang-6
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM nanocurrency/nano-env:base

RUN apt-get update && apt-get install -yqq software-properties-common && \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main" && \
apt-get update -qq && apt-get install -yqq \
clang-6.0 lldb-6.0 libfuzzer-6.0-dev git

ADD util/build_prep/fetch_rocksdb.sh fetch_rocksdb.sh
RUN ./fetch_rocksdb.sh

ENV CXX=/usr/bin/clang++
ENV CC=/usr/bin/clang
RUN ln -s /usr/bin/clang-6.0 /usr/bin/clang
RUN ln -s /usr/bin/clang++-6.0 /usr/bin/clang++
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
ENV BOOST_ROOT=/tmp/boost

ADD util/build_prep/bootstrap_boost.sh bootstrap_boost.sh

RUN ./bootstrap_boost.sh -m -c -B 1.70
9 changes: 6 additions & 3 deletions nano/core_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ add_executable (core_test
ledger.cpp
locks.cpp
logger.cpp
network.cpp
node.cpp
message.cpp
message_parser.cpp
memory_pool.cpp
network.cpp
node.cpp
node_telemetry.cpp
processor_service.cpp
peer_container.cpp
request_aggregator.cpp
Expand All @@ -43,5 +44,7 @@ target_compile_definitions(core_test
PRIVATE
-DTAG_VERSION_STRING=${TAG_VERSION_STRING}
-DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}
-DBOOST_PROCESS_SUPPORTED=${BOOST_PROCESS_SUPPORTED})
-DBOOST_PROCESS_SUPPORTED=${BOOST_PROCESS_SUPPORTED}
-DCI=${CI_TEST})

target_link_libraries (core_test node secure gtest libminiupnpc-static Boost::log_setup Boost::log Boost::boost)
Loading

0 comments on commit 728a28c

Please sign in to comment.