Port Build on 11.1 but Fails on 10.3

I have a port that successfully builds on 11.1 but fails to build on 10.3. Specifically at this point, where you can see it's successful on the 11.1 system:

Code:
/usr/local/bin/ccache c++ -std=c++11 -DHAVE_CONFIG_H -I. -I../src/config  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I. -I./obj -I/usr/local/include/db48/ -DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC -pthread -I/usr/local/include -I./leveldb/include -I./leveldb/helpers/memenv -I/usr/include -I/usr/include -I./secp256k1/include -I./univalue/include -I/usr/local/include/db48/  -I/usr/local/include  -I/usr/local/include -D_THREAD_SAFE -pthread  -Qunused-arguments -I/usr/local/include -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -Wstack-protector -fstack-protector-all  -fPIE -O2 -pipe -fstack-protector -fno-strict-aliasing  -I/usr/local/include/db48 -MT libbitcoin_server_a-init.o -MD -MP -MF .deps/libbitcoin_server_a-init.Tpo -c -o libbitcoin_server_a-init.o `test -f 'init.cpp' || echo './'`init.cpp

On the 10.3 system it fails with the following error:

Code:
/usr/local/bin/ccache c++ -std=c++11 -DHAVE_CONFIG_H -I. -I../src/config  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I. -I./obj -I/usr/local/include/db48/ -DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC -pthread -I/usr/local/include -I./leveldb/include -I./leveldb/helpers/memenv -I/usr/include -I/usr/include -I./secp256k1/include -I./univalue/include -I/usr/local/include/db48/  -I/usr/local/include  -I/usr/local/include -D_THREAD_SAFE -pthread  -Qunused-arguments -I/usr/local/include -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -Wstack-protector -fstack-protector-all  -fPIE -O2 -pipe -fstack-protector -fno-strict-aliasing  -I/usr/local/include/db48 -MT libbitcoin_server_a-init.o -MD -MP -MF .deps/libbitcoin_server_a-init.Tpo -c -o libbitcoin_server_a-init.o `test -f 'init.cpp' || echo './'`init.cpp
In file included from init.cpp:13:
In file included from ./addrman.h:8:
In file included from ./netbase.h:13:
In file included from ./serialize.h:15:
/usr/include/c++/v1/list:226:9: error: field has incomplete type 'CAccountingEntry'
   _Tp __value_;
       ^
/usr/include/c++/v1/type_traits:2370:27: note: in instantiation of template class 'std::__1::__list_node<CAccountingEntry, void *>' requested here
                decltype(__is_constructible_test(declval<_Tp>(), declval<_Args>()...))
                         ^
/usr/include/c++/v1/type_traits:2419:14: note: in instantiation of template class 'std::__1::__libcpp_is_constructible<false, std::__1::allocator<std::__1::__list_node<CAccountingEntry, void *> >>' requested here
   : public __libcpp_is_constructible<is_scalar<_Tp>::value || is_reference<_Tp>::value,
            ^
/usr/include/c++/v1/type_traits:2445:14: note: in instantiation of template class 'std::__1::__is_constructible_void_check<false, std::__1::allocator<std::__1::__list_node<CAccountingEntry, void *> >>' requested here
   : public __is_constructible_void_check<__contains_void<_Tp, _Args...>::value
            ^
/usr/include/c++/v1/type_traits:2936:41: note: in instantiation of template class 'std::__1::is_constructible<std::__1::allocator<std::__1::__list_node<CAccountingEntry, void *> >>' requested here
   : __libcpp_is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, is_reference<_Tp>::value, _Tp, _Args...>
                                       ^
/usr/include/c++/v1/type_traits:3059:14: note: in instantiation of template class 'std::__1::is_nothrow_constructible<std::__1::allocator<std::__1::__list_node<CAccountingEntry, void *> >>' requested here
   : public is_nothrow_constructible<_Tp>
            ^
/usr/include/c++/v1/list:832:20: note: in instantiation of template class 'std::__1::is_nothrow_default_constructible<std::__1::allocator<std::__1::__list_node<CAccountingEntry, void *> > >' requested here
       _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
                  ^
/usr/include/c++/v1/__config:349:34: note: expanded from macro '_NOEXCEPT_'
#  define _NOEXCEPT_(x) noexcept(x)
                                ^
./wallet/wallet.h:515:5: note: in instantiation of exception specification for 'list' requested here
   CWallet()
   ^
./wallet/walletdb.h:22:7: note: forward declaration of 'CAccountingEntry'
class CAccountingEntry;
     ^
1 error generated.

I also tried having it use gcc6 instead, but the failure is different (don't know why):

Code:
main.cpp:(.text._ZN5boost4math6detail9gamma_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EENS0_7lanczos12lanczos17m64EEET_SD_RKT0_RKT1_[_ZN5boost4math6detail9gamma_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EENS0_7lanczos12lanczos17m64EEET_SD_RKT0_RKT1_]+0x2a1): warning: powl has lower than advertised precision
libbitcoin_util.a(libbitcoin_util_a-util.o): In function `SetupEnvironment()':
util.cpp:(.text+0x99a): undefined reference to `boost::filesystem::path::imbue(std::locale const&)'
util.cpp:(.text+0x9a5): undefined reference to `boost::filesystem::path::imbue(std::locale const&)'
libbitcoin_util.a(libbitcoin_util_a-util.o): In function `boost::program_options::detail::basic_config_file_iterator<char>::getline(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
util.cpp:(.text._ZN5boost15program_options6detail26basic_config_file_iteratorIcE7getlineERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5boost15program_options6detail26basic_config_file_iteratorIcE7getlineERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xfc): undefined reference to `boost::program_options::to_internal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
libbitcoin_util.a(libbitcoin_util_a-util.o): In function `boost::program_options::detail::basic_config_file_iterator<char>::basic_config_file_iterator(std::istream&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool)':
util.cpp:(.text._ZN5boost15program_options6detail26basic_config_file_iteratorIcEC2ERSiRKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessISB_ESaISB_EEb[_ZN5boost15program_options6detail26basic_config_file_iteratorIcEC5ERSiRKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessISB_ESaISB_EEb]+0x13): undefined reference to `boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool)'
libbitcoin_wallet.a(libbitcoin_wallet_a-db.o): In function `CDBEnv::Verify(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool (*)(CDBEnv&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))':
db.cpp:(.text+0x2c70): undefined reference to `Db::verify(char const*, char const*, std::ostream*, unsigned int)'
libbitcoin_wallet.a(libbitcoin_wallet_a-db.o): In function `CDBEnv::Salvage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::vector<std::pair<std::vector<unsigned char, std::allocator<unsigned char> >, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<std::pair<std::vector<unsigned char, std::allocator<unsigned char> >, std::vector<unsigned char, std::allocator<unsigned char> > > > >&)':
db.cpp:(.text+0x300d): undefined reference to `Db::verify(char const*, char const*, std::ostream*, unsigned int)'
libbitcoin_wallet.a(libbitcoin_wallet_a-walletdb.o): In function `AutoBackupWallet(CWallet*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
walletdb.cpp:(.text+0x7bdf): undefined reference to `boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
collect2: error: ld returned 1 exit status

The full logs to each build are available here:

http://pkg.ny-us.morante.net/poudri...8-01-15_01h04m12s/logs/terracoin-0.12.1.6.log
http://pkg.ny-us.morante.net/poudri..._01h04m09s/logs/errors/terracoin-0.12.1.6.log
http://pkg.ny-us.morante.net/poudri..._01h52m05s/logs/errors/terracoin-0.12.1.6.log

The port skeleton is view-able here:
https://github.com/tuaris/FreeBSD-Coin-Ports/blob/master/ports/terracoin/Makefile
 
The links are for your local network and don't work here.
 
Try with USES=compiler:c++14-lang to get a newer compiler on 10.3 (ignore the fact that it says c++14 please :)).

I also tried having it use gcc6 instead, but the failure is different (don't know why):
Because gcc uses libstdc++ which is incompatible with LLVM's libc++ which boost is linked with.

Assuming you want to submit this for inclusion in the ports tree at some point, some review items below.
Code:
.if ${PORT_OPTIONS:MXYZ}
...
.endif
All of these kinds of constructs can be replaced by options helpers.
https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-options.html

Code:
QT_BINARY=		${PORTNAME}-qt
CLI_BINARY=		${PORTNAME}-cli
TX_BINARY=		${PORTNAME}-tx
DAEMON=			${PORTNAME}d

PLIST_SUB+=	EXECUTABLE_QT=bin/${QT_BINARY} \
			EXECUTABLE_CLI=bin/${CLI_BINARY} \
			EXECUTABLE_TX=bin/${TX_BINARY} \
			EXECUTABLE_DAEMON=bin/${DAEMON} \
			PORTNAME=${PORTNAME}
This makes the pkg-plist and the port harder to read. Is it really necessary? It'd be nicer to just use e.g. bin/terracoin-qt directly instead.
 
Try with USES=compiler:c++14-lang to get a newer compiler on 10.3.

That worked, thank you. I'm assuming that the codebase simply requires a newer version of the compiler that wasn't available by default on 10.3?

Assuming you want to submit this for inclusion in the ports tree at some point, some review items below.

Code:
.if ${PORT_OPTIONS:MXYZ}
...
.endif
All of these kinds of constructs can be replaced by options helpers.
https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-options.html

Thanks for the tips. This is one of the older ports that hasn't seen many updates. If this was a port I would submit I would clean it up a lot before doing so.

Code:
QT_BINARY=        ${PORTNAME}-qt
CLI_BINARY=        ${PORTNAME}-cli
TX_BINARY=        ${PORTNAME}-tx
DAEMON=            ${PORTNAME}d

PLIST_SUB+=    EXECUTABLE_QT=bin/${QT_BINARY} \
            EXECUTABLE_CLI=bin/${CLI_BINARY} \
            EXECUTABLE_TX=bin/${TX_BINARY} \
            EXECUTABLE_DAEMON=bin/${DAEMON} \
            PORTNAME=${PORTNAME}
This makes the pkg-plist and the port harder to read. Is it really necessary? It'd be nicer to just use e.g. bin/terracoin-qt directly instead.

I agree it would be easier to read with your suggestion. The reason behind using variables is because I maintain several similar ports and always add new ones based on the same Makefiles/skeletons. Having the variables just makes the cloning process simpler.

Not sure if I plan on adding all these ports or maybe looking into making a meta-port. I mostly use this for myself and doubt there is much demand/interest for many of the crypto currencies that I've ported.
 
Back
Top