status-im / nimbus-eth2

Nim implementation of the Ethereum Beacon Chain
https://nimbus.guide
Other
530 stars 231 forks source link

Make scripts shouldn't eat Nim warnings #456

Closed mratsim closed 4 years ago

mratsim commented 5 years ago

Nim warnings are discarded in the make scripts. When we deprecate some procs like hashToG2 with uint64 instead of array[8, byte] in https://github.com/status-im/nim-blscurve/commit/154676758e9e4e334a5a92a4200c89d938574330#diff-e61e8e98354e05029270f6408b0f7ec8R705, we miss the warnings.

Not sure if there is granularity in-between quiet and --hints:off

stefantalpalaru commented 5 years ago

You want to see just the warnings, not the hints?

stefantalpalaru commented 5 years ago

You can already do that with make V=1 NIMFLAGS="--hints:off"

arnetheduck commented 5 years ago

I'd like to see warnings on by default as well (hints off, warnings on)

stefantalpalaru commented 5 years ago

You really want end users to see this by default?

$ make V=1 NIMFLAGS="--hints:off" beacon_node
which gcc &>/dev/null || { echo "C compiler (gcc) not installed. Aborting."; exit 1; }
make -C vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc libminiupnpc.a 
make[1]: Entering directory '/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc'
make[1]: 'libminiupnpc.a' is up to date.
make[1]: Leaving directory '/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc'
make -C vendor/nim-nat-traversal/vendor/libnatpmp libnatpmp.a 
make[1]: Entering directory '/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nim-nat-traversal/vendor/libnatpmp'
make[1]: 'libnatpmp.a' is up to date.
make[1]: Leaving directory '/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nim-nat-traversal/vendor/libnatpmp'
which go &>/dev/null || { echo "Go compiler not installed. Aborting."; exit 1; }
GO_VER="$(go version | sed -E 's/^.*go([0-9.]+).*$/\1/')"; \
       [[ $(echo -e "${GO_VER}\n1.12" | sort -t '.' -k 1,1 -k 2,2 -g | head -n 1) == "1.12" ]] || \
       { echo "Minimum Go compiler version required: 1.12. Version available: $GO_VER. Aborting."; exit 1; }
BUILD_MSG=""\\e[92mBuilding:\\e[39m" p2pd" \
    V=1 \
    "/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nimbus-build-system/scripts/env.sh" vendor/nimbus-build-system/scripts/build_p2pd.sh ""
cd vendor/nim-bearssl && \
    "/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nimbus-build-system/scripts/env.sh" nimble buildBundledLib 
Hint: used config file '/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/config/nim.cfg' [Conf]
Hint: used config file '/mnt/sda3/storage/CODE/status/nim-beacon-chain/nim.cfg' [Conf]
Hint: used config file '/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nim-bearssl/bearssl.nims' [Conf]
[NimScript] exec: make -j8 CFLAGS="-O3 -march=native -pipe -fPIC " lib
make[1]: Entering directory '/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nim-bearssl/bearssl/csources'
make[1]: Nothing to be done for 'lib'.
make[1]: Leaving directory '/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nim-bearssl/bearssl/csources'
for D in beacon_chain benchmarks research ncli; do [ -e "${D}/beacon_node.nim" ] && TOOL_DIR="${D}" && break; done && \
    echo -e "\\e[92mBuilding:\\e[39m" "build/beacon_node" && \
    "/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nimbus-build-system/scripts/env.sh" nim c --hints:off --verbosity:1 -d:usePcreHeader --passL:\"-lpcre\" -o:build/beacon_node "${TOOL_DIR}/beacon_node.nim"
Building: build/beacon_node
ssz.nim(346, 28) Warning: use ptrops; shift is deprecated [Deprecated]
ssz.nim(346, 27) Warning: use ptrops; shift is deprecated [Deprecated]
libp2p_backend.nim(192, 58) template/generic instantiation from here
libp2p_backend.nim(197, 24) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(192, 58) template/generic instantiation from here
libp2p_backend.nim(197, 24) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(192, 58) template/generic instantiation from here
libp2p_backend.nim(197, 24) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(219, 30) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(219, 30) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(219, 30) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(245, 20) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(245, 20) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(245, 20) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(311, 61) template/generic instantiation from here
libp2p_backend.nim(315, 31) template/generic instantiation from here
../vendor/nim-faststreams/faststreams/output_stream.nim(55, 43) Warning: use ptrops; shift is deprecated [Deprecated]
libp2p_backend.nim(311, 61) template/generic instantiation from here
libp2p_backend.nim(315, 31) template/generic instantiation from here
../vendor/nim-faststreams/faststreams/output_stream.nim(55, 48) Warning: use ptrops; shift is deprecated [Deprecated]
libp2p_backend.nim(321, 79) template/generic instantiation from here
libp2p_backend.nim(324, 19) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(321, 79) template/generic instantiation from here
libp2p_backend.nim(324, 19) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(321, 79) template/generic instantiation from here
libp2p_backend.nim(324, 19) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(426, 45) template/generic instantiation from here
libp2p_backend.nim(432, 9) Warning: Use allFutures(varargs[Future[T]]); all is deprecated [Deprecated]
libp2p_backend.nim(426, 45) template/generic instantiation from here
libp2p_backend.nim(432, 9) Warning: Use allFutures(varargs[Future[T]]); all is deprecated [Deprecated]
libp2p_backend.nim(426, 45) template/generic instantiation from here
libp2p_backend.nim(432, 9) Warning: Use allFutures(varargs[Future[T]]); all is deprecated [Deprecated]
sync_protocol.nim(94, 13) template/generic instantiation from here
../vendor/nim-eth/eth/p2p/p2p_protocol_dsl.nim(590, 20) template/generic instantiation from here
libp2p_backend.nim(387, 19) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
sync_protocol.nim(94, 13) template/generic instantiation from here
../vendor/nim-eth/eth/p2p/p2p_protocol_dsl.nim(590, 20) template/generic instantiation from here
libp2p_backend.nim(387, 19) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
sync_protocol.nim(94, 13) template/generic instantiation from here
../vendor/nim-eth/eth/p2p/p2p_protocol_dsl.nim(590, 20) template/generic instantiation from here
libp2p_backend.nim(387, 19) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
sync_protocol.nim(94, 13) template/generic instantiation from here
../vendor/nim-eth/eth/p2p/p2p_protocol_dsl.nim(590, 20) template/generic instantiation from here
libp2p_backend.nim(387, 19) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
sync_protocol.nim(94, 13) template/generic instantiation from here
../vendor/nim-eth/eth/p2p/p2p_protocol_dsl.nim(590, 20) template/generic instantiation from here
libp2p_backend.nim(387, 19) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
sync_protocol.nim(94, 13) template/generic instantiation from here
../vendor/nim-eth/eth/p2p/p2p_protocol_dsl.nim(590, 20) template/generic instantiation from here
libp2p_backend.nim(387, 19) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
beacon_node.nim(942, 42) template/generic instantiation from here
beacon_node.nim(945, 17) Warning: Use sleepAsync(Duration); sleepAsync is deprecated [Deprecated]
beacon_node.nim(942, 42) template/generic instantiation from here
beacon_node.nim(945, 17) Warning: Use sleepAsync(Duration); sleepAsync is deprecated [Deprecated]
beacon_node.nim(942, 42) template/generic instantiation from here
beacon_node.nim(945, 17) Warning: Use sleepAsync(Duration); sleepAsync is deprecated [Deprecated]
CC: oct
CC: big_384_58
CC: ecp_BLS381
CC: ecp2_BLS381
CC: fp_BLS381
CC: fp2_BLS381
CC: fp4_BLS381
CC: fp12_BLS381
CC: pair_BLS381
CC: rom_curve_BLS381
CC: rom_field_BLS381
CC: secp256k1
CC: xmem
CC: vector
CC: names
CC: certs
CC: files
CC: beacon_chain_beacon_node
CC: stdlib_system
CC: stdlib_sharedlist
CC: stdlib_locks
CC: stdlib_net
CC: stdlib_sequtils
CC: stdlib_tables
CC: stdlib_osproc
CC: stdlib_random
CC: stdlib_strutils
CC: stdlib_times
CC: stdlib_strformat
CC: chronos_chronos
CC: chronicles_chronicles
CC: confutils_confutils
CC: metrics_metrics
CC: beacon_chain_conf
CC: beacon_chain_time
CC: beacon_chain_state_transition
CC: beacon_chain_fork_choice
CC: beacon_chain_ssz
CC: beacon_chain_beacon_chain_db
CC: beacon_chain_validator_pool
CC: beacon_chain_extras
CC: beacon_chain_attestation_pool
CC: beacon_chain_block_pool
CC: beacon_chain_eth2_network
CC: beacon_chain_beacon_node_types
CC: beacon_chain_mainchain_monitor
CC: beacon_chain_trusted_state_snapshots
CC: beacon_chain_version
CC: beacon_chain_sync_protocol
CC: beacon_chain_request_manager
CC: beacon_chain_validator_keygen
CC: beacon_chain_interop
CC: beacon_chain_statusbar
CC: stdlib_nativesockets
CC: stdlib_os
CC: stdlib_options
CC: stdlib_parseutils
CC: stdlib_math
CC: stdlib_bitops
CC: stdlib_algorithm
CC: stdlib_unicode
CC: stdlib_typetraits
CC: stdlib_macros
CC: stdlib_posix
CC: stdlib_ospaths
CC: stdlib_sets
CC: stdlib_hashes
CC: stdlib_strtabs
CC: stdlib_streams
CC: stdlib_cpuinfo
CC: stdlib_linux
CC: stew_os
CC: stew_objects
CC: stew_bitseqs
CC: stew_bitops2
CC: stew_endians2
CC: stew_ptr_arith
CC: stew_ptrops
CC: chronos_asyncloop
CC: stdlib_heapqueue
CC: stdlib_lists
CC: stdlib_deques
CC: chronos_timer
CC: stdlib_selectors
CC: stdlib_epoll
CC: stdlib_cstrutils
CC: chronos_srcloc
CC: chronos_asyncsync
CC: chronos_handles
CC: chronos_transport
CC: chronos_datagram
CC: chronos_common
CC: chronos_stream
CC: chronos_sendfile
CC: chronos_ipnet
CC: stdlib_endians
CC: chronos_osnet
CC: chronos_asyncstream
CC: chronos_chunkstream
CC: chronicles_scope_helpers
CC: chronicles_options
CC: chronicles_dynamic_scope
CC: chronicles_log_output
CC: chronicles_dynamic_scope_types
CC: stdlib_terminal
CC: stdlib_colors
CC: stdlib_termios
CC: faststreams_output_stream
CC: stew_strings
CC: json_serialization_writer
CC: serialization_serialization
CC: stdlib_json
CC: faststreams_faststreams
CC: faststreams_input_stream
CC: stdlib_memfiles
CC: serialization_object_serialization
CC: stew_macros
CC: serialization_errors
CC: stdlib_lexbase
CC: stdlib_parsejson
CC: chronicles_topics_registry
CC: confutils_defs
CC: confutils_cli_parser
CC: confutils_shell_completion
CC: stdlib_re
CC: stdlib_pcre
CC: stdlib_rtarrays
CC: stdlib_asynchttpserver
CC: stdlib_asyncnet
CC: stdlib_asyncdispatch
CC: stdlib_uri
CC: stdlib_asyncstreams
CC: stdlib_asyncfutures
CC: stdlib_httpcore
CC: json_serialization_options
CC: json_serialization_reader
CC: json_serialization_types
CC: json_serialization_lexer
CC: json_serialization_sets
CC: stew_sets
CC: eth_db
CC: eth_trie_defs
CC: eth_db_tracing
CC: nimcrypto_hash
CC: nimcrypto_utils
CC: nimcrypto_keccak
CC: eth_rlp
CC: eth_types
CC: stew_ranges
CC: stew_memranges
CC: stew_typedranges
CC: eth_writer
CC: eth_object_serialization
CC: eth_defs
CC: eth_rocksdb_backend
CC: rocksdb_rocksdb
CC: rocksdb_librocksdb
CC: eth_backend_defs
CC: eth_async_utils
CC: beacon_chain_datatypes
CC: stew_byteutils
CC: eth_common
CC: eth_eth_types
CC: stint_stint
CC: nimcrypto_nimcrypto
CC: stint_bitops2
CC: stint_bitops2_priv
CC: stint_datatypes
CC: stint_conversion
CC: stint_endians2
CC: stint_endians2_priv
CC: stint_intops
CC: stint_initialization
CC: stint_int_addsub
CC: stint_int_comparison
CC: stint_uint_comparison
CC: stint_uint_addsub
CC: stint_uint_bitwise_ops
CC: stint_int_negabs
CC: stint_int_highlow
CC: stint_int_bitwise_ops
CC: stint_uint_highlow
CC: stint_int_mul
CC: stint_uint_mul
CC: stint_int_div
CC: stint_uint_div
CC: stint_uint_exp
CC: stint_io
CC: stint_modular_arithmetic
CC: stint_literals_stint
CC: nimcrypto_sha2
CC: nimcrypto_ripemd
CC: nimcrypto_blake2
CC: nimcrypto_sha
CC: nimcrypto_hmac
CC: nimcrypto_rijndael
CC: nimcrypto_blowfish
CC: nimcrypto_twofish
CC: nimcrypto_bcmode
CC: nimcrypto_sysrand
CC: eth_utils
CC: beacon_chain_types
CC: beacon_chain_crypto
CC: blscurve_blscurve
CC: json_serialization_json_serialization
CC: beacon_chain_digest
CC: blscurve_common
CC: blscurve_milagro
CC: blscurve_bls
CC: eth_eth_types_json_serialization
CC: beacon_chain_minimal
CC: beacon_chain_beaconstate
CC: stew_varints
CC: serialization_tracing
CC: beacon_chain_bytes_reader
CC: beacon_chain_helpers
CC: beacon_chain_validator
CC: beacon_chain_state_transition_block
CC: beacon_chain_state_transition_helpers
CC: eth_keys
CC: secp256k1_secp256k1
CC: web3_web3
CC: httputils_httputils
CC: json_rpc_rpcclient
CC: json_rpc_client
CC: json_rpc_jsonmarshal
CC: json_rpc_socketclient
CC: json_rpc_httpclient
CC: json_serialization_net
CC: json_rpc_websocketclient
CC: stdlib_base64
CC: stdlib_oids
CC: stdlib_sha1
CC: web3_ethtypes
CC: web3_ethprocs
CC: web3_ethhexstrings
CC: web3_conversions
CC: json_rpc_rpcserver
CC: json_rpc_server
CC: json_rpc_router
CC: json_rpc_socketserver
CC: json_rpc_httpserver
CC: web3_transaction_signing
CC: eth_transaction
CC: eth_nat
CC: result_result
CC: nat_traversal_miniupnpc
CC: nat_traversal_utils
CC: nat_traversal_natpmp
CC: stew_io
CC: libp2p_crypto
CC: libp2p_rsa
CC: libp2p_ecnist
CC: libp2p_secp
CC: bearssl_bearssl
CC: bearssl_decls
CC: bearssl_errors
CC: libp2p_minasn1
CC: libp2p_ed25519
CC: libp2p_constants
CC: libp2p_minprotobuf
CC: libp2p_varint
CC: libp2p_vbuffer
CC: libp2p_multihash
CC: libp2p_base58
CC: libp2p_multicodec
CC: libp2p_multibase
CC: libp2p_base32
CC: libp2p_base64
CC: libp2p_daemonapi
CC: libp2p_multiaddress
CC: libp2p_transcoder
CC: libp2p_peer
CC: libp2p_cid
CC: libp2p_wire
CC: beacon_chain_libp2p_backend
CC: beacon_chain_libp2p_json_serialization
CC: stew_tables
CC: eth_p2p_protocol_dsl
CC: beacon_chain_network
CC: beacon_chain_state_transition_epoch
CC: stew_bitranges
CC: prompt_prompt
CC: unicodedb_widths
CC: unicodedb_widths_data
arnetheduck commented 5 years ago

hm, right, forgot about that one - it should hopefully be gone with 1.0 - after that, probably we should enable both warnings and warnings-as-errors ideally

stefantalpalaru commented 5 years ago

I've also tried adding --verbosity:0. It doesn't help.

tersec commented 4 years ago

@stefantalpalaru

You really want end users to see this by default?

End users, probably not, but hiding that too well has instead occurred, and

libp2p_backend.nim(192, 58) template/generic instantiation from here
libp2p_backend.nim(197, 24) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(192, 58) template/generic instantiation from here
libp2p_backend.nim(197, 24) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(192, 58) template/generic instantiation from here
libp2p_backend.nim(197, 24) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(219, 30) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(219, 30) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(219, 30) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(245, 20) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(245, 20) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]
libp2p_backend.nim(214, 58) template/generic instantiation from here
libp2p_backend.nim(245, 20) Warning: Use one[T](varargs[Future[T]]); or is deprecated [Deprecated]

Is a real problem that it happens still isn't fixed. It's not blocking development, obviously, but ideally shouldn't be ignored until it literally breaks compilation, or shows up in an audit.

arnetheduck commented 4 years ago

https://github.com/status-im/nimbus-build-system/commit/e8e1f1c2cff5aebf74dff07b1cf119134267922b