steemit / steem

The blockchain for Smart Media Tokens (SMTs) and decentralized applications.
https://steem.com
Other
1.95k stars 793 forks source link

Build error on Master #2487

Open BhuzOr opened 6 years ago

BhuzOr commented 6 years ago

Trying to build latest master with std allocator ON I firstly got a generic error:

CMakeFiles/Makefile2:4643: recipe for target 'programs/steemd/CMakeFiles/steemd.dir/rule' failed
make[1]: *** [programs/steemd/CMakeFiles/steemd.dir/rule] Error 2
Makefile:1124: recipe for target 'steemd' failed
make: *** [steemd] Error 2

on a retry I also got two more specific error:

[ 78%] Building CXX object libraries/protocol/CMakeFiles/steem_protocol.dir/sign_state.cpp.o
/home/bhuz/steem/libraries/chainbase/src/chainbase.cpp: In member function ‘void chainbase::database::resize(size_t)’:
/home/bhuz/steem/libraries/chainbase/src/chainbase.cpp:112:7: error: ‘_segment’ was not declared in this scope
       _segment.reset();
       ^
/home/bhuz/steem/libraries/chainbase/src/chainbase.cpp:113:7: error: ‘_meta’ was not declared in this scope
       _meta.reset();
       ^
[ 78%] Building CXX object libraries/protocol/CMakeFiles/steem_protocol.dir/transaction.cpp.o
libraries/chainbase/CMakeFiles/chainbase.dir/build.make:62: recipe for target 'libraries/chainbase/CMakeFiles/chainbase.dir/src/chainbase.cpp.o' failed
make[3]: *** [libraries/chainbase/CMakeFiles/chainbase.dir/src/chainbase.cpp.o] Error 1
CMakeFiles/Makefile2:1760: recipe for target 'libraries/chainbase/CMakeFiles/chainbase.dir/all' failed
make[2]: *** [libraries/chainbase/CMakeFiles/chainbase.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
[ 78%] Building CXX object libraries/protocol/CMakeFiles/steem_protocol.dir/block.cpp.o
[ 80%] Building CXX object libraries/protocol/CMakeFiles/steem_protocol.dir/asset.cpp.o
[ 80%] Linking CXX static library libsteem_utilities.a
[ 80%] Built target steem_utilities
[ 80%] Building CXX object libraries/protocol/CMakeFiles/steem_protocol.dir/version.cpp.o
[ 80%] Building CXX object libraries/protocol/CMakeFiles/steem_protocol.dir/get_config.cpp.o
[ 80%] Linking CXX static library libsteem_protocol.a
[ 80%] Built target steem_protocol
CMakeFiles/Makefile2:4643: recipe for target 'programs/steemd/CMakeFiles/steemd.dir/rule' failed
make[1]: *** [programs/steemd/CMakeFiles/steemd.dir/rule] Error 2
Makefile:1124: recipe for target 'steemd' failed
make: *** [steemd] Error 2
BhuzOr commented 6 years ago

Building with std allocator OFF:

[ 82%] Built target rocksdb
/home/bhuz/steem/libraries/chain/steem_evaluator.cpp: In member function ‘void steem::chain::witness_update_evaluator::do_apply(const steem::protocol::witness_update_operation&)’:
/home/bhuz/steem/libraries/chain/steem_evaluator.cpp:98:118: note: #pragma message: TODO: This needs to be part of HF 20 and moved to validate if not triggered in previous blocks
    #pragma message( "TODO: This needs to be part of HF 20 and moved to validate if not triggered in previous blocks" )
                                                                                                                      ^
/home/bhuz/steem/libraries/chain/steem_evaluator.cpp:104:118: note: #pragma message: TODO: This needs to be part of HF 20 and moved to validate if not triggered in previous blocks
    #pragma message( "TODO: This needs to be part of HF 20 and moved to validate if not triggered in previous blocks" )
                                                                                                                      ^
/home/bhuz/steem/libraries/chain/steem_evaluator.cpp: In function ‘void steem::chain::initialize_account_object(steem::chain::account_object&, const account_name_type&, const steem::protocol::public_key_type&, const steem::chain::dynamic_global_property_object&, bool, const account_name_type&, uint32_t)’:
/home/bhuz/steem/libraries/chain/steem_evaluator.cpp:263:105: note: #pragma message: TODO: "If after HF 20, there are no temp account creations, the HF check can be removed."
/home/bhuz/steem/libraries/chain/steem_evaluator.cpp:264:24: error: ‘STEEM_HARDFORK_0_20__1782’ was not declared in this scope
       if( ( hardfork < STEEM_HARDFORK_0_20__1782 ) || ( recovery_account != STEEM_TEMP_ACCOUNT ) )
                        ^
/home/bhuz/steem/libraries/chain/steem_evaluator.cpp: In member function ‘void steem::chain::comment_evaluator::do_apply(const steem::protocol::comment_operation&)’:
/home/bhuz/steem/libraries/chain/steem_evaluator.cpp:624:99: note: #pragma message: TODO: "Cleanup this logic after HF 20. Old ops don't need to check pre-hf20 times."
/home/bhuz/steem/libraries/chain/steem_evaluator.cpp:625:29: error: ‘STEEM_HARDFORK_0_20__2019’ was not declared in this scope
       if( _db.has_hardfork( STEEM_HARDFORK_0_20__2019 ) )
                             ^
/home/bhuz/steem/libraries/chain/steem_evaluator.cpp: In member function ‘void steem::chain::delegate_vesting_shares_evaluator::do_apply(const steem::protocol::delegate_vesting_shares_operation&)’:
/home/bhuz/steem/libraries/chain/steem_evaluator.cpp:2196:109: note: #pragma message: TODO: Update get_effective_vesting_shares when modifying this operation to support SMTs.
 #pragma message( "TODO: Update get_effective_vesting_shares when modifying this operation to support SMTs." )
                                                                                                             ^
libraries/chain/CMakeFiles/steem_chain.dir/build.make:134: recipe for target 'libraries/chain/CMakeFiles/steem_chain.dir/steem_evaluator.cpp.o' failed
make[3]: *** [libraries/chain/CMakeFiles/steem_chain.dir/steem_evaluator.cpp.o] Error 1
CMakeFiles/Makefile2:1877: recipe for target 'libraries/chain/CMakeFiles/steem_chain.dir/all' failed
make[2]: *** [libraries/chain/CMakeFiles/steem_chain.dir/all] Error 2
CMakeFiles/Makefile2:4643: recipe for target 'programs/steemd/CMakeFiles/steemd.dir/rule' failed
make[1]: *** [programs/steemd/CMakeFiles/steemd.dir/rule] Error 2
Makefile:1124: recipe for target 'steemd' failed
make: *** [steemd] Error 2
theoreticalbts commented 6 years ago

I just accidentally reproduced this. The problem for STD allocator OFF is an out-of-date autogenerated hardfork.hpp, which may be fixed by either (a) using a brand-new build directory, or (b) if you want to re-use an existing build directory [1]:

rm libraries/protocol/include/steem/protocol/hardfork.hpp

If the file does not exist, you ran from the wrong directory.

I'm not closing this ticket because the STD allocator ON build failure still needs investigated.

[1] I don't recommend re-using your build directory. Because sometimes, problems like this occur. But even though I don't recommend it, it sure is convenient if you do intense iterative development on steemd and need to recompile multiple times a day :)