Skip to content

Version 2.0.2

Choose a tag to compare

@StormBytePP StormBytePP released this 29 Sep 20:16
· 44 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:

Added

  • Static link sidecar. write_one always emits links/<id>_static.txt (set(_BM_STATIC_LINK …)). MODE=static fills it with LINK= tokens and buildmaster_link dest ids; shared / headers / executable write an empty list. Flatten reads the sidecar if it exists: dest ids with a links/<dest>.cmake are walked (-L + produced names); raw tokens (m, -framework CoreFoundation) go onto the host as-is. A shared .so still absorbs PRIVATE deps; consumers of that DSO see an empty sidecar and do not inherit pq / SDK libs. Effective nested reconfigure (stamp miss and a real cmake -S) deletes links/<id>.cmake and links/<id>_static.txt before rewrite; stamp / reuse skip leaves them. Fixture links-static-closure: static sl-db PRIVATE-links sl-pq, the parent exe links only sl-db, both archives appear on the line.
  • In-process CMake host backend (BACKEND=host). buildmaster_component accepts a source-file list and immediately creates a real STATIC or SHARED target for ordinary CMake properties and options. BuildMaster graph links are applied after all components materialize; LINK= is PUBLIC for static targets and PRIVATE for shared ones, so system libraries and component dependencies can reach final consumers without using REPACK as a workaround. REPACK remains for intentionally merging NOINSTALL static members. Fixture host-crypto-chain covers the host target and deferred dependency chain.

Fixed

  • A reconfigure no longer skips the ids its own build dir published. When ninja re-ran CMake inside a nested project (a CONFIGURE_DEPENDS glob mismatch, or a links/*.cmake rewritten by the parent), buildmaster_component treated the leftover links/<id>.cmake of every dependency that same project had configured as "already built by" another process. Their <id>_build / <id>_install stages vanished from the nested graph and a BACKEND=host library compiled before its dependencies were installed (missing headers). A top-level cmake <builddir> hit the same skip. Each build dir now records the ids it published in bm-owned-links.txt, and a reconfigure configures those again. Fixture host-nested-reconfigure drives configure → build → build → forced nested reconfigure → top-level reconfigure.
  • A parent no longer rewrites the links file its nested project wrote for the same id. When a cmake component's nested BuildMaster project declares that same id (for example with BACKEND=host), both processes wrote links/<id>.cmake with different content. The parent rewrite made the nested build.ninja stale, and the next build re-ran CMake in the nested project and then in the parent. Links files now record their writer's binary dir (_BM_LINKS_WRITER); the parent keeps a file written from the component's own build dir unless it adds dests.
  • List values in the toolchain dump stay on one line. _bm_tc_export / _bm_tc_export_raw stored each line in a CMake list property, so a value containing ; (for example BUILDMASTER_KNOWN_TOOLCHAINS) was split into one line per item. Nested configures then cached a multi-line value and warned Value of BUILDMASTER_KNOWN_TOOLCHAINS contained a newline; truncating. Semicolons are now escaped in the property and the dump writes set(X "a;b").