dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

fix: fix depends builds on FreeBSD hosts #6109

Closed kwvg closed 1 month ago

kwvg commented 1 month ago

Additional Information

Despite builders for BSD-based platforms being backported as early as dash#5362, they didn't work on account of using a curl flag, --retry, that was lopped off other builders in dash#3003 as a way to mitigate aberrant Travis CI-specific behaviour.

As the variable $(DOWNLOAD_RETRIES) was removed as part of that mitigation, the introduction of builders that rely on this variable caused failures as the flag was accompanied by nothing. As our CI host isn't based on FreeBSD, this went unnoticed. When deciding between extending the existing patch and reverting it, reverting it proved to be more attractive on account of us no longer using Travis CI and the revert bringing us closer to upstream.

Additionally, the std::unary_function patch that was introduced in dash#5610 proves to be necessary on BSD-based platforms as well (had to be extended for and tested on GhostBSD, based on FreeBSD 13.2-STABLE, Clang 16). Instead of conditionally patching based on platform and compiler, a more reliable patch would be to downgrade the C++ version used to build Boost at the last version to have std::unary_function, which would be C++11, albeit deprecated (source).

Though it's likely this route wasn't taken originally due to compiler errors that happened despite downgrading to C++11. These errors were due to the compiler objecting to std::unary_function usage in Boost headers, despite the backport of bitcoin#25436, which should've solved this problem. The reason the errors were still persisting is because the necessary flag, -DBOOST_NO_CXX98_FUNCTION_BASE, was only applied if --enable-suppress-external-warnings was set. CI didn't catch this, as the flag is always set, to keep log lengths manageable. This has been rectified.

All changes combined, one should be able to build non-Qt Dash binaries using depends though building the Qt client from depends unfortunately remains a problem, even upstream (source, source).

Demo

Based on bbc99571f36ecfd817dc33b883c5e6f120240270

Built using:

Dash-Qt running on GhostBSD

Checklist: