Skip to content

Instantly share code, notes, and snippets.

Aug 13 06:00:29 nero guix-bitcoin-build-start[2761424]: The following derivations will be built:
Aug 13 06:00:29 nero guix-bitcoin-build-start[2761424]: /gnu/store/bv1n6q6sga53q82cz038q2lwl3zj8iqi-python-elfesteem-0.1-1.2eb1e53.drv
Aug 13 06:00:29 nero guix-bitcoin-build-start[2761424]: /gnu/store/8c1slsmxbi21jhwyvkrxlmb1gl844lj6-python-oscryptotests-1.3.0.drv
Aug 13 06:00:29 nero guix-bitcoin-build-start[2761424]: /gnu/store/i4yhd2bx311kgjm43ykfyskz4ffnf91y-python-certvalidator-0.1-1.a145bf2.drv
Aug 13 06:00:29 nero guix-bitcoin-build-start[2761424]: /gnu/store/6v557805mhjsnl542f0h96z8rrar5lw6-python-signapple-0.2.0-1.3fab3bb.drv
Aug 13 06:00:29 nero guix-bitcoin-build-start[2761424]: 0.0 MB will be downloaded
Aug 13 06:00:29 nero guix-bitcoin-build-start[2761336]: [1.1K blob data]
Aug 13 06:00:29 nero guix-bitcoin-build-start[2761336]: The following derivations will be built:
Aug 13 06:00:29 nero guix-bitcoin-build-start[2761336]: /gnu/store/g532q7if0qnpri8inqs1v346fkj0i9wp-gcc-cross-sans-libc-aar
Aug 13 14:18:56 nero guix-manifest-worker-start[2781608]: Building 20260813T141846Z-2781467-17041: manifest_build.scm for x86_64-linux-gnu on x86_64-linux
Aug 13 14:18:57 nero guix-manifest-worker-start[2781608]: Building 20260813T141846Z-2781467-17041: manifest_codesign.scm for x86_64-linux-gnu on x86_64-linux
Aug 13 14:18:57 nero guix-manifest-worker-start[2781608]: Building 20260813T141846Z-2781467-17041: manifest_gui.scm for x86_64-linux-gnu on x86_64-linux
Aug 13 14:18:59 nero guix-manifest-worker-start[2781608]: Building 20260813T141846Z-2781467-17041: manifest_build.scm for arm-linux-gnueabihf on x86_64-linux
Aug 13 14:19:00 nero guix-manifest-worker-start[2781608]: Building 20260813T141846Z-2781467-17041: manifest_codesign.scm for arm-linux-gnueabihf on x86_64-linux
Aug 13 14:19:00 nero guix-manifest-worker-start[2781608]: Building 20260813T141846Z-2781467-17041: manifest_gui.scm for arm-linux-gnueabihf on x86_64-linux
Aug 13 14:19:02 nero guix-manifest-worker-start[2781608]: Building 20260813T141846Z
Cross compiling ....................... FALSE
C++ compiler .......................... GNU 15.2.0, /nix/store/56g5vnv6ni9fqcpiqlv4zirvx1nhi1ha-ccache-links-wrapper-4.13.6/bin/g++
CMAKE_BUILD_TYPE ...................... RelWithDebInfo
Preprocessor defined macros ...........
C++ compiler flags .................... -O2 -g -std=c++20 -fPIC -fno-extended-identifiers -fmacro-prefix-map=/home/will/src/core/bitcoin/worktrees/pr-35569/src=. -fstack-reuse=none -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wformat -Wformat-security -Wvla -Wredundant-decls -Wdate-time -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wbidi-chars=any -Wundef -Wleading-whitespace=spaces -Wtrailing-whitespace=any -Wno-unused-parameter
Linker flags .......................... -O2 -g -fstack-reuse=none -fstack-protector-all -fcf-protection=full -fstack-clash-protection

Current detection is strong for translation-unit-local mistakes, but it is not whole-program unused-code detection. The two PRs expose different gaps, so no single extra compiler flag will solve both.

Mechanism Currently catches Main gaps
Compiler warnings + -Werror Scalars, internal functions, some private members, unreachable code Non-trivial value objects; public/external/virtual methods; unused parameters intentionally disabled
clang-tidy Unused using declarations, selected ignored return values No configured non-trivial-local or cross-TU dead-declaration check
IWYU Unnecessary includes in an enforced subset Not functions/types; much of wallet, tests, fuzz, Qt, and IPC is non-enforcing
Ruff/ShellCheck Python imports/locals and shell variables Python functions/classes; C++ declarations
LTO/dead stripping Removes unreachable emitted code in selected builds Does not fail CI, misses source-only code, and vtables can retain unused virtual methods
#!/usr/bin/env bash
set -euo pipefail
host=x86_64-linux-gnu
build=guix-build-313ed191e9d4
profile=$(readlink -f "$build/var/profiles/$host")
cxx="$profile/bin/$host-g++"
printf 'HOST %s\n' "$(uname -m)"
printf 'PROFILE %s\n' "$profile"
src/core/bitcoin on  HEAD (1e169a8) [$] via △ v4.1.2 via 🐍 v3.13.13 via ❄️ impure (nix-shell-env)
❯ bash -lc 'set -e
hosts="x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu powerpc64-linux-gnu x86_64-w64-mingw32 x86_64-apple-darwin arm64-apple-darwin"
for h in $hosts; do
printf "===== %s =====\n" "$h"
env HOST="$h" guix time-machine --url=https://codeberg.org/guix/guix.git --commit=c5eee3336cc1d10a3cc1c97fde2809c3451624d3 --url=https://github.com/Millak/guix.git -- weather --substitute-urls=https://guix.fish.foo --display-missing -m contrib/guix/manifest_build.scm || true
done'
===== x86_64-linux-gnu =====
hint: Consider installing the `glibc-locales' package and defining `GUIX_LOCPATH', along these lines:

IBD Trace Summary

Warnings

  • ibd-usdt.out contains 1 non-timestamped or unrecognized lines

USDT Events

  • Duration: 320379 ms
  • Event counts: {'message_processing_finished': 300919, 'message_processing_started': 300918, 'block_receive_request_state': 300002, 'block_validation_enqueue': 300002, 'block_validation_dequeued': 300002, 'block_process_started': 300002, 'block_validation_started': 300002, 'block_validation_finished': 300002, 'block_process_stage': 2100014, 'block_received': 300002, 'block_connected_started': 300002, 'block_connected_finished': 300002, 'block_process_finished': 300002, 'block_validation_worker_finished': 300002, 'chainstate_flush_started': 2, 'chainstate_flush_finished': 2}
#!/usr/bin/env bash
# Copyright (c) 2026-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
set -euo pipefail
BITCOIND="./build/bin/bitcoind"
OUTDIR="ibd-trace-$(date -u +%Y%m%dT%H%M%SZ)"
DURATION=""
core/worktrees/split_build_expr on  split_build_expr [$] via △ v4.1.2 via 🐍 v3.13.12 via ❄️ impure (nix-shell-env)
❯ find guix-build-6b3ef06b7042 \( \
-path '*/installed/bitcoin-*/bin/*' -o \
-path '*/installed/bitcoin-*/libexec/*' \
\) -type f \
| sort \
| xargs file
guix-build-6b3ef06b7042/distsrc-6b3ef06b7042-arm-linux-gnueabihf/installed/bitcoin-6b3ef06b7042/bin/bitcoin: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, stripped
guix-build-6b3ef06b7042/distsrc-6b3ef06b7042-arm-linux-gnueabihf/installed/bitcoin-6b3ef06b7042/bin/bitcoin-cli: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, stripped
guix-build-6b3ef06b7042/distsrc-6b3ef06b7042-arm-linux-gnueabihf/installed/bitcoin-6b3ef06b7042/bin/bitcoin-cli.dbg: ELF 32-bit LSB shared objec
cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME)
set(CTEST_BUILD_FLAGS -j${nproc})
set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${nproc})
if(NOT CTEST_SITE)
set(CTEST_SITE ${HOST_NAME})
endif()
if(NOT CTEST_BUILD_NAME)
set(CTEST_BUILD_NAME "your-build-name")