Inside Bitcoin
Opening the selected file…
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.
1This is a system of building and caching dependencies necessary for building Bitcoin.2There are several features that make it different from most similar systems:4### It is designed to be builder and host agnostic6In theory, binaries for any target OS/architecture can be created, from a7builder running any OS/architecture. In practice, build-side tools must be8specified when the defaults don't fit, and packages must be amended to work9on new hosts.11### No reliance on timestamps13File presence is used to determine what needs to be built. This makes the14results distributable and easily digestible by automated builders.16### Each build only has its specified dependencies available at build-time.18For each build, the sysroot is wiped and the (recursive) dependencies are19installed. This makes each build deterministic, since there will never be any20unknown files available to cause side-effects.22### Each package is cached and only rebuilt as needed.24Before building, a unique build-id is generated for each package. This id25consists of a hash of all files used to build the package (Makefiles, packages,26etc), and as well as a hash of the same data for each recursive dependency. If27any portion of a package's build recipe changes, it will be rebuilt as well as28any other package that depends on it. If any of the main makefiles (Makefile,29funcs.mk, etc) are changed, all packages will be rebuilt. After building, the30results are cached into a tarball that can be reused and distributed.32### Package build results are (relatively) deterministic.34Each package is configured and patched so that it will yield the same35build-results with each consequent build, within a reasonable set of36constraints. Some things like timestamp insertion are unavoidable, and are37beyond the scope of this system. Additionally, the toolchain itself must be38capable of deterministic results. When revisions are properly bumped, a cached39build should represent an exact single payload.41### Sources are fetched and verified automatically43Each package must define its source location and checksum. The build will fail44if the fetched source does not match. Sources may be pre-seeded and/or cached45as desired.47### Self-cleaning49Build and staging dirs are wiped after use, and any previous version of a50cached result is removed following a successful build. Automated builders51should be able to build each revision and store the results with no further52intervention.
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.