git / moonbite-core / depends/description.md · raw
This is a system of building and caching dependencies necessary for building Litecoin.There are several features that make it different from most similar systems:### It is designed to be builder and host agnosticIn theory, binaries for any target OS/architecture can be created, from abuilder running any OS/architecture. In practice, build-side tools must bespecified when the defaults don't fit, and packages must be amended to workon new hosts. For now, a build architecture of x86_64 is assumed, either onLinux or macOS.### No reliance on timestampsFile presence is used to determine what needs to be built. This makes theresults distributable and easily digestable by automated builders.### Each build only has its specified dependencies available at build-time.For each build, the sysroot is wiped and the (recursive) dependencies areinstalled. This makes each build deterministic, since there will never be anyunknown files available to cause side-effects.### Each package is cached and only rebuilt as needed.Before building, a unique build-id is generated for each package. This idconsists of a hash of all files used to build the package (Makefiles, packages,etc), and as well as a hash of the same data for each recursive dependency. Ifany portion of a package's build recipe changes, it will be rebuilt as well asany other package that depends on it. If any of the main makefiles (Makefile,funcs.mk, etc) are changed, all packages will be rebuilt. After building, theresults are cached into a tarball that can be re-used and distributed.### Package build results are (relatively) deterministic.Each package is configured and patched so that it will yield the samebuild-results with each consequent build, within a reasonable set ofconstraints. Some things like timestamp insertion are unavoidable, and arebeyond the scope of this system. Additionally, the toolchain itself must becapable of deterministic results. When revisions are properly bumped, a cachedbuild should represent an exact single payload.### Sources are fetched and verified automaticallyEach package must define its source location and checksum. The build will failif the fetched source does not match. Sources may be pre-seeded and/or cachedas desired.### Self-cleaningBuild and staging dirs are wiped after use, and any previous version of acached result is removed following a successful build. Automated buildersshould be able to build each revision and store the results with no furtherintervention.