Skip to content

Commit 8540232

Browse files
committed
Merge branch 'bitcoin' into auxpow
2 parents e393fb1 + d8fe258 commit 8540232

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+522
-201
lines changed

.github/actions/configure-docker/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: 'Configure Docker'
22
description: 'Set up Docker build driver and configure build cache args'
33
inputs:
4-
use-cirrus:
5-
description: 'Use cirrus cache'
4+
cache-provider:
5+
description: 'gha or cirrus cache provider'
66
required: true
7+
options:
8+
- gh
9+
- cirrus
710
runs:
811
using: 'composite'
912
steps:
@@ -32,7 +35,7 @@ runs:
3235
# which are set automatically when running on GitHub infra: https://docs.docker.com/build/cache/backends/gha/#synopsis
3336
3437
# Use cirrus cache host
35-
if [[ ${{ inputs.use-cirrus }} == 'true' ]]; then
38+
if [[ ${{ inputs.cache-provider }} == 'cirrus' ]]; then
3639
url_args="url=${CIRRUS_CACHE_HOST},url_v2=${CIRRUS_CACHE_HOST}"
3740
else
3841
url_args=""

.github/workflows/ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ jobs:
3333
name: 'determine runners'
3434
runs-on: ubuntu-latest
3535
outputs:
36-
use-cirrus-runners: ${{ steps.runners.outputs.use-cirrus-runners }}
36+
provider: ${{ steps.runners.outputs.provider }}
3737
steps:
3838
- id: runners
3939
run: |
4040
if [[ "${REPO_USE_CIRRUS_RUNNERS}" == "${{ github.repository }}" ]]; then
41-
echo "use-cirrus-runners=true" >> "$GITHUB_OUTPUT"
41+
echo "provider=cirrus" >> "$GITHUB_OUTPUT"
4242
echo "::notice title=Runner Selection::Using Cirrus Runners"
4343
else
44-
echo "use-cirrus-runners=false" >> "$GITHUB_OUTPUT"
44+
echo "provider=gha" >> "$GITHUB_OUTPUT"
4545
echo "::notice title=Runner Selection::Using GitHub-hosted runners"
4646
fi
4747
@@ -312,7 +312,7 @@ jobs:
312312
windows-cross:
313313
name: 'Linux->Windows cross, no tests'
314314
needs: runners
315-
runs-on: ${{ needs.runners.outputs.use-cirrus-runners == 'true' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm' || 'ubuntu-24.04' }}
315+
runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm' || 'ubuntu-24.04' }}
316316
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
317317

318318
env:
@@ -332,7 +332,7 @@ jobs:
332332
- name: Configure Docker
333333
uses: ./.github/actions/configure-docker
334334
with:
335-
use-cirrus: ${{ needs.runners.outputs.use-cirrus-runners }}
335+
cache-provider: ${{ needs.runners.outputs.provider }}
336336

337337
- name: CI script
338338
run: ./ci/test_run_all.sh
@@ -422,7 +422,7 @@ jobs:
422422
ci-matrix:
423423
name: ${{ matrix.name }}
424424
needs: runners
425-
runs-on: ${{ needs.runners.outputs.use-cirrus-runners == 'true' && matrix.cirrus-runner || matrix.fallback-runner }}
425+
runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && matrix.cirrus-runner || matrix.fallback-runner }}
426426
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
427427
timeout-minutes: ${{ matrix.timeout-minutes }}
428428

@@ -439,6 +439,7 @@ jobs:
439439
fallback-runner: 'ubuntu-24.04-arm'
440440
timeout-minutes: 120
441441
file-env: './ci/test/00_setup_env_arm.sh'
442+
provider: 'gha'
442443

443444
- name: 'ASan + LSan + UBSan + integer, no depends, USDT'
444445
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
@@ -513,7 +514,7 @@ jobs:
513514
- name: Configure Docker
514515
uses: ./.github/actions/configure-docker
515516
with:
516-
use-cirrus: ${{ needs.runners.outputs.use-cirrus-runners }}
517+
cache-provider: ${{ matrix.provider || needs.runners.outputs.provider }}
517518

518519
- name: Enable bpfcc script
519520
if: ${{ env.CONTAINER_NAME == 'ci_native_asan' }}
@@ -550,7 +551,7 @@ jobs:
550551
- name: Configure Docker
551552
uses: ./.github/actions/configure-docker
552553
with:
553-
use-cirrus: ${{ needs.runners.outputs.use-cirrus-runners }}
554+
cache-provider: ${{ needs.runners.outputs.provider }}
554555

555556
- name: CI script
556557
run: |

ci/test/00_setup_env_native_fuzz_with_msan.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77
export LC_ALL=C.UTF-8
88

99
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
10+
export APT_LLVM_V="21"
1011
LIBCXX_DIR="/cxx_build/"
1112
export MSAN_FLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls"
12-
LIBCXX_FLAGS="-nostdinc++ -nostdlib++ -isystem ${LIBCXX_DIR}include/c++/v1 -L${LIBCXX_DIR}lib -Wl,-rpath,${LIBCXX_DIR}lib -lc++ -lc++abi -lpthread -Wno-unused-command-line-argument"
13+
# -lstdc++ to resolve link issues due to upstream packaging
14+
LIBCXX_FLAGS="-nostdinc++ -nostdlib++ -isystem ${LIBCXX_DIR}include/c++/v1 -L${LIBCXX_DIR}lib -Wl,-rpath,${LIBCXX_DIR}lib -lc++ -lc++abi -lpthread -Wno-unused-command-line-argument -lstdc++"
1315
export MSAN_AND_LIBCXX_FLAGS="${MSAN_FLAGS} ${LIBCXX_FLAGS}"
1416

1517
export CONTAINER_NAME="ci_native_fuzz_msan"
18+
export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} llvm-${APT_LLVM_V}-dev libclang-${APT_LLVM_V}-dev libclang-rt-${APT_LLVM_V}-dev"
1619
export DEP_OPTS="DEBUG=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
1720
export GOAL="all"
1821
# Setting CMAKE_{C,CXX}_FLAGS_DEBUG flags to an empty string ensures that the flags set in MSAN_FLAGS remain unaltered.

ci/test/01_base_install.sh

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,6 @@ fi
5858
if [[ -n "${USE_INSTRUMENTED_LIBCPP}" ]]; then
5959
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-21.1.1" /llvm-project
6060

61-
if [ -n "${APT_LLVM_V}" ]; then
62-
63-
cmake -G Ninja -B /clang_build/ \
64-
-DLLVM_ENABLE_PROJECTS="clang" \
65-
-DCMAKE_BUILD_TYPE=Release \
66-
-DLLVM_TARGETS_TO_BUILD=Native \
67-
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
68-
-S /llvm-project/llvm
69-
70-
ninja -C /clang_build/ "$MAKEJOBS"
71-
ninja -C /clang_build/ install-runtimes
72-
73-
update-alternatives --install /usr/bin/clang++ clang++ /clang_build/bin/clang++ 100
74-
update-alternatives --install /usr/bin/clang clang /clang_build/bin/clang 100
75-
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /clang_build/bin/llvm-symbolizer 100
76-
fi
77-
7861
cmake -G Ninja -B /cxx_build/ \
7962
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
8063
-DCMAKE_BUILD_TYPE=Release \

cmake/module/Maintenance.cmake

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,24 +96,24 @@ function(add_macos_deploy_target)
9696
VERBATIM
9797
)
9898

99-
string(REPLACE " " "-" osx_volname ${CLIENT_NAME})
99+
set(macos_zip "bitcoin-macos-app")
100100
if(CMAKE_HOST_APPLE)
101101
add_custom_command(
102-
OUTPUT ${PROJECT_BINARY_DIR}/${osx_volname}.zip
103-
COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} ${osx_volname} -translations-dir=${QT_TRANSLATIONS_DIR} -zip
102+
OUTPUT ${PROJECT_BINARY_DIR}/${macos_zip}.zip
103+
COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} -translations-dir=${QT_TRANSLATIONS_DIR} -zip=${macos_zip}
104104
DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt
105105
VERBATIM
106106
)
107107
add_custom_target(deploydir
108-
DEPENDS ${PROJECT_BINARY_DIR}/${osx_volname}.zip
108+
DEPENDS ${PROJECT_BINARY_DIR}/${macos_zip}.zip
109109
)
110110
add_custom_target(deploy
111-
DEPENDS ${PROJECT_BINARY_DIR}/${osx_volname}.zip
111+
DEPENDS ${PROJECT_BINARY_DIR}/${macos_zip}.zip
112112
)
113113
else()
114114
add_custom_command(
115115
OUTPUT ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt
116-
COMMAND ${CMAKE_COMMAND} -E env OBJDUMP=${CMAKE_OBJDUMP} $<TARGET_FILE:Python3::Interpreter> ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} ${osx_volname} -translations-dir=${QT_TRANSLATIONS_DIR}
116+
COMMAND ${CMAKE_COMMAND} -E env OBJDUMP=${CMAKE_OBJDUMP} $<TARGET_FILE:Python3::Interpreter> ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} -translations-dir=${QT_TRANSLATIONS_DIR}
117117
DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt
118118
VERBATIM
119119
)
@@ -128,13 +128,13 @@ function(add_macos_deploy_target)
128128
)
129129
else()
130130
add_custom_command(
131-
OUTPUT ${PROJECT_BINARY_DIR}/dist/${osx_volname}.zip
131+
OUTPUT ${PROJECT_BINARY_DIR}/dist/${macos_zip}.zip
132132
WORKING_DIRECTORY dist
133-
COMMAND ${PROJECT_SOURCE_DIR}/cmake/script/macos_zip.sh ${ZIP_EXECUTABLE} ${osx_volname}.zip
133+
COMMAND ${PROJECT_SOURCE_DIR}/cmake/script/macos_zip.sh ${ZIP_EXECUTABLE} ${macos_zip}.zip
134134
VERBATIM
135135
)
136136
add_custom_target(deploy
137-
DEPENDS ${PROJECT_BINARY_DIR}/dist/${osx_volname}.zip
137+
DEPENDS ${PROJECT_BINARY_DIR}/dist/${macos_zip}.zip
138138
)
139139
endif()
140140
endif()

contrib/guix/libexec/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ mkdir -p "$DISTSRC"
369369
;;
370370
*darwin*)
371371
cmake --build build --target deploy ${V:+--verbose}
372-
mv build/dist/Bitcoin-Core.zip "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip"
372+
mv build/dist/bitcoin-macos-app.zip "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip"
373373
mkdir -p "unsigned-app-${HOST}"
374374
cp --target-directory="unsigned-app-${HOST}" \
375375
contrib/macdeploy/detached-sig-create.sh

contrib/macdeploy/macdeployqtplus

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,11 @@ Note, that the "dist" folder will be deleted before deploying on each run.
390390
Optionally, Qt translation files (.qm) can be added to the bundle.""")
391391

392392
ap.add_argument("app_bundle", nargs=1, metavar="app-bundle", help="application bundle to be deployed")
393-
ap.add_argument("appname", nargs=1, metavar="appname", help="name of the app being deployed")
394393
ap.add_argument("-verbose", nargs="?", const=True, help="Output additional debugging information")
395394
ap.add_argument("-no-plugins", dest="plugins", action="store_false", default=True, help="skip plugin deployment")
396395
ap.add_argument("-no-strip", dest="strip", action="store_false", default=True, help="don't run 'strip' on the binaries")
397396
ap.add_argument("-translations-dir", nargs=1, metavar="path", default=None, help="Path to Qt's translations. Base translations will automatically be added to the bundle's resources.")
398-
ap.add_argument("-zip", nargs="?", const="", metavar="zip", help="create a .zip containing the app bundle")
397+
ap.add_argument("-zip", nargs=1, metavar="zip", help="create a .zip containing the app bundle")
399398

400399
config = ap.parse_args()
401400

@@ -404,7 +403,6 @@ verbose = config.verbose
404403
# ------------------------------------------------
405404

406405
app_bundle = config.app_bundle[0]
407-
appname = config.appname[0]
408406

409407
if not os.path.exists(app_bundle):
410408
sys.stderr.write(f"Error: Could not find app bundle \"{app_bundle}\"\n")
@@ -416,10 +414,6 @@ if os.path.exists("dist"):
416414
print("+ Removing existing dist folder +")
417415
shutil.rmtree("dist")
418416

419-
if os.path.exists(appname + ".zip"):
420-
print("+ Removing existing .zip +")
421-
os.unlink(appname + ".zip")
422-
423417
# ------------------------------------------------
424418

425419
target = os.path.join("dist", "Bitcoin-Qt.app")
@@ -499,7 +493,13 @@ if platform.system() == "Darwin":
499493
# ------------------------------------------------
500494

501495
if config.zip is not None:
502-
shutil.make_archive('{}'.format(appname), format='zip', root_dir='dist', base_dir='Bitcoin-Qt.app')
496+
name = config.zip[0]
497+
498+
if os.path.exists(name + ".zip"):
499+
print("+ Removing existing .zip +")
500+
os.unlink(name + ".zip")
501+
502+
shutil.make_archive('{}'.format(name), format='zip', root_dir='dist', base_dir='Bitcoin-Qt.app')
503503

504504
# ------------------------------------------------
505505

doc/design/libraries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
| *libbitcoin_crypto* | Hardware-optimized functions for data encryption, hashing, message authentication, and key derivation. |
99
| *libbitcoin_kernel* | Consensus engine and support library used for validation by *libbitcoin_node*. |
1010
| *libbitcoinqt* | GUI functionality used by *bitcoin-qt* and *bitcoin-gui* executables. |
11-
| *libbitcoin_ipc* | IPC functionality used by *bitcoin-node*, *bitcoin-wallet*, *bitcoin-gui* executables to communicate when [`-DENABLE_IPC=ON`](multiprocess.md) is used. |
11+
| *libbitcoin_ipc* | IPC functionality used by *bitcoin-node* and *bitcoin-gui* executables to communicate when [`-DENABLE_IPC=ON`](multiprocess.md) is used. |
1212
| *libbitcoin_node* | P2P and RPC server functionality used by *bitcoind* and *bitcoin-qt* executables. |
1313
| *libbitcoin_util* | Home for common functionality shared by different executables and libraries. Similar to *libbitcoin_common*, but lower-level (see [Dependencies](#dependencies)). |
1414
| *libbitcoin_wallet* | Wallet functionality used by *bitcoind* and *bitcoin-wallet* executables. |

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ if(BUILD_BITCOIN_BIN)
295295
add_executable(bitcoin bitcoin.cpp)
296296
add_windows_resources(bitcoin bitcoin-res.rc)
297297
add_windows_application_manifest(bitcoin)
298-
target_link_libraries(bitcoin core_interface bitcoin_util)
298+
target_link_libraries(bitcoin core_interface bitcoin_common bitcoin_util)
299299
install_binary_component(bitcoin HAS_MANPAGE)
300300
endif()
301301

src/bitcoin.cpp

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <bitcoin-build-config.h> // IWYU pragma: keep
66

77
#include <clientversion.h>
8+
#include <common/args.h>
89
#include <util/fs.h>
910
#include <util/exec.h>
1011
#include <util/strencodings.h>
@@ -47,14 +48,15 @@ Run '%s help' to see additional commands (e.g. for testing and debugging).
4748
)";
4849

4950
struct CommandLine {
50-
bool use_multiprocess{false};
51+
std::optional<bool> use_multiprocess;
5152
bool show_version{false};
5253
bool show_help{false};
5354
std::string_view command;
5455
std::vector<const char*> args;
5556
};
5657

5758
CommandLine ParseCommandLine(int argc, char* argv[]);
59+
bool UseMultiprocess(const CommandLine& cmd);
5860
static void ExecCommand(const std::vector<const char*>& args, std::string_view argv0);
5961

6062
int main(int argc, char* argv[])
@@ -78,9 +80,9 @@ int main(int argc, char* argv[])
7880
return EXIT_FAILURE;
7981
}
8082
} else if (cmd.command == "gui") {
81-
args.emplace_back(cmd.use_multiprocess ? "bitcoin-gui" : "bitcoin-qt");
83+
args.emplace_back(UseMultiprocess(cmd) ? "bitcoin-gui" : "bitcoin-qt");
8284
} else if (cmd.command == "node") {
83-
args.emplace_back(cmd.use_multiprocess ? "bitcoin-node" : "bitcoind");
85+
args.emplace_back(UseMultiprocess(cmd) ? "bitcoin-node" : "bitcoind");
8486
} else if (cmd.command == "rpc") {
8587
args.emplace_back("bitcoin-cli");
8688
// Since "bitcoin rpc" is a new interface that doesn't need to be
@@ -143,6 +145,30 @@ CommandLine ParseCommandLine(int argc, char* argv[])
143145
return cmd;
144146
}
145147

148+
bool UseMultiprocess(const CommandLine& cmd)
149+
{
150+
// If -m or -M options were explicitly specified, there is no need to
151+
// further parse arguments to determine which to use.
152+
if (cmd.use_multiprocess) return *cmd.use_multiprocess;
153+
154+
ArgsManager args;
155+
args.SetDefaultFlags(ArgsManager::ALLOW_ANY);
156+
std::string error_message;
157+
auto argv{cmd.args};
158+
argv.insert(argv.begin(), nullptr);
159+
if (!args.ParseParameters(argv.size(), argv.data(), error_message)) {
160+
tfm::format(std::cerr, "Warning: failed to parse subcommand command line options: %s\n", error_message);
161+
}
162+
if (!args.ReadConfigFiles(error_message, true)) {
163+
tfm::format(std::cerr, "Warning: failed to parse subcommand config: %s\n", error_message);
164+
}
165+
args.SelectConfigNetwork(args.GetChainTypeString());
166+
167+
// If any -ipc* options are set these need to be processed by a
168+
// multiprocess-capable binary.
169+
return args.IsArgSet("-ipcbind") || args.IsArgSet("-ipcconnect") || args.IsArgSet("-ipcfd");
170+
}
171+
146172
//! Execute the specified bitcoind, bitcoin-qt or other command line in `args`
147173
//! using src, bin and libexec directory paths relative to this executable, where
148174
//! the path to this executable is specified in `wrapper_argv0`.

0 commit comments

Comments
 (0)