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.
252# Display proper warning when the user interrupts the build253trap 'int_trap ${host}' INT255(256# Required for 'contrib/guix/manifest.scm' to output the right manifest257# for the particular $HOST we're building for258export HOST="$host"260cat << EOF261INFO: Codesigning ${VERSION:?not set} for platform triple ${HOST:?not set}:262...using reference timestamp: ${SOURCE_DATE_EPOCH:?not set}263...from worktree directory: '${PWD}'264...bind-mounted in container to: '/bitcoin'265...in build directory: '$(distsrc_for_host "$HOST" codesigned)'266...bind-mounted in container to: '$(distsrc_for_host "$HOST" codesigned /distsrc-base)'267...outputting in: '$(outdir_for_host "$HOST" codesigned)'268...bind-mounted in container to: '$(outdir_for_host "$HOST" codesigned /outdir-base)'269...using detached signatures in: '${DETACHED_SIGS_REPO:?not set}'270...bind-mounted in container to: '/detached-sigs'271EOF274# Run the build script 'contrib/guix/libexec/codesign.sh' in the build275# container specified by 'contrib/guix/manifest.scm'.276#277# Explanation of `guix shell` flags:278#279# --container run command within an isolated container280#281# Running in an isolated container minimizes build-time differences282# between machines and improves reproducibility283#284# --writable-root make the root filesystem writable285#286# --pure unset existing environment variables287#288# Same rationale as --container289#290# --no-cwd do not share current working directory with an291# isolated container292#293# When --container is specified, the default behavior is to share294# the current working directory with the isolated container at the295# same exact path (e.g. mapping '/home/satoshi/bitcoin/' to296# '/home/satoshi/bitcoin/'). This means that the $PWD inside the297# container becomes a source of irreproducibility. --no-cwd disables298# this behaviour.299#300# --share=SPEC for containers, share writable host file system301# according to SPEC302#303# --share="$PWD"=/bitcoin304#305# maps our current working directory to /bitcoin306# inside the isolated container, which we later cd307# into.308#309# While we don't want to map our current working directory to the310# same exact path (as this introduces irreproducibility), we do want311# it to be at a _fixed_ path _somewhere_ inside the isolated312# container so that we have something to build. '/bitcoin' was313# chosen arbitrarily.314#315# ${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"}316#317# fetch substitute from SUBSTITUTE_URLS if they are318# authorized319#320# Depending on the user's security model, it may be desirable to use321# substitutes (pre-built packages) from servers that the user trusts.322# Please read the README.md in the same directory as this file for323# more information.324#325# shellcheck disable=SC2086326time-machine shell --manifest="${PWD}/contrib/guix/manifest_codesign.scm" \327--container \328--writable-root \329--pure \330--no-cwd \331--share="$PWD"=/bitcoin \332--share="$DISTSRC_BASE"=/distsrc-base \333--share="$OUTDIR_BASE"=/outdir-base \334--share="$DETACHED_SIGS_REPO"=/detached-sigs \335--expose="$(git rev-parse --git-common-dir)" \336--expose="$(git -C "$DETACHED_SIGS_REPO" rev-parse --git-common-dir)" \337--cores="$JOBS" \338--keep-failed \339--fallback \340--link-profile \341--root="$(profiledir_for_host "${HOST}" codesigned)" \342${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \343${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \344-- env HOST="$host" \345DISTNAME="$DISTNAME" \346JOBS="$JOBS" \347SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:?unable to determine value}" \348${V:+V=1} \349DISTSRC="$(distsrc_for_host "$HOST" codesigned /distsrc-base)" \350OUTDIR="$(outdir_for_host "$HOST" codesigned /outdir-base)" \351DIST_ARCHIVE_BASE=/outdir-base/dist-archive \352DETACHED_SIGS_REPO=/detached-sigs \353CODESIGNING_TARBALL="$(codesigning_tarball_for_host "$HOST" /outdir-base)" \354bash -c "cd /bitcoin && bash contrib/guix/libexec/codesign.sh"355)357done
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.