doc: Updating docs from autotools to cmake

replaced --enable-debug with -DCMAKE_BUILD_TYPE=Debug in developer-notes
replaced --enable-multiprocess with -DWITH_MULTIPROCESS=ON
replaced --disable-zmq with -DWITH_ZMQ=OFF
This commit is contained in:
kevkevinpal 2024-09-11 19:58:55 -04:00
parent 0c4ff18ee9
commit a9964c0444
No known key found for this signature in database
GPG key ID: B4346A15246A925D
13 changed files with 36 additions and 41 deletions

View file

@ -81,7 +81,7 @@ if ! command -v gcovr > /dev/null; then
fi fi
if [[ ! -e ${TEST_BITCOIN_BINARY} ]]; then if [[ ! -e ${TEST_BITCOIN_BINARY} ]]; then
echo "Error: Executable ${TEST_BITCOIN_BINARY} not found. Run \"./configure --enable-lcov\" and compile." echo "Error: Executable ${TEST_BITCOIN_BINARY} not found. Run \"cmake -B build -DCMAKE_BUILD_TYPE=Coverage\" and compile."
exit 1 exit 1
fi fi
@ -90,7 +90,7 @@ get_file_suffix_count() {
} }
if [[ $(get_file_suffix_count gcno) == 0 ]]; then if [[ $(get_file_suffix_count gcno) == 0 ]]; then
echo "Error: Could not find any *.gcno files. The *.gcno files are generated by the compiler. Run \"./configure --enable-lcov\" and re-compile." echo "Error: Could not find any *.gcno files. The *.gcno files are generated by the compiler. Run \"cmake -B build -DCMAKE_BUILD_TYPE=Coverage\" and re-compile."
exit 1 exit 1
fi fi
@ -115,7 +115,7 @@ while [[ ${TEST_RUN_ID} -lt ${N_TEST_RUNS} ]]; do
fi fi
rm "${TEST_OUTPUT_TEMPFILE}" rm "${TEST_OUTPUT_TEMPFILE}"
if [[ $(get_file_suffix_count gcda) == 0 ]]; then if [[ $(get_file_suffix_count gcda) == 0 ]]; then
echo "Error: Running the test suite did not create any *.gcda files. The gcda files are generated when the instrumented test programs are executed. Run \"./configure --enable-lcov\" and re-compile." echo "Error: Running the test suite did not create any *.gcda files. The gcda files are generated when the instrumented test programs are executed. Run \"cmake -B build -DCMAKE_BUILD_TYPE=Coverage\" and re-compile."
exit 1 exit 1
fi fi
GCOVR_TEMPFILE=$(mktemp) GCOVR_TEMPFILE=$(mktemp)

View file

@ -8,7 +8,7 @@
| *libbitcoin_crypto* | Hardware-optimized functions for data encryption, hashing, message authentication, and key derivation. | | *libbitcoin_crypto* | Hardware-optimized functions for data encryption, hashing, message authentication, and key derivation. |
| *libbitcoin_kernel* | Consensus engine and support library used for validation by *libbitcoin_node*. | | *libbitcoin_kernel* | Consensus engine and support library used for validation by *libbitcoin_node*. |
| *libbitcoinqt* | GUI functionality used by *bitcoin-qt* and *bitcoin-gui* executables. | | *libbitcoinqt* | GUI functionality used by *bitcoin-qt* and *bitcoin-gui* executables. |
| *libbitcoin_ipc* | IPC functionality used by *bitcoin-node*, *bitcoin-wallet*, *bitcoin-gui* executables to communicate when [`--enable-multiprocess`](multiprocess.md) is used. | | *libbitcoin_ipc* | IPC functionality used by *bitcoin-node*, *bitcoin-wallet*, *bitcoin-gui* executables to communicate when [`-DWITH_MULTIPROCESS=ON`](multiprocess.md) is used. |
| *libbitcoin_node* | P2P and RPC server functionality used by *bitcoind* and *bitcoin-qt* executables. | | *libbitcoin_node* | P2P and RPC server functionality used by *bitcoind* and *bitcoin-qt* executables. |
| *libbitcoin_util* | Home for common functionality shared by different executables and libraries. Similar to *libbitcoin_common*, but lower-level (see [Dependencies](#dependencies)). | | *libbitcoin_util* | Home for common functionality shared by different executables and libraries. Similar to *libbitcoin_common*, but lower-level (see [Dependencies](#dependencies)). |
| *libbitcoin_wallet* | Wallet functionality used by *bitcoind* and *bitcoin-wallet* executables. | | *libbitcoin_wallet* | Wallet functionality used by *bitcoind* and *bitcoin-wallet* executables. |

View file

@ -418,8 +418,8 @@ see [test/functional/](/test/functional) for tests that run in `-regtest` mode.
### DEBUG_LOCKORDER ### DEBUG_LOCKORDER
Bitcoin Core is a multi-threaded application, and deadlocks or other Bitcoin Core is a multi-threaded application, and deadlocks or other
multi-threading bugs can be very difficult to track down. The `--enable-debug` multi-threading bugs can be very difficult to track down. The `-DCMAKE_BUILD_TYPE=Debug`
configure option adds `-DDEBUG_LOCKORDER` to the compiler flags. This inserts build option adds `-DDEBUG_LOCKORDER` to the compiler flags. This inserts
run-time checks to keep track of which locks are held and adds warnings to the run-time checks to keep track of which locks are held and adds warnings to the
`debug.log` file if inconsistencies are detected. `debug.log` file if inconsistencies are detected.
@ -429,9 +429,8 @@ Defining `DEBUG_LOCKCONTENTION` adds a "lock" logging category to the logging
RPC that, when enabled, logs the location and duration of each lock contention RPC that, when enabled, logs the location and duration of each lock contention
to the `debug.log` file. to the `debug.log` file.
The `--enable-debug` configure option adds `-DDEBUG_LOCKCONTENTION` to the The `-DCMAKE_BUILD_TYPE=Debug` build option adds `-DDEBUG_LOCKCONTENTION` to the
compiler flags. You may also enable it manually for a non-debug build by running compiler flags. You may also enable it manually by building with `-DDEBUG_LOCKCONTENTION` added to your CPPFLAGS,
configure with `-DDEBUG_LOCKCONTENTION` added to your CPPFLAGS,
i.e. `CPPFLAGS="-DDEBUG_LOCKCONTENTION"`, then build and run bitcoind. i.e. `CPPFLAGS="-DDEBUG_LOCKCONTENTION"`, then build and run bitcoind.
You can then use the `-debug=lock` configuration option at bitcoind startup or You can then use the `-debug=lock` configuration option at bitcoind startup or
@ -579,7 +578,7 @@ cmake -B build -DSANITIZERS=thread
If you are compiling with GCC you will typically need to install corresponding If you are compiling with GCC you will typically need to install corresponding
"san" libraries to actually compile with these flags, e.g. libasan for the "san" libraries to actually compile with these flags, e.g. libasan for the
address sanitizer, libtsan for the thread sanitizer, and libubsan for the address sanitizer, libtsan for the thread sanitizer, and libubsan for the
undefined sanitizer. If you are missing required libraries, the configure script undefined sanitizer. If you are missing required libraries, the build
will fail with a linker error when testing the sanitizer flags. will fail with a linker error when testing the sanitizer flags.
The test suite should pass cleanly with the `thread` and `undefined` sanitizers. You The test suite should pass cleanly with the `thread` and `undefined` sanitizers. You
@ -595,7 +594,7 @@ See the CI config for more examples, and upstream documentation for more informa
about any additional options. about any additional options.
Not all sanitizer options can be enabled at the same time, e.g. trying to build Not all sanitizer options can be enabled at the same time, e.g. trying to build
with `-DSANITIZERS=address,thread` will fail in the configure script as with `-DSANITIZERS=address,thread` will fail in the build as
these sanitizers are mutually incompatible. Refer to your compiler manual to these sanitizers are mutually incompatible. Refer to your compiler manual to
learn more about these options and which sanitizers are supported by your learn more about these options and which sanitizers are supported by your
compiler. compiler.
@ -619,7 +618,7 @@ The code is multi-threaded and uses mutexes and the
Deadlocks due to inconsistent lock ordering (thread 1 locks `cs_main` and then Deadlocks due to inconsistent lock ordering (thread 1 locks `cs_main` and then
`cs_wallet`, while thread 2 locks them in the opposite order: result, deadlock `cs_wallet`, while thread 2 locks them in the opposite order: result, deadlock
as each waits for the other to release its lock) are a problem. Compile with as each waits for the other to release its lock) are a problem. Compile with
`-DDEBUG_LOCKORDER` (or use `--enable-debug`) to get lock order inconsistencies `-DDEBUG_LOCKORDER` (or use `-DCMAKE_BUILD_TYPE=Debug`) to get lock order inconsistencies
reported in the `debug.log` file. reported in the `debug.log` file.
Re-architecting the core code so there are better-defined interfaces Re-architecting the core code so there are better-defined interfaces
@ -1062,8 +1061,8 @@ bool Chainstate::PreciousBlock(BlockValidationState& state, CBlockIndex* pindex)
``` ```
- Build and run tests with `-DDEBUG_LOCKORDER` to verify that no potential - Build and run tests with `-DDEBUG_LOCKORDER` to verify that no potential
deadlocks are introduced. As of 0.12, this is defined by default when deadlocks are introduced. This is defined by default when
configuring with `--enable-debug`. building with `-DCMAKE_BUILD_TYPE=Debug`.
- When using `LOCK`/`TRY_LOCK` be aware that the lock exists in the context of - When using `LOCK`/`TRY_LOCK` be aware that the lock exists in the context of
the current scope, so surround the statement and the code that needs the lock the current scope, so surround the statement and the code that needs the lock

View file

@ -4,7 +4,7 @@ _This document describes usage of the multiprocess feature. For design informati
## Build Option ## Build Option
On unix systems, the `--enable-multiprocess` build option can be passed to `./configure` to build new `bitcoin-node`, `bitcoin-wallet`, and `bitcoin-gui` executables alongside existing `bitcoind` and `bitcoin-qt` executables. On Unix systems, the `-DWITH_MULTIPROCESS=ON` build option can be passed to build the supplemental `bitcoin-node` and `bitcoin-gui` multiprocess executables.
## Debugging ## Debugging
@ -17,15 +17,15 @@ The multiprocess feature requires [Cap'n Proto](https://capnproto.org/) and [lib
``` ```
cd <BITCOIN_SOURCE_DIRECTORY> cd <BITCOIN_SOURCE_DIRECTORY>
make -C depends NO_QT=1 MULTIPROCESS=1 make -C depends NO_QT=1 MULTIPROCESS=1
CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site ./configure cmake -B build --toolchain=depends/x86_64-pc-linux-gnu/toolchain.cmake
make cmake --build build
src/bitcoin-node -regtest -printtoconsole -debug=ipc build/src/bitcoin-node -regtest -printtoconsole -debug=ipc
BITCOIND=bitcoin-node test/functional/test_runner.py BITCOIND=$(pwd)/build/src/bitcoin-node build/test/functional/test_runner.py
``` ```
The configure script will pick up settings and library locations from the depends directory, so there is no need to pass `--enable-multiprocess` as a separate flag when using the depends system (it's controlled by the `MULTIPROCESS=1` option). The `cmake` build will pick up settings and library locations from the depends directory, so there is no need to pass `-DWITH_MULTIPROCESS=ON` as a separate flag when using the depends system (it's controlled by the `MULTIPROCESS=1` option).
Alternately, you can install [Cap'n Proto](https://capnproto.org/) and [libmultiprocess](https://github.com/chaincodelabs/libmultiprocess) packages on your system, and just run `./configure --enable-multiprocess` without using the depends system. The configure script will be able to locate the installed packages via [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/). See [Installation](https://github.com/chaincodelabs/libmultiprocess/blob/master/doc/install.md) section of the libmultiprocess readme for install steps. See [build-unix.md](build-unix.md) and [build-osx.md](build-osx.md) for information about installing dependencies in general. Alternately, you can install [Cap'n Proto](https://capnproto.org/) and [libmultiprocess](https://github.com/chaincodelabs/libmultiprocess) packages on your system, and just run `cmake -B build -DWITH_MULTIPROCESS=ON` without using the depends system. The `cmake` build will be able to locate the installed packages via [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/). See [Installation](https://github.com/chaincodelabs/libmultiprocess/blob/master/doc/install.md) section of the libmultiprocess readme for install steps. See [build-unix.md](build-unix.md) and [build-osx.md](build-osx.md) for information about installing dependencies in general.
## Usage ## Usage

View file

@ -18,8 +18,8 @@ We use automated scripts to help extract translations in both Qt, and non-Qt sou
To automatically regenerate the `bitcoin_en.ts` file, run the following commands: To automatically regenerate the `bitcoin_en.ts` file, run the following commands:
```sh ```sh
cd src/ cmake -B build --preset dev-mode -DWITH_BDB=ON -DBUILD_GUI=ON
make translate cmake --build build --target translate
``` ```
**Example Qt translation** **Example Qt translation**

View file

@ -1,10 +1,8 @@
Translation Strings Policy # Translation Strings Policy
===========================
This document provides guidelines for internationalization of the Bitcoin Core software. This document provides guidelines for internationalization of the Bitcoin Core software.
How to translate? ## How to translate?
------------------
To mark a message as translatable To mark a message as translatable
@ -14,8 +12,7 @@ To mark a message as translatable
No internationalization is used for e.g. developer scripts outside `src`. No internationalization is used for e.g. developer scripts outside `src`.
Strings to be translated ## Strings to be translated
-------------------------
On a high level, these strings are to be translated: On a high level, these strings are to be translated:
@ -27,8 +24,7 @@ Do not translate technical or extremely rare errors.
Anything else that appears to the user in the GUI is to be translated. This includes labels, menu items, button texts, tooltips and window titles. Anything else that appears to the user in the GUI is to be translated. This includes labels, menu items, button texts, tooltips and window titles.
This includes messages passed to the GUI through the UI interface through `InitMessage`, `ThreadSafeMessageBox` or `ShowProgress`. This includes messages passed to the GUI through the UI interface through `InitMessage`, `ThreadSafeMessageBox` or `ShowProgress`.
General recommendations ## General recommendations
------------------------
### Avoid unnecessary translation strings ### Avoid unnecessary translation strings
@ -97,4 +93,4 @@ The second example reduces the number of pluralized words that translators have
During a string freeze (often before a major release), no translation strings are to be added, modified or removed. During a string freeze (often before a major release), no translation strings are to be added, modified or removed.
This can be checked by executing `make translate` in the `src` directory, then verifying that `bitcoin_en.ts` remains unchanged. This can be checked by building the `translate` target with `cmake` ([instructions](translation_process.md)), then verifying that `bitcoin_en.ts` remains unchanged.

View file

@ -47,10 +47,10 @@ operation.
## Enabling ## Enabling
By default, the ZeroMQ feature is automatically compiled in if the By default, the ZeroMQ feature is automatically compiled in if the
necessary prerequisites are found. To disable, use --disable-zmq necessary prerequisites are found. To disable, use -DWITH_ZMQ=OFF
during the *configure* step of building bitcoind: during the *configure* step of building bitcoind:
$ ./configure --disable-zmq (other options) $ cmake -B build -DWITH_ZMQ=OFF (other options)
To actually enable operation, one must set the appropriate options on To actually enable operation, one must set the appropriate options on
the command line or in the configuration file. the command line or in the configuration file.
@ -163,7 +163,7 @@ Note that for `*block` topics, when the block chain tip changes,
a reorganisation may occur and just the tip will be notified. a reorganisation may occur and just the tip will be notified.
It is up to the subscriber to retrieve the chain from the last known It is up to the subscriber to retrieve the chain from the last known
block to the new tip. Also note that no notification will occur if the tip block to the new tip. Also note that no notification will occur if the tip
was in the active chain--as would be the case after calling invalidateblock RPC. was in the active chain, as would be the case after calling the `invalidateblock` RPC.
In contrast, the `sequence` topic publishes all block connections and In contrast, the `sequence` topic publishes all block connections and
disconnections. disconnections.

View file

@ -56,7 +56,7 @@ files = sys.argv[1:]
XGETTEXT=os.getenv('XGETTEXT', 'xgettext') XGETTEXT=os.getenv('XGETTEXT', 'xgettext')
if not XGETTEXT: if not XGETTEXT:
print('Cannot extract strings: xgettext utility is not installed or not configured.',file=sys.stderr) print('Cannot extract strings: xgettext utility is not installed or not configured.',file=sys.stderr)
print('Please install package "gettext" and re-run \'./configure\'.',file=sys.stderr) print('Please install package "gettext" and re-run \'cmake -B build\'.',file=sys.stderr)
sys.exit(1) sys.exit(1)
child = Popen([XGETTEXT,'--output=-','--from-code=utf-8','-n','--keyword=_'] + files, stdout=PIPE) child = Popen([XGETTEXT,'--output=-','--from-code=utf-8','-n','--keyword=_'] + files, stdout=PIPE)
(out, err) = child.communicate() (out, err) = child.communicate()

View file

@ -99,7 +99,7 @@ sudo apt-get install qtcreator
#### Setup Qt Creator #### Setup Qt Creator
1. Make sure you've installed all dependencies specified in your systems build instructions 1. Make sure you've installed all dependencies specified in your systems build instructions
2. Follow the compile instructions for your system, run `./configure` with the `--enable-debug` flag 2. Follow the compile instructions for your system, adding the `-DCMAKE_BUILD_TYPE=Debug` build flag
3. Start Qt Creator. At the start page, do: `New` -> `Import Project` -> `Import Existing Project` 3. Start Qt Creator. At the start page, do: `New` -> `Import Project` -> `Import Existing Project`
4. Enter `bitcoin-qt` as the Project Name and enter the absolute path to `src/qt` as Location 4. Enter `bitcoin-qt` as the Project Name and enter the absolute path to `src/qt` as Location
5. Check over the file selection, you may need to select the `forms` directory (necessary if you intend to edit *.ui files) 5. Check over the file selection, you may need to select the `forms` directory (necessary if you intend to edit *.ui files)

View file

@ -22,7 +22,7 @@
#include <utility> #include <utility>
#ifndef WIN32 #ifndef WIN32
// for posix_fallocate, in configure.ac we check if it is present after this // for posix_fallocate, in cmake/introspection.cmake we check if it is present after this
#ifdef __linux__ #ifdef __linux__
#ifdef _POSIX_C_SOURCE #ifdef _POSIX_C_SOURCE

View file

@ -488,7 +488,7 @@ def main():
if not enable_bitcoind: if not enable_bitcoind:
print("No functional tests to run.") print("No functional tests to run.")
print("Rerun ./configure with --with-daemon and then make") print("Re-compile with the -DBUILD_DAEMON=ON build option")
sys.exit(1) sys.exit(1)
# Build list of tests # Build list of tests

View file

@ -14,7 +14,7 @@ from subprocess import check_output, STDOUT, CalledProcessError
from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES
IGNORE_WORDS_FILE = 'test/lint/spelling.ignore-words.txt' IGNORE_WORDS_FILE = 'test/lint/spelling.ignore-words.txt'
FILES_ARGS = ['git', 'ls-files', '--', ":(exclude)build-aux/m4/", ":(exclude)contrib/seeds/*.txt", ":(exclude)depends/", ":(exclude)doc/release-notes/", ":(exclude)src/qt/locale/", ":(exclude)src/qt/*.qrc", ":(exclude)contrib/guix/patches"] FILES_ARGS = ['git', 'ls-files', '--', ":(exclude)contrib/seeds/*.txt", ":(exclude)depends/", ":(exclude)doc/release-notes/", ":(exclude)src/qt/locale/", ":(exclude)src/qt/*.qrc", ":(exclude)contrib/guix/patches"]
FILES_ARGS += [f":(exclude){dir}" for dir in SHARED_EXCLUDED_SUBTREES] FILES_ARGS += [f":(exclude){dir}" for dir in SHARED_EXCLUDED_SUBTREES]

View file

@ -5,7 +5,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test framework for bitcoin utils. """Test framework for bitcoin utils.
Runs automatically during `make check`. Runs automatically during `ctest --test-dir build/`.
Can also be run manually.""" Can also be run manually."""