mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-09 22:28:51 +02:00
Merge bitcoin/bitcoin#31679: cmake: Install internal binaries to <prefix>/libexec/
f49840dd90doc: Fix typo in files.md (Ryan Ofsky)f5cf0b1cccbitcoin wrapper: improve help output (Ryan Ofsky)c810b168b8doc: Add description of installed files to files.md (Ryan Ofsky)94ffd01a02doc: Add release notes describing libexec/ binaries (Ryan Ofsky)cd97905ebccmake: Move internal binaries from bin/ to libexec/ (Ryan Ofsky) Pull request description: This change moves binaries that are not typically invoked directly by users from the `bin/` directory to the `libexec/` directory in CMake installs and binary releases. The goal of the PR is to introduce a distinction between internal and external binaries so starting with #31802, we can use IPC to implement features in new binaries without adding those binaries to the CLI. The change also helps reduce clutter in `bin/`, making it easier for users to identify useful tools to run. Summary of changes: - For **source builds** (i.e. developer builds) — There are no changes. - For **source installs** (i.e. `cmake --install` result) — `test_bitcoin`, `test_bitcoin-qt`, and `bench_bitcoin` are installed in `${CMAKE_PREFIX_PATH}/libexec` instead of `${CMAKE_PREFIX_PATH}/bin`, so they are no longer on the system `PATH`. However, they can still be invoked from the `libexec/` directory, or from the CLI as `bitcoin test`, `bitcoin test-gui`, and `bitcoin bench`, respectively. - For **binary releases** — Since `test_bitcoin` is the only test binary enabled in releases, the only change is moving `test_bitcoin` from `bin/` to `libexec/`. <details><summary>Details</summary> <p> The table below shows the install location of each binary after this change, and the availability of each binary. | Binary | Location | Availability | Change | |----------------------|--------------|----------------------|-------------------------------| | `bitcoin` | `bin/` | 📦 Binary release (since #31375) | Unchanged | | `bitcoin-cli` | `bin/` | 📦 Binary release | Unchanged | | `bitcoind` | `bin/` | 📦 Binary release | Unchanged | | `bitcoin-qt` | `bin/` | 📦 Binary release | Unchanged | | `bitcoin-tx` | `bin/` | 📦 Binary release | Unchanged | | `bitcoin-util` | `bin/` | 📦 Binary release | Unchanged | | `bitcoin-wallet` | `bin/` | 📦 Binary release | Unchanged | | `bench_bitcoin` | `libexec/` | 🛠 Source build only | Moved from `bin/` | | `bitcoin-chainstate` | `libexec/` | 🛠 Source build only | Newly installed (was built) | | `bitcoin-gui` | `libexec/` | 🛠 Source build only (until #31802) | Moved from `bin/` | | `bitcoin-node` | `libexec/` | 🛠 Source build only (until #31802) | Moved from `bin/` | | `test_bitcoin` | `libexec/` | 📦 Binary release | Moved from `bin/` | | `test_bitcoin-qt` | `libexec/` | 🛠 Source build only | Moved from `bin/` | </p> </details> --- This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/issues/28722). ACKs for top commit: l0rinc: re-ACKf49840dd90Sjors: re-ACKf49840dd90achow101: ACKf49840dd90janb84: re ACKf49840dd90BrandonOdiwuor: Tested ACKf49840dd90hodlinator: re-ACKf49840dd90willcl-ark: utACKf49840dd90Tree-SHA512: 858a2e1a53db11ee3c5c759bfdeea566f242b9ce5e8a898fa435222e41662b8184577c0dc2c4c058294b4de41d8cb3ba3e5d24c748c280efa4a3f84e3ec4344d
This commit is contained in:
@@ -322,7 +322,7 @@ if(ENABLE_IPC AND BUILD_DAEMON)
|
||||
bitcoin_ipc
|
||||
$<TARGET_NAME_IF_EXISTS:bitcoin_wallet>
|
||||
)
|
||||
install_binary_component(bitcoin-node)
|
||||
install_binary_component(bitcoin-node INTERNAL)
|
||||
endif()
|
||||
|
||||
if(ENABLE_IPC AND BUILD_TESTS)
|
||||
@@ -424,6 +424,7 @@ if(BUILD_UTIL_CHAINSTATE)
|
||||
core_interface
|
||||
bitcoinkernel
|
||||
)
|
||||
install_binary_component(bitcoin-chainstate INTERNAL)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
@@ -85,4 +85,4 @@ add_test(NAME bench_sanity_check
|
||||
COMMAND bench_bitcoin -sanity-check
|
||||
)
|
||||
|
||||
install_binary_component(bench_bitcoin)
|
||||
install_binary_component(bench_bitcoin INTERNAL)
|
||||
|
||||
@@ -23,7 +23,7 @@ Options:
|
||||
-m, --multiprocess Run multiprocess binaries bitcoin-node, bitcoin-gui.
|
||||
-M, --monolithic Run monolithic binaries bitcoind, bitcoin-qt. (Default behavior)
|
||||
-v, --version Show version information
|
||||
-h, --help Show this help message
|
||||
-h, --help Show full help message
|
||||
|
||||
Commands:
|
||||
gui [ARGS] Start GUI, equivalent to running 'bitcoin-qt [ARGS]' or 'bitcoin-gui [ARGS]'.
|
||||
@@ -31,10 +31,10 @@ Commands:
|
||||
rpc [ARGS] Call RPC method, equivalent to running 'bitcoin-cli -named [ARGS]'.
|
||||
wallet [ARGS] Call wallet command, equivalent to running 'bitcoin-wallet [ARGS]'.
|
||||
tx [ARGS] Manipulate hex-encoded transactions, equivalent to running 'bitcoin-tx [ARGS]'.
|
||||
help [-a] Show this help message. Include -a or --all to show additional commands.
|
||||
help Show full help message.
|
||||
)";
|
||||
|
||||
static constexpr auto HELP_EXTRA = R"(
|
||||
static constexpr auto HELP_FULL = R"(
|
||||
Additional less commonly used commands:
|
||||
bench [ARGS] Run bench command, equivalent to running 'bench_bitcoin [ARGS]'.
|
||||
chainstate [ARGS] Run bitcoin kernel chainstate util, equivalent to running 'bitcoin-chainstate [ARGS]'.
|
||||
@@ -42,11 +42,14 @@ Additional less commonly used commands:
|
||||
test-gui [ARGS] Run GUI unit tests, equivalent to running 'test_bitcoin-qt [ARGS]'.
|
||||
)";
|
||||
|
||||
static constexpr auto HELP_SHORT = R"(
|
||||
Run '%s help' to see additional commands (e.g. for testing and debugging).
|
||||
)";
|
||||
|
||||
struct CommandLine {
|
||||
bool use_multiprocess{false};
|
||||
bool show_version{false};
|
||||
bool show_help{false};
|
||||
bool show_help_all{false};
|
||||
std::string_view command;
|
||||
std::vector<const char*> args;
|
||||
};
|
||||
@@ -63,11 +66,17 @@ int main(int argc, char* argv[])
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
std::string exe_name{fs::PathToString(fs::PathFromString(argv[0]).filename())};
|
||||
std::vector<const char*> args;
|
||||
if (cmd.show_help || cmd.command.empty()) {
|
||||
tfm::format(std::cout, HELP_USAGE, argv[0]);
|
||||
if (cmd.show_help_all) tfm::format(std::cout, HELP_EXTRA);
|
||||
return cmd.show_help ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
tfm::format(std::cout, HELP_USAGE, exe_name);
|
||||
if (cmd.show_help) {
|
||||
tfm::format(std::cout, HELP_FULL);
|
||||
return EXIT_SUCCESS;
|
||||
} else {
|
||||
tfm::format(std::cout, HELP_SHORT, exe_name);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
} else if (cmd.command == "gui") {
|
||||
args.emplace_back(cmd.use_multiprocess ? "bitcoin-gui" : "bitcoin-qt");
|
||||
} else if (cmd.command == "node") {
|
||||
@@ -125,8 +134,6 @@ CommandLine ParseCommandLine(int argc, char* argv[])
|
||||
cmd.show_version = true;
|
||||
} else if (arg == "-h" || arg == "--help" || arg == "help") {
|
||||
cmd.show_help = true;
|
||||
} else if (cmd.show_help && (arg == "-a" || arg == "--all")) {
|
||||
cmd.show_help_all = true;
|
||||
} else if (arg.starts_with("-")) {
|
||||
throw std::runtime_error(strprintf("Unknown option: %s", arg));
|
||||
} else if (!arg.empty()) {
|
||||
|
||||
@@ -279,7 +279,7 @@ if(ENABLE_IPC)
|
||||
bitcoin_ipc
|
||||
)
|
||||
import_plugins(bitcoin-gui)
|
||||
install_binary_component(bitcoin-gui)
|
||||
install_binary_component(bitcoin-gui INTERNAL)
|
||||
if(WIN32)
|
||||
set_target_properties(bitcoin-gui PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||
endif()
|
||||
|
||||
@@ -45,4 +45,4 @@ if(WIN32 AND VCPKG_TARGET_TRIPLET)
|
||||
)
|
||||
endif()
|
||||
|
||||
install_binary_component(test_bitcoin-qt)
|
||||
install_binary_component(test_bitcoin-qt INTERNAL)
|
||||
|
||||
@@ -214,4 +214,4 @@ endfunction()
|
||||
|
||||
add_all_test_targets()
|
||||
|
||||
install_binary_component(test_bitcoin)
|
||||
install_binary_component(test_bitcoin INTERNAL)
|
||||
|
||||
Reference in New Issue
Block a user