diff --git a/.appveyor.yml b/.appveyor.yml index 6d8ac806d..173794d3c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -36,8 +36,8 @@ build_script: test_script: # the "go-checks" target fails in AppVeyor, for some reason; easier to disable than to debug - - mingw32-make -j2 ARCH_OVERRIDE=%PLATFORM% DISABLE_GO_CHECKS=1 P2PD_CACHE=p2pdCache - - mingw32-make -j2 ARCH_OVERRIDE=%PLATFORM% DISABLE_GO_CHECKS=1 P2PD_CACHE=p2pdCache NIMFLAGS="-d:NETWORK_TYPE=libp2p -d:testnet_servers_image" + - mingw32-make -j2 ARCH_OVERRIDE=%PLATFORM% DISABLE_GO_CHECKS=1 P2PD_CACHE=p2pdCache LOG_LEVEL=TRACE + - mingw32-make -j2 ARCH_OVERRIDE=%PLATFORM% DISABLE_GO_CHECKS=1 P2PD_CACHE=p2pdCache LOG_LEVEL=TRACE NIMFLAGS="-d:NETWORK_TYPE=libp2p -d:testnet_servers_image" - mingw32-make -j2 ARCH_OVERRIDE=%PLATFORM% DISABLE_TEST_FIXTURES_SCRIPT=1 DISABLE_GO_CHECKS=1 test deploy: off diff --git a/.gitignore b/.gitignore index c8db1cd9d..b80176e32 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,7 @@ build/ *.dll # a symlink that can't be added to the repo because of Windows -/*.nims +/beacon_chain.nims /scripts/testnet*.sh diff --git a/.gitmodules b/.gitmodules index 98461881d..a98bba03a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -134,3 +134,8 @@ [submodule "vendor/lmdb"] path = vendor/lmdb url = https://github.com/status-im/lmdb.git +[submodule "vendor/nim-libbacktrace"] + path = vendor/nim-libbacktrace + url = https://github.com/status-im/nim-libbacktrace.git + ignore = dirty + branch = master diff --git a/.travis.yml b/.travis.yml index 9fab9b125..d015327cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,7 +49,7 @@ script: - set -e # fail fast # Building Nim-1.0.4 takes up to 10 minutes on Travis - the time limit after which jobs are cancelled for having no output - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" V=1 update # to allow a newer Nim version to be detected - - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" - - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" NIMFLAGS="-d:NETWORK_TYPE=libp2p -d:testnet_servers_image" + - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" LOG_LEVEL=TRACE + - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:NETWORK_TYPE=libp2p -d:testnet_servers_image" LOG_LEVEL=TRACE - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" DISABLE_TEST_FIXTURES_SCRIPT=1 test diff --git a/Jenkinsfile b/Jenkinsfile index 0f59e82fb..b543059b2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,8 +21,8 @@ def runStages() { parallel( "tools": { stage("Tools") { - sh "make -j${env.NPROC}" - sh "make -j${env.NPROC} NIMFLAGS='-d:NETWORK_TYPE=libp2p -d:testnet_servers_image'" + sh "make -j${env.NPROC} LOG_LEVEL=TRACE" + sh "make -j${env.NPROC} LOG_LEVEL=TRACE NIMFLAGS='-d:NETWORK_TYPE=libp2p -d:testnet_servers_image'" } }, "test suite": { diff --git a/Makefile b/Makefile index 776fee0c2..fd7d00fb1 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,8 @@ TOOLS_CSV := $(subst $(SPACE),$(COMMA),$(TOOLS)) testnet0 \ clean-testnet1 \ testnet1 \ - clean + clean \ + libbacktrace ifeq ($(NIM_PARAMS),) # "variables.mk" was not included. We can only execute one target in this state. @@ -57,6 +58,10 @@ endif # must be included after the default target -include $(BUILD_SYSTEM_DIR)/makefiles/targets.mk +# "--import" can't be added to config.nims, for some reason +# "--define:release" implies "--stacktrace:off" and it cannot be added to config.nims either +NIM_PARAMS := $(NIM_PARAMS) -d:release --import:libbacktrace + #- the Windows build fails on Azure Pipelines if we have Unicode symbols copy/pasted here, # so we encode them in ASCII GIT_SUBMODULE_UPDATE := git submodule update --init --recursive @@ -70,7 +75,7 @@ build-system-checks: }; \ exit 0 -deps: | deps-common beacon_chain.nims p2pd +deps: | deps-common beacon_chain.nims p2pd libbacktrace #- deletes and recreates "beacon_chain.nims" which on Windows is a copy instead of a proper symlink update: | update-common @@ -81,6 +86,10 @@ update: | update-common beacon_chain.nims: ln -s beacon_chain.nimble $@ +# nim-libbacktrace +libbacktrace: + + $(MAKE) -C vendor/nim-libbacktrace + P2PD_CACHE := p2pd: | go-checks BUILD_MSG="$(BUILD_MSG) $@" \ @@ -121,6 +130,7 @@ testnet1: | build deps clean: | clean-common rm -rf build/{$(TOOLS_CSV),all_tests,*_node,*ssz*,beacon_node_testnet*,state_sim,transition*} + + $(MAKE) -C vendor/nim-libbacktrace clean $(HANDLE_OUTPUT) libnfuzz.so: | build deps-common beacon_chain.nims echo -e $(BUILD_MSG) "build/$@" && \ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a6374979c..bf0754ede 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -71,8 +71,8 @@ jobs: scripts/setup_official_tests.sh jsonTestsCache mingw32-make -j2 ARCH_OVERRIDE=${PLATFORM} CI_CACHE=NimBinaries update mingw32-make -j2 ARCH_OVERRIDE=${PLATFORM} fetch-dlls - mingw32-make -j2 ARCH_OVERRIDE=${PLATFORM} P2PD_CACHE=p2pdCache - mingw32-make -j2 ARCH_OVERRIDE=${PLATFORM} P2PD_CACHE=p2pdCache NIMFLAGS="-d:NETWORK_TYPE=libp2p -d:testnet_servers_image" + mingw32-make -j2 ARCH_OVERRIDE=${PLATFORM} P2PD_CACHE=p2pdCache LOG_LEVEL=TRACE + mingw32-make -j2 ARCH_OVERRIDE=${PLATFORM} P2PD_CACHE=p2pdCache LOG_LEVEL=TRACE NIMFLAGS="-d:NETWORK_TYPE=libp2p -d:testnet_servers_image" file build/beacon_node mingw32-make -j2 ARCH_OVERRIDE=${PLATFORM} DISABLE_TEST_FIXTURES_SCRIPT=1 test displayName: 'build and test' diff --git a/beacon_chain.nimble b/beacon_chain.nimble index c207dea24..1596109c2 100644 --- a/beacon_chain.nimble +++ b/beacon_chain.nimble @@ -24,6 +24,7 @@ requires "nim >= 0.19.0", "eth", "json_rpc", "json_serialization", + "libbacktrace", "libp2p", "metrics", "nimcrypto", @@ -41,26 +42,30 @@ proc buildBinary(name: string, srcDir = "./", params = "", cmdParams = "", lang var extra_params = params for i in 2..