compile_nim_program.sh: bring back Nim warnings with V=0 (#2325)

This commit is contained in:
Ștefan Talpalaru 2021-02-15 18:08:18 +01:00 committed by GitHub
parent aa29be288e
commit f398720fc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 37 deletions

View File

@ -156,117 +156,105 @@ TEST_BINARIES := \
test_fixture_const_sanity_check_minimal: | build deps test_fixture_const_sanity_check_minimal: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"tests/official/test_fixture_const_sanity_check.nim" \ "tests/official/test_fixture_const_sanity_check.nim" \
$(NIM_PARAMS) -d:const_preset=minimal -d:chronicles_sinks="json[file]" \ $(NIM_PARAMS) -d:const_preset=minimal -d:chronicles_sinks="json[file]" && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
test_fixture_const_sanity_check_mainnet: | build deps test_fixture_const_sanity_check_mainnet: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"tests/official/test_fixture_const_sanity_check.nim" \ "tests/official/test_fixture_const_sanity_check.nim" \
$(NIM_PARAMS) -d:const_preset=mainnet -d:chronicles_sinks="json[file]" \ $(NIM_PARAMS) -d:const_preset=mainnet -d:chronicles_sinks="json[file]" && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
# Generic SSZ test, doesn't use consensus objects minimal/mainnet presets # Generic SSZ test, doesn't use consensus objects minimal/mainnet presets
test_fixture_ssz_generic_types: | build deps test_fixture_ssz_generic_types: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"tests/official/$@.nim" \ "tests/official/$@.nim" \
$(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:chronicles_sinks="json[file]" \ $(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:chronicles_sinks="json[file]" && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
# Consensus object SSZ tests # Consensus object SSZ tests
test_fixture_ssz_consensus_objects: | build deps test_fixture_ssz_consensus_objects: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"tests/official/$@.nim" \ "tests/official/$@.nim" \
$(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:chronicles_sinks="json[file]" \ $(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:chronicles_sinks="json[file]" && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
# EF tests # EF tests
all_fixtures_require_ssz: | build deps all_fixtures_require_ssz: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"tests/official/$@.nim" \ "tests/official/$@.nim" \
$(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:chronicles_sinks="json[file]" \ $(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:chronicles_sinks="json[file]" && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
# EIP-3076 - Slashing interchange # EIP-3076 - Slashing interchange
test_official_interchange_vectors: | build deps test_official_interchange_vectors: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"tests/slashing_protection/$@.nim" \ "tests/slashing_protection/$@.nim" \
$(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:chronicles_sinks="json[file]" \ $(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:chronicles_sinks="json[file]" && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
# Mainnet config # Mainnet config
proto_array: | build deps proto_array: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"beacon_chain/fork_choice/$@.nim" \ "beacon_chain/fork_choice/$@.nim" \
$(NIM_PARAMS) -d:const_preset=mainnet -d:chronicles_sinks="json[file]" \ $(NIM_PARAMS) -d:const_preset=mainnet -d:chronicles_sinks="json[file]" && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
fork_choice: | build deps fork_choice: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"beacon_chain/fork_choice/$@.nim" \ "beacon_chain/fork_choice/$@.nim" \
$(NIM_PARAMS) -d:const_preset=mainnet -d:chronicles_sinks="json[file]" \ $(NIM_PARAMS) -d:const_preset=mainnet -d:chronicles_sinks="json[file]" && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
all_tests: | build deps all_tests: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"tests/$@.nim" \ "tests/$@.nim" \
$(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:chronicles_sinks="json[file]" \ $(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:chronicles_sinks="json[file]" && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
# TODO `test_keystore` is extracted from the rest of the tests because it uses conflicting BLST headers # TODO `test_keystore` is extracted from the rest of the tests because it uses conflicting BLST headers
test_keystore: | build deps test_keystore: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"tests/$@.nim" \ "tests/$@.nim" \
$(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:chronicles_sinks="json[file]" \ $(NIM_PARAMS) -d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:chronicles_sinks="json[file]" && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
# State and block sims; getting to 4th epoch triggers consensus checks # State and block sims; getting to 4th epoch triggers consensus checks
state_sim: | build deps state_sim: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"research/$@.nim" \ "research/$@.nim" \
$(NIM_PARAMS) -d:const_preset=mainnet \ $(NIM_PARAMS) -d:const_preset=mainnet && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
block_sim: | build deps block_sim: | build deps
+ echo -e $(BUILD_MSG) "build/$@" && \ + echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh \
$@ \ $@ \
"research/$@.nim" \ "research/$@.nim" \
$(NIM_PARAMS) -d:const_preset=mainnet \ $(NIM_PARAMS) -d:const_preset=mainnet && \
$(HANDLE_OUTPUT) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
DISABLE_TEST_FIXTURES_SCRIPT := 0 DISABLE_TEST_FIXTURES_SCRIPT := 0
@ -302,7 +290,7 @@ build/generate_makefile: tools/generate_makefile.nim | deps-common
$(TOOLS): | build deps $(TOOLS): | build deps
+ for D in $(TOOLS_DIRS); do [ -e "$${D}/$@.nim" ] && TOOL_DIR="$${D}" && break; done && \ + for D in $(TOOLS_DIRS); do [ -e "$${D}/$@.nim" ] && TOOL_DIR="$${D}" && break; done && \
echo -e $(BUILD_MSG) "build/$@" && \ echo -e $(BUILD_MSG) "build/$@" && \
MAKE="$(MAKE)" $(ENV_SCRIPT) scripts/compile_nim_program.sh $@ "$${TOOL_DIR}/$@.nim" $(NIM_PARAMS) $(HANDLE_OUTPUT) && \ MAKE="$(MAKE)" V="$(V)" $(ENV_SCRIPT) scripts/compile_nim_program.sh $@ "$${TOOL_DIR}/$@.nim" $(NIM_PARAMS) && \
echo -e $(BUILD_END_MSG) "build/$@" echo -e $(BUILD_END_MSG) "build/$@"
clean_eth2_network_simulation_data: clean_eth2_network_simulation_data:

View File

@ -6,8 +6,12 @@ cd "$(dirname "${BASH_SOURCE[0]}")"/..
BINARY="$1" BINARY="$1"
SOURCE="$2" SOURCE="$2"
# the rest are NIM_PARAMS
shift 2 shift 2
# verbosity level
[[ -z "$V" ]] && V=0
# According to the Nim compiler, the project name comes from the main source # According to the Nim compiler, the project name comes from the main source
# file, not the output binary. # file, not the output binary.
PROJECT_NAME="$(basename ${SOURCE%.nim})" PROJECT_NAME="$(basename ${SOURCE%.nim})"
@ -19,5 +23,6 @@ PROJECT_NAME="$(basename ${SOURCE%.nim})"
# LTO on macOS, in "config.nims" # LTO on macOS, in "config.nims"
nim c --compileOnly -o:build/${BINARY} "$@" -d:nimCachePathOverride=nimcache/release/${BINARY} "${SOURCE}" nim c --compileOnly -o:build/${BINARY} "$@" -d:nimCachePathOverride=nimcache/release/${BINARY} "${SOURCE}"
build/generate_makefile "nimcache/release/${BINARY}/${PROJECT_NAME}.json" "nimcache/release/${BINARY}/${BINARY}.makefile" build/generate_makefile "nimcache/release/${BINARY}/${PROJECT_NAME}.json" "nimcache/release/${BINARY}/${BINARY}.makefile"
[[ "$V" == "0" ]] && exec &>/dev/null
"${MAKE}" -f "nimcache/release/${BINARY}/${BINARY}.makefile" --no-print-directory build "${MAKE}" -f "nimcache/release/${BINARY}/${BINARY}.makefile" --no-print-directory build