Repository navigation
Releases
Version 2.1.5
[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
Fixed
- Re-enabled components and restored build caches no longer mistake their own link metadata for another build's, preserving the install dependencies and selected static archives.
- Reconfiguration removes disabled host dependencies from link metadata and does not apply stale bundled metadata to caller-provided targets.
Version 2.1.4
[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
Fixed
- Source-tree stamps preserve colons in Unix filenames, directories and symbolic-link targets. Path normalization no longer treats individual paths as search-path lists, fixing PulseAudio source hashing. The harness covers colon-named paths, digest invalidation, excluded build directories and symbolic links.
- Clean builds and selectively deleted installed artifacts no longer leave CMake/Meson components on a false stamp hit. Build and install now have separate keys and artifact manifests: missing static archives, shared libraries (including versioned symlink targets), or installed headers trigger publication again without rebuilding intact nested products. Install targets validate on every build and declare their products as
BYPRODUCTS, preserving consumer ordering with both Unix Makefiles and Ninja. A build-only request cannot certify an outdated installation; unchanged builds still skip the nested tools and installation.
Version 2.1.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
Fixed
- Reconfiguring an outer host refreshes the generated toolchain instead of treating its cached bootstrap as a nested configure. Switching Debug to Release now reaches the actual nested CMake configuration, rather than only its cache. Nested hosts still reuse the outer bootstrap.
- Refreshing unchanged parent/component toolchains, Meson native files and Apple compiler wrappers preserves their timestamps, avoiding unnecessary nested regeneration when migrating legacy stamps.
- Meson defaults to
b_ndebug=if-release, matching CMake's Release assertion policy. Explicit component options still override this default. - Component stamps include the BuildMaster version so an upgrade cannot reuse artifacts configured with the previous stage/toolchain behavior.
Version 2.1.2
[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
Fixed
- Meson on Apple Clang no longer feeds a one-shot
clang file.c -o out -fltoto the linker. Xcode 26 aborts that withLLVM ERROR: Unexistent dir: …/cc-*.o, so FFmpeg's bzip2 probe failed whileb_ltowas on. The native-file compiler is a wrapper that compiles with-cand then links, and only for that one-shot. The object stays where the source was, so a following static archive is still scanned. A normal-cbuild and the final link are unchanged, so LTO stays on. - Apple Clang's one-shot
-fltowrapper now forwards-fprofile-generateand-fprofile-useto the link step as well as the compile. Those flags were classified with the other-f*options, so a Meson probe linked an instrumented static archive without the profile runtime and reported___llvm_profile_instrument_targetas a missing symbol. FFmpeg then treated libvpx as absent.
Version 2.1.1
[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
Fixed
GIT PATCHapplies once.git apply --reverse --checksees a series that is already in the worktree and skips it. A second configure of the same checkout (PGO training) no longer fails with "patch does not apply". The stamp path does the same for a single patch.
Version 2.1.0
[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
Added
BACKEND=binarypublishes a prebuilt archive into the shared prefix. The third argument ofbuildmaster_componentis anhttp://,https://orfile://URL. The filename is the cache key under<BUILDMASTER_DATADIR>/downloads; an existing file is a hit and there is no hash. The archive root is an install tree. Unpack extracts to a stage, copies every top-level entry exceptlib/andlib64/, theninclude(GNUInstallDirs)and copies whichever of those two exists into that libdir. The script setsCMAKE_SYSTEM_NAMEand the pointer size first, becausecmake -Phas neither and the module would warn. If both exist, the one already named for this machine wins, so a zip built withlib/works on alib64host and the reverse.FILES=source trees are not rewritten. Mode isstaticorshared. Each produced spec becomes an IMPORTED library on the component id. On Windows the import library follows that libdir and the.dllstays inbin/.ALIAS=points at the id.buildmaster_group_add,buildmaster_dependandbuildmaster_linkaccept the id.buildmaster_linkputs the dest on the id's INTERFACE and makes<id>_installwait on that dest, so the dest archive is downloaded and extracted first.NOINSTALL,REPACK,WHOLE,FILES=,GIT=,SOURCE=,headers,executableand meta membership are FATAL. The fourth argument is ignored. Harnessbinary-backendbuilds two shared libraries, zips those prefixes, forces the opposite libdir, links and runs an executable that needs both, and checks that installing the upper id also extracts the lower one. The nested project links the file in that libdir by name (widget.liborlibwidget.so):find_libraryon Windows does not searchlib64. Negative configures cover the FATAL flags.
Fixed
- File-tool paths were never initialized.
tools/file/init_vars.cmakewas not included, soBUILDMASTER_TOOLS_FILE_SRCDIRwas empty and a cached download looked for/templates/file_download.cmake.in.tools/file/helpers.cmakeincludes it. The same include exports the path into the toolchain. - Harness
binary-backendfindswidget_drive.exeon Windows. The driver iscmake -P, which does not setCMAKE_EXECUTABLE_SUFFIX. The consumer project writes the real executable path, and the driver runs that path. - Stamp tree hashing records symbolic links instead of following them.
_bm_stamp_walkchecksIS_SYMLINKbefore a directory or a regular file. The digest line is the relative path, the kind (symlink-file,symlink-directoryorsymlink-dangling) and the target text fromfile(READ_SYMLINK). The link is not opened and its target is not walked, so a directory link and a dangling link never reachfile(SHA256). Retargeting a file link changes the digest even when both targets have the same bytes. A regular file is stillrelpath digest, so a tree with no links does not change key. Harnessstamp-symlinkscovers file links, directory links, dangling links and a changed target. - Nested CMake installs into this machine's libdir. The nested configure received the prefix but not
CMAKE_INSTALL_LIBDIR. The child ranGNUInstallDirson its own, so on Debian it installed intolib/while BuildMaster renamed insidelib64/after the harness forced that directory. The configure now passes-DCMAKE_INSTALL_LIBDIR. Meson already passed--libdir.
Version 2.0.4
[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
Fixed
- GIT accepts patch batches expanded from CMake lists.
GIT={PATCH={${PATCHES}}}applies every list item in order, while following GIT sub-options remain separate. - Reused component skips identify their writer. When a nested configure reuses an existing links file, the status names the component that published it instead of repeating the skipped component's own title. Older links files without a recognizable writer use neutral reuse wording.
- Component
REPACKis idempotent across builds. The publisher archive is snapshotted after installation and never re-used as a merge input; component merges run from the install wrapper before its install stamp closes. Inputs, archiver/recipe and output bytes are stamped, so no-op builds skip the merge while changed members, missing outputs, and interrupted partial archives trigger a safe same-directory rebuild and atomicfile(RENAME)publication.
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.
Version 2.0.2
[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
Added
- Static link sidecar.
write_onealways emitslinks/<id>_static.txt(set(_BM_STATIC_LINK …)).MODE=staticfills it withLINK=tokens andbuildmaster_linkdest ids; shared / headers / executable write an empty list. Flatten reads the sidecar if it exists: dest ids with alinks/<dest>.cmakeare walked (-L+ produced names); raw tokens (m,-framework CoreFoundation) go onto the host as-is. A shared.sostill absorbs PRIVATE deps; consumers of that DSO see an empty sidecar and do not inheritpq/ SDK libs. Effective nested reconfigure (stamp miss and a realcmake -S) deleteslinks/<id>.cmakeandlinks/<id>_static.txtbefore rewrite; stamp / reuse skip leaves them. Fixturelinks-static-closure: staticsl-dbPRIVATE-linkssl-pq, the parent exe links onlysl-db, both archives appear on the line. - In-process CMake host backend (
BACKEND=host).buildmaster_componentaccepts a source-file list and immediately creates a realSTATICorSHAREDtarget for ordinary CMake properties and options. BuildMaster graph links are applied after all components materialize;LINK=isPUBLICfor static targets andPRIVATEfor shared ones, so system libraries and component dependencies can reach final consumers without usingREPACKas a workaround.REPACKremains for intentionally mergingNOINSTALLstatic members. Fixturehost-crypto-chaincovers 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_DEPENDSglob mismatch, or alinks/*.cmakerewritten by the parent),buildmaster_componenttreated the leftoverlinks/<id>.cmakeof every dependency that same project had configured as "already built by" another process. Their<id>_build/<id>_installstages vanished from the nested graph and aBACKEND=hostlibrary compiled before its dependencies were installed (missing headers). A top-levelcmake <builddir>hit the same skip. Each build dir now records the ids it published inbm-owned-links.txt, and a reconfigure configures those again. Fixturehost-nested-reconfiguredrives 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
cmakecomponent's nested BuildMaster project declares that same id (for example withBACKEND=host), both processes wrotelinks/<id>.cmakewith different content. The parent rewrite made the nestedbuild.ninjastale, 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_rawstored each line in a CMake list property, so a value containing;(for exampleBUILDMASTER_KNOWN_TOOLCHAINS) was split into one line per item. Nested configures then cached a multi-line value and warnedValue of BUILDMASTER_KNOWN_TOOLCHAINS contained a newline; truncating. Semicolons are now escaped in the property and the dump writesset(X "a;b").
Version 2.0.1
[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
Fixed
- Nested
project()no longer stacksbm/<id>under the child's-B. Component build dirs stay${BUILDMASTER_BINDIR}/bm/<id>of the outermost consumer, so WindowsCMAKE_OBJECT_PATH_MAX(250) is not blown by Suite BUNDLED graphs (Crypto → Buffer → Logger → String → Base). - Windows env runner
Add-TypedumpedSOURCE_CODE_ERRORunder MSVCLIB.Enable-BmAnsiConsolecompiled the VT P/Invoke while the process still had the parent jobLIB/INCLUDE/LIBPATH(invalid SDK fragments such as10.0.26100.0//x64). PowerShell 5.1 treats those as compiler errors. The variables are cleared only aroundAdd-Typeand restored after, in bothrunner_windows.ps1.inandrunner_windows_silent.ps1.in. NestedLIBprepend for the real compile is unchanged. - Nested
-G Ninjaused a ghostCMAKE_MAKE_PROGRAM. Theninjatool already exportedNINJA_EXECUTABLEon the component toolchain. It did not exportCMAKE_MAKE_PROGRAM, so a child CMake (including aclang-clleaf under anmsvcparent) ranC:/ProgramData/chocolatey/bin/ninja.exe --versionand died when that path was missing. When theninjatool is loaded,update_toolchain.cmakenow also exportsCMAKE_MAKE_PROGRAMto the same binary. If the tool was not requested, nothing is written. - A later build re-entered the leaf on the unpatched tree. Configure, build and install now hash the component srcdir with CMake only (
file(SHA256)per file,string(SHA256)of the sorted paths). Nosha256sumand nocat. The other half of the key is options, toolchain,CMAKE_BUILD_TYPE, IPO,mode,producedand host OS/arch, stored inbm-stamp.extra.bm-stamp.keyis created when install finishes and refreshed when a later build actually recompiles, and is the file a later install cache will read. A match skips nested cmake/meson and does not touch the prefix. A miss runs that stage.GIT={PATCH}is applied before the hash and the git root is reset when the last live holder finishes, including on a hit, so a latermakemay re-apply and re-hash. The hit still does not parse upstreamCMakeLists.txt. Fixturestamp-patch: upstreamcmake_minimum_required(VERSION 99.0), the patch lowers it to 3.20, the secondstamp-leaf_installis a stamp hit and the worktree is back on 99.0. buildmaster_group_addrequired the group to already exist. Membership is stored even whenbuildmaster_grouphas not run yet. Finalize (_bm_group_plan) is the only existence check: an id named bybuildmaster_group_addthat was never created is FATAL, including when that was the only declaration. Cycles and id clashes stay FATAL where they already were. A group is still not a component, a meta, or a link edge. Fixturegroups-late:buildmaster_group_addnameslate-outerandlate-innerbefore eitherbuildmaster_group. The outline is stilllate-outer→late-inner→late-leaf(indent 2). Negativegroup-undefineddies at configure withgroup was never created.- Shared-dep skip dropped the consumer's need. First-wins still skips configure and build when
links/<id>.cmakealready exists (already built by). That skip is not "this consumer has no dependency". The nested process appends the skipped id tobm-reuse-needs.txt. After that configure returns, the parent walks the id and the dests already stored in its links file and hangs the closure on the consumer (LINKS_ATTACHED, so a later rewrite keeps it).<consumer>_configure/<consumer>_buildwait on<id>_installwhen that stage is in this process, otherwise on the parent component that created the links file (<owner>_install). A skipped configure is still not a second build. Fixturelinks-race: RaceA and RaceB both declare RaceMid, RaceMid declares RaceBase, no parentbuildmaster_dependand no hoist.RaceB_buildwaits onRaceA_install. Both shared libs call a Base-only symbol and link only RaceMid. - Transitive
buildmaster_linkstopped at one recorded hop.buildmaster_link(A B)still names only B._bm_links_write_onenow unions this process's link edges withLINKS_ATTACHEDand the dests already stored inlinks/<id>.cmake, then walks those ids to a fixpoint (seen-set, cycle cut). A parent rewrite no longer replaceslinks/StormByte-String.cmakewith the edges it knows and drops String → Base. A later configure that skips the winner still flattens-l/Stem.libfor the whole chain (--no-allow-shlib-undefined, Apple-undefined,error; Windows already fails unresolved). The caller does not name grandparents. Fixturelinks-transitive: shared TransBase ← TransMid ← TransUpper, and deferred TransLeaf links only TransUpper after the skip, while calling a Base-only symbol. WHOLEwrap was empty on ELF._bm_opt_whole_itemsbuilt-Wl,--whole-archive+ produced.a+-Wl,--no-whole-archive, thenfragment.cmakeflattened the CMake list to spaces andtarget_link_libraries(<id> INTERFACE …)let CMake classify the-Wltokens as flags and the archives as libraries. The DSO line becamelibavutil.a … libavfilter.a -Wl,--whole-archive -Wl,--no-whole-archive. GNU ld.bfd (single pass) then dropped unreferenced avutil objects (av_md5_sum, AES/HMAC, …) while lld still linked. ELF now emits one$<LINK_GROUP:BM_WHOLE,…>and registersCMAKE_{,C_,CXX_}LINK_GROUP_USING_BM_WHOLE(prefix / suffix--whole-archive/--no-whole-archive) so every produced static of that id stays inside the wrap. Apple (-force_load) and MSVC (-WHOLEARCHIVE:) are unchanged. The fragment no longer replaces;with spaces.WHOLEstill means one region around all produced archives of the id, not one wrap per file.