Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1#!/usr/bin/env bash3export LC_ALL=C5set -o errexit -o nounset -o pipefail -o xtrace7write_env_var() {8local key="$1"9local value="$2"11if [[ -n "${GITHUB_ENV:-}" ]]; then12echo "${key}=${value}" >> "${GITHUB_ENV}"13else14export "${key}=${value}"15fi16}18write_output_var() {19local key="$1"20local value="$2"22if [[ -n "${GITHUB_OUTPUT:-}" ]]; then23echo "${key}=${value}" >> "${GITHUB_OUTPUT}"24else25echo "${key}=${value}"26fi27}29available_nproc() {30if command -v nproc >/dev/null 2>&1; then31nproc32else33sysctl -n hw.logicalcpu34fi35}37determine_parallelism() {38local multiplier="$1"39local available41available="$(available_nproc)"42write_env_var BUILD_PARALLEL "${available}"43write_env_var PARALLEL "$((available * multiplier))"44}46reset_ccache_stats() {47which ccache48ccache --version49ccache --zero-stats50}52show_ccache_stats() {53ccache --show-stats54}56install_apt_packages() {57sudo apt-get install --no-install-recommends -y "$@"58}60install_homebrew_packages() {61HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --quiet "$@"62}64install_pip_packages() {65pip3 install "$@"66}68determine_host() {69local config_guess="${1:-./depends/config.guess}"70local output_key="${2:-host}"72write_output_var "${output_key}" "$("${config_guess}")"73}75ci_helpers_main() {76local command="${1:?missing command}"77shift79[[ "${command}" =~ ^[a-z_][a-z0-9_]*$ ]] || {80echo "Invalid command: ${command}" >&281exit 182}84if declare -F "${command}" >/dev/null; then85"${command}" "$@"86else87echo "Unknown command: ${command}" >&288exit 189fi90}92if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then93ci_helpers_main "$@"94fi
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.