Skip to content

Conversation

hebasto
Copy link
Owner

@hebasto hebasto commented Mar 16, 2024

See discussion in #118 (comment).

Can be tested in the following ways:

  • applying the -LH command line option
  • using cmake-gui
  • direct observing of the CMakeCache.txt file content

Add docstrings for options when cross-compiling.
@hebasto
Copy link
Owner Author

hebasto commented Mar 16, 2024

Friendly ping @vasild @m3dwards @pablomartin4btc @TheCharlatan :)

@hebasto hebasto added the bug Something isn't working label Mar 16, 2024
@hebasto hebasto changed the title cmake: Add docstrings for options when cross-compiling. cmake: Add docstrings for options when cross-compiling Mar 16, 2024
Copy link

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 840e494

Tested using -LH command line option (list options with human-readable help) on the cmake configured with --toolchain after cross-building depends.
...

-- Cache values
// Build bench_bitcoin executable.
BUILD_BENCH:BOOL=ON

// Build bitcoin-cli executable.
BUILD_CLI:BOOL=ON

// Build bitcoind executable.
BUILD_DAEMON:BOOL=ON

// Build fuzz binary.
BUILD_FUZZ_BINARY:BOOL=ON

// Build test_bitcoin-qt executable.
BUILD_GUI_TESTS:BOOL=ON

// Build the testing tree.
BUILD_TESTING:BOOL=ON

// Build test_bitcoin executable.
BUILD_TESTS:BOOL=ON

// Build bitcoin-tx executable.
BUILD_TX:BOOL=ON

// Build bitcoin-util executable.
BUILD_UTIL:BOOL=ON

// Build bitcoin-wallet tool.
BUILD_WALLET_TOOL:BOOL=ON

// Use ccache for compiling. "AUTO" means "ON" if ccache is found.
CCACHE:STRING=AUTO

// Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ...
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo

// Convert GNU import libraries to MS format (requires Visual Studio)
CMAKE_GNUtoMS:BOOL=OFF

// Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local

// The CMake toolchain file
CMAKE_TOOLCHAIN_FILE:FILEPATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/share/toolchain.cmake

// Enable wallet.
ENABLE_WALLET:BOOL=ON

// Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY.
FUZZ:BOOL=OFF

// Attempt to harden the resulting executables.
HARDENING:BOOL=ON

// Install man pages.
INSTALL_MAN:BOOL=ON

// The directory containing a CMake configuration file for QT.
QT_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5

// The directory containing a CMake configuration file for Qt5AccessibilitySupport.
Qt5AccessibilitySupport_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5AccessibilitySupport

// The directory containing a CMake configuration file for Qt5Core.
Qt5Core_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5Core

// The directory containing a CMake configuration file for Qt5EventDispatcherSupport.
Qt5EventDispatcherSupport_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5EventDispatcherSupport

// The directory containing a CMake configuration file for Qt5FontDatabaseSupport.
Qt5FontDatabaseSupport_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5FontDatabaseSupport

// The directory containing a CMake configuration file for Qt5Gui.
Qt5Gui_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5Gui

// The directory containing a CMake configuration file for Qt5LinguistTools.
Qt5LinguistTools_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5LinguistTools

// The directory containing a CMake configuration file for Qt5Network.
Qt5Network_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5Network

// The directory containing a CMake configuration file for Qt5Test.
Qt5Test_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5Test

// The directory containing a CMake configuration file for Qt5ThemeSupport.
Qt5ThemeSupport_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5ThemeSupport

// The directory containing a CMake configuration file for Qt5Widgets.
Qt5Widgets_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5Widgets

// The directory containing a CMake configuration file for Qt5WindowsUIAutomationSupport.
Qt5WindowsUIAutomationSupport_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5WindowsUIAutomationSupport

// The directory containing a CMake configuration file for Qt5.
Qt5_DIR:PATH=/home/pablo/workspace/bitcoin-hebasto/depends/x86_64-w64-mingw32/lib/cmake/Qt5

// Attempt to reduce exported symbols in the resulting executables.
REDUCE_EXPORTS:BOOL=OFF

// Enable features that depend on the C++ thread_local keyword (currently just thread names in debug logs).
THREADLOCAL:BOOL=ON

// Warn when using a Berkeley DB (BDB) version other than 4.8.
WARN_INCOMPATIBLE_BDB:BOOL=ON

// Treat compiler warnings as errors.
WERROR:BOOL=OFF

// Enable Berkeley DB (BDB) wallet support. "AUTO" means "ON" if libdb_cxx is found.
WITH_BDB:STRING=AUTO

// Enable external signer support. "AUTO" means "ON" if Boost.Process is found.
WITH_EXTERNAL_SIGNER:STRING=AUTO

// Build GUI ([AUTO], Qt5, OFF)
WITH_GUI:STRING=AUTO

// Enable UPnP. "AUTO" means "ON" if libminiupnpc is found.
WITH_MINIUPNPC:STRING=AUTO

// Enable NAT-PMP. "AUTO" means "ON" if libnatpmp is found.
WITH_NATPMP:STRING=AUTO

// Enable QR code support. "AUTO" means "ON" if libqrencode is found.
WITH_QRENCODE:STRING=AUTO

// Enable SQLite wallet support. "AUTO" means "ON" if libsqlite3 is found.
WITH_SQLITE:STRING=AUTO

// Enable tracepoints for Userspace, Statically Defined Tracing. "AUTO" means "ON" if sys/sdt.h is found.
WITH_USDT:STRING=AUTO

// Enable ZMQ notifications. "AUTO" means "ON" if libzmq is found.
WITH_ZMQ:STRING=AUTO

@hebasto hebasto merged commit 2b2edb3 into cmake-staging Mar 18, 2024
hebasto pushed a commit that referenced this pull request Oct 7, 2024
This should be long enough (with headroom) for our longest running tests,
which even under MSAN, TSAN, Valgrind, etc max out at about 800s.

i.e under Valgrind I see the longer runtimes as:
```bash
135/136 Test   #8: bench_sanity_check_high_priority .....   Passed  371.19 sec
136/136 Test #122: coinselector_tests ...................   Passed  343.39 sec
```

In the CI `tests` under TSAN:
```bash
tests ................................   Passed  795.20 sec
```
and MSAN:
```bash
tests ................................   Passed  658.48 sec
```

This will also prevent the current issue we are seeing of `ctest`
running until it reaches the CI timeout, see bitcoin#30969.

However, we still need to figure out what underlying issue is causing
the tests to (sometimes) run for so long, but in the mean time, this
will stop `ctest` wasting our CI CPU.
hebasto pushed a commit that referenced this pull request Oct 7, 2024
56aad83 ci: set a ctest timeout of 1200 (20 minutes) (fanquake)

Pull request description:

  This should be long enough (with headroom) for our longest running tests, which even under MSAN, TSAN, Valgrind, etc max out at about 800s.

  i.e under Valgrind I see the longer runtimes as:
  ```bash
  135/136 Test   #8: bench_sanity_check_high_priority .....   Passed  371.19 sec
  136/136 Test #122: coinselector_tests ...................   Passed  343.39 sec
  ```

  In the CI `tests` [under TSAN](https://cirrus-ci.com/task/6321297691508736?logs=ci#L2520):
  ```bash
  tests ................................   Passed  795.20 sec
  ```
  [and MSAN](https://cirrus-ci.com/task/4913922807955456?logs=ci#L2226):
  ```bash
  tests ................................   Passed  658.48 sec
  ```

  This will also prevent the current issue we are seeing of `ctest` running until it reaches the CI timeout, see bitcoin#30969.

  We still need to figure out what underlying issue is causing the tests to (sometimes) run for so long, but in the mean time, this will stop `ctest` wasting our CI CPU. It should also make it more clear in the logs, exactly which test is the one that is hitting the timeout.

ACKs for top commit:
  maflcko:
    review ACK 56aad83
  tdb3:
    re ACK 56aad83

Tree-SHA512: 43c0dc12b8b12b1d9804751a9816935e2abbe962b451e12a268f2d2c430bc568b83995dbc405f100b596dfb0f1e9f65b78074de98916592d3ae4ebc2126e3a6c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants