Skip to content

Version 2.0.3

Choose a tag to compare

@StormBytePP StormBytePP released this 01 Oct 22:06
· 34 commits to master since this release

[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:

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_DATADIR replaces BUILDMASTER_DOWNLOADSDIR as the external setting. It names the directory for BuildMaster's own data (downloads, caches, …) and is read from -DBUILDMASTER_DATADIR=… first, then the BUILDMASTER_DATADIR environment 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. The BUILDMASTER_DOWNLOADSDIR environment 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 (without EXPECTED_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>.part under a per-archive lock (<name>.lock) and are renamed into downloads/ 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 static to shared (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 from links/<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 for links/<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 with file(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 and links/<host>.cmake now carry the raw id. Fixture links-reuse-alias: a nested SHARED host linked with --no-undefined / -undefined,error to the alias of a reused id; negative alias-reuse-conflict.