Repository navigation
Version 2.0.3
[Summary]
BuildMaster is a small CMake DSL for a graph of other people’s builds.
You declare each dependency once — how it is produced, what it waits on — and the parent gets one shared prefix instead of a pile of ExternalProject / FetchContent glue.
CMake and Meson trees are first-class.
Typical use: add the submodule, add_subdirectory, declare components, then depend / link.
Declaration order does not matter.
The public surface is ten commands on purpose; everything else is internal.
If you landed here from a release link and have not read the tree:
- How to write a component, every optstr key, and the contract: README.md
- The ten names, and nothing else: public_functions.md
- Porting an older caller: MIGRATE.md
Changed
- Minimum CMake raised from 3.20 to 3.21. Atomic downloads rely on
file(RENAME … RESULT)to report a failed move; configuring with an older CMake now stops with a clear error. BUILDMASTER_DATADIRreplacesBUILDMASTER_DOWNLOADSDIRas the external setting. It names the directory for BuildMaster's own data (downloads, caches, …) and is read from-DBUILDMASTER_DATADIR=…first, then theBUILDMASTER_DATADIRenvironment variable, defaulting to BuildMaster's build directory. A relative path is taken from the top-level build directory; the directory is created if missing, and configure stops with a FATAL if it cannot be created or written. Downloads now live in<BUILDMASTER_DATADIR>/downloads(created if missing), which with the default is the same path as before. TheBUILDMASTER_DOWNLOADSDIRenvironment variable is no longer read. Nested BuildMaster configures inherit the outermost value.
Fixed
- Downloads are published atomically.
FILES={…}archives were written straight into the downloads directory, so an interrupted or failed transfer could leave a truncated file that a later run (withoutEXPECTED_HASH) took as a cache hit, and two builds sharing the directory could write the same archive at once. Transfers now go to<BUILDMASTER_DATADIR>/tmp/<name>.partunder a per-archive lock (<name>.lock) and are renamed intodownloads/only after they complete and pass the hash check. The cache check runs under the same lock, so a build waiting on another one's download reuses it. - Changing a component's mode or ABI on an existing build dir now reconfigures it. The stage stamp missed, but the nested configure only ran when the build tree was absent, so a component switched from
statictoshared(or built with different flags) kept its previous configure. Each nested tree now records the non-tree key it was configured with (bm-stamp.configured); a mismatch discards the nested CMake cache / Meson setup and configures again. The key now also covers the ABI inputs: C++ compiler, C/C++ flags (including per-build-type), linker flags, linker, MSVC runtime, C/C++ standard, sysroot and macOS architectures/deployment target. Build trees from earlier versions reconfigure once. buildmaster_link(<host>, <ALIAS>)lost the library when the dest was reused fromlinks/<id>.cmake. A component skipped as "already built by" another process got its ALIAS targets from the links file, but not BuildMaster's alias table, so the edge was stored against the alias and flatten looked forlinks/<alias>.cmake: no-L, no-l<stem>/<stem>.lib. Linux accepted the shared library with undefined symbols; macOS (two-level namespace) and Windows failed the link. The reused file's aliases are now registered for that id (read withfile(READ), so a file written by another BuildMaster version works too); an alias that already maps to another id is FATAL. Alias resolution also follows a CMake ALIAS whose target is an IMPORTED links stub. The edge, the host link line andlinks/<host>.cmakenow carry the raw id. Fixturelinks-reuse-alias: a nested SHARED host linked with--no-undefined/-undefined,errorto the alias of a reused id; negativealias-reuse-conflict.