Build Fluffy tools individually through Makefile (#1626)

* Build Fluffy tools individually through Makefile

Before the builds were launched sequentually from a nimble task,
this would not allow for concurrent builds of the individual tools

* Some Makefile / nimble clean-up
This commit is contained in:
Kim De Mey 2023-07-05 16:44:18 +02:00 committed by GitHub
parent ccf639fc3c
commit b3d06c14b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 19 deletions

View File

@ -63,9 +63,23 @@ TOOLS_DIRS := \
# comma-separated values for the "clean" target
TOOLS_CSV := $(subst $(SPACE),$(COMMA),$(TOOLS))
# Fluffy debugging tools + testing tools
FLUFFY_TOOLS := \
beacon_chain_bridge \
eth_data_exporter \
content_verifier \
blockwalk \
portalcli
FLUFFY_TOOLS_DIRS := \
fluffy/tools/bridge \
fluffy/tools
# comma-separated values for the "clean" target
FLUFFY_TOOLS_CSV := $(subst $(SPACE),$(COMMA),$(FLUFFY_TOOLS))
.PHONY: \
all \
$(TOOLS) \
$(FLUFFY_TOOLS) \
deps \
update \
nimbus \
@ -208,10 +222,6 @@ fluffy: | build deps
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim fluffy $(NIM_PARAMS) nimbus.nims
lc-bridge: | build deps
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim lc_bridge $(NIM_PARAMS) nimbus.nims
# primitive reproducibility test
fluffy-test-reproducibility:
+ [ -e build/fluffy ] || $(MAKE) V=0 fluffy; \
@ -226,11 +236,16 @@ fluffy-test-reproducibility:
fluffy-test: | build deps
$(ENV_SCRIPT) nim fluffy_test $(NIM_PARAMS) nimbus.nims
# builds the fluffy tools
fluffy-tools: | build deps
$(ENV_SCRIPT) nim fluffy_tools $(NIM_PARAMS) nimbus.nims
# builds the fluffy tools, wherever they are
$(FLUFFY_TOOLS): | build deps
for D in $(FLUFFY_TOOLS_DIRS); do [ -e "$${D}/$@.nim" ] && TOOL_DIR="$${D}" && break; done && \
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim c $(NIM_PARAMS) -d:chronicles_log_level=TRACE -o:build/$@ "$${TOOL_DIR}/$@.nim"
# builds the fluffy tools
# builds all the fluffy tools
fluffy-tools: | $(FLUFFY_TOOLS)
# builds the uTP test app
utp-test-app: | build deps
$(ENV_SCRIPT) nim utp_test_app $(NIM_PARAMS) nimbus.nims
@ -275,7 +290,7 @@ txparse: | build deps
# usual cleaning
clean: | clean-common
rm -rf build/{nimbus,fluffy,nimbus_verified_proxy,$(TOOLS_CSV),all_tests,test_kvstore_rocksdb,test_rpc,all_fluffy_tests,all_fluffy_portal_spec_tests,test_portal_testnet,portalcli,blockwalk,eth_data_exporter,utp_test_app,utp_test,*.dSYM}
rm -rf build/{nimbus,fluffy,nimbus_verified_proxy,$(TOOLS_CSV),$(FLUFFY_TOOLS_CSV),all_tests,test_kvstore_rocksdb,test_rpc,all_fluffy_tests,all_fluffy_portal_spec_tests,test_portal_testnet,portalcli,blockwalk,eth_data_exporter,utp_test_app,utp_test,*.dSYM}
rm -rf tools/t8n/{t8n,t8n_test}
rm -rf tools/evmstate/{evmstate,evmstate_test}
ifneq ($(USE_LIBBACKTRACE), 0)

View File

@ -6,6 +6,8 @@
@end
-d:chronosStrictException
-d:PREFER_BLST_SHA256=false
--styleCheck:usages
--styleCheck:hint
--hint[XDeclaredButNotUsed]:off

View File

@ -0,0 +1,2 @@
# Use only `secp256k1` public key cryptography as an identity in LibP2P.
-d:"libp2p_pki_schemes=secp256k1"

View File

@ -31,8 +31,7 @@ when declared(namedBin):
namedBin = {
"nimbus/nimbus": "nimbus",
"fluffy/fluffy": "fluffy",
"lc_proxy/lc_proxy": "lc_proxy",
"fluffy/tools/portalcli": "portalcli",
"nimbus_verified_proxy/nimbus_verified_proxy": "nimbus_verified_proxy",
}.toTable()
proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
@ -72,7 +71,7 @@ task test_evm, "Run EVM tests":
## Fluffy tasks
task fluffy, "Build fluffy":
buildBinary "fluffy", "fluffy/", "-d:chronicles_log_level=TRACE -d:chronosStrictException -d:PREFER_BLST_SHA256=false"
buildBinary "fluffy", "fluffy/", "-d:chronicles_log_level=TRACE"
task fluffy_test, "Run fluffy tests":
# Need the nimbus_db_backend in state network tests as we need a Hexary to
@ -83,13 +82,6 @@ task fluffy_test, "Run fluffy tests":
test "fluffy/tests", "all_fluffy_tests", "-d:chronicles_log_level=ERROR -d:chronosStrictException -d:nimbus_db_backend=sqlite -d:PREFER_BLST_SHA256=false -d:mergeBlockNumber:38130"
test "fluffy/tests/beacon_light_client_tests", "all_beacon_light_client_tests", "-d:chronicles_log_level=ERROR -d:chronosStrictException -d:nimbus_db_backend=sqlite -d:PREFER_BLST_SHA256=false"
task fluffy_tools, "Build fluffy tools":
buildBinary "beacon_chain_bridge", "fluffy/tools/bridge/", "-d:chronicles_log_level=TRACE -d:chronosStrictException -d:PREFER_BLST_SHA256=false -d:libp2p_pki_schemes=secp256k1"
buildBinary "eth_data_exporter", "fluffy/tools/", "-d:chronicles_log_level=TRACE -d:chronosStrictException -d:PREFER_BLST_SHA256=false"
buildBinary "content_verifier", "fluffy/tools/", "-d:chronicles_log_level=TRACE -d:chronosStrictException -d:PREFER_BLST_SHA256=false"
buildBinary "blockwalk", "fluffy/tools/", "-d:chronicles_log_level=TRACE -d:chronosStrictException"
buildBinary "portalcli", "fluffy/tools/", "-d:chronicles_log_level=TRACE -d:chronosStrictException -d:PREFER_BLST_SHA256=false"
task utp_test_app, "Build uTP test app":
buildBinary "utp_test_app", "fluffy/tools/utp_testing/", "-d:chronicles_log_level=TRACE -d:chronosStrictException"