A build system for C++26 modules. Project descriptions are C++: a project.cpp constructs a Configuration, or several, and returns them, and crafter-build compiles, loads and executes it. The Flatpak carries its own LLVM, so every machine builds with the same clang, lld, libc++ and WASI sysroot.
New
ExternalDependency's CMake build is not among those steps and keeps that many jobs of its own, and crafter-build test --jobs= counts the tests built and run at once, as before. A step counts as one whatever threads it starts for itself: a link runs on lld's, and an asset is compressed on threads its compressor starts. Progress has two lines for every module interface unit, Precompiling X.cppm and Compiling X.cppm, where a module and its partitions shared one Compiling interface X.Fixes
no such file or directory until the source was touched.New
cfg.cudaArch names, nvcc's -arch, which --cuda-arch= and CRAFTER_BUILD_CUDA_ARCH set where project.cpp calls ApplyStandardArgs. It defaults to native, the GPUs of the machine that builds, as march defaults to its CPU; it was sm_89 for every build. A program built for native carries no PTX for newer GPUs, so build one that runs elsewhere with --cuda-arch=all-major; crafter-build bundle warns of a bundle whose CUDA code is built for native. Another architecture builds in a directory of its own, and so does native on other GPUs. The README's new CUDA section has the details.lib64 holds it, and so does whatever is built on it: cfg.linkFlags then needs no -lcudart and no path into the toolkit, which inside the Flatpak lies under /run/host for the host's /usr/local/cuda. crafter-build --version prints it next to nvcc.Fixes
PATH its manifest sets, every build with cfg.cuda there stopped at nvcc: command not found, because that PATH does not hold the host's toolkit. crafter-build now looks for nvcc itself: in $CUDA_PATH/bin, else in /opt/cuda/bin or the host's /usr/local/cuda/bin, else in an absolute entry of PATH. A build that finds none says where it looked, and crafter-build --version prints the one it found..cu compiles again when a header it includes changes, as a C or C++ source does. It used to compile again only when the .cu itself changed, and kept the object built from the old header.New
cfg.packaging = Packaging::Flatpak, or --packaging=flatpak for one build of a project.cpp that calls ApplyStandardArgs, its bin directory holds the app's files/, with the program, the libc++, libc++abi and libunwind it links, and anything else it needs from the libraries it is built on, which -r runs it against. cfg.flatpak sets the app-id, the runtime (the Platform or the Sdk, at the branch crafter-build runs on), the sandbox's permissions as finish-args, a desktop entry, metainfo, icons and data under /app/share. A library's permissions reach every program built on it. Without packaging, an executable's bin directory holds what it did before. The README's new "Flatpak output" section has the details.crafter-build install builds the project and installs its Flatpak for the current user, and crafter-build bundle builds it into a single .flatpak file, which flatpak install --user installs elsewhere. Both make the app with the host's flatpak build-finish, which writes its metadata and what the host sees of it by flatpak's own rules and refuses a permission flatpak does not have, and print the permissions, with where each came from. cfg.flatpak.modules names flatpak-builder module files for what the app needs in /app besides the program; with any, the host's flatpak-builder makes the app and copies the program in last, so it is not compiled again.org.freedesktop.Flatpak permission, for install and bundle to run the host's flatpak and flatpak-builder, which flatpak update lists among the app's new permissions before it asks to proceed. Nothing else in crafter-build uses it. It lets anything running in the sandbox, a project.cpp and the programs -r and test start included, run commands on the host, which --filesystem=host already let them arrange by writing files the host runs, such as ~/.bashrc.Fixes
ConfigurationType::LibraryDynamic) starts: its link records where the library is. It used to fail at start with cannot open shared object file.bin/ or build/: the search for the include/ directories in a dependency's tree went into them as well, so the headers of a flatpak-builder or CMake tree there came before the system's. A header kept under a directory named bin or build is no longer found that way; add -I with its directory to the cfg.compileFlags of the projects that include it.crafter-build format --check format checks the rules named "format" and writes nothing: it read the second format as the verb again, ran every rule and rewrote the sources. A word repeated after any verb is a glob now, so test test runs the tests matching "test".AddTest runs under wasmtime. It used to fail with failed to open wasm module, because the test runner looked for the program without its .wasm.New
lldb-server, lldb-dap and lldb-mcp, from the same LLVM build as the compiler, so programs that -r and the test runner start can be debugged inside the sandbox they run in. The README's new Debugging section says how, including flatpak enter to reach a program that is already running.VK_INSTANCE_LAYERS or VK_LOADER_LAYERS_ENABLE turns it on from the environment, and VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1 adds GPU-assisted validation. A layer installed on the host cannot stand in: flatpak run clears VK_LAYER_PATH and VK_ADD_LAYER_PATH.spirv-val, spirv-opt, spirv-dis and the rest), so a test that requires tool:spirv-val runs inside it instead of being skipped.--die-with-parent, which ends the sandbox when its flatpak run process dies and, for a command typed at a bash or zsh prompt, when that shell does. Without it, killing flatpak run leaves a build writing into bin/ and build/ and a program started with -r running. An alias set up from an earlier README does not have it.Fixes
.flatpakref attached to a release carries the repository's signing key. Releases 2.0.0 to 5.0.0 attach one with a placeholder in its place, and installing from it fails with GPG: Unable to export keys; the one on flatpak.catcrafts.net has the key.Breaking
flatpak update of a beta installation says so: install stable with flatpak install catcrafts net.catcrafts.CrafterBuild//stable and remove beta with flatpak uninstall net.catcrafts.CrafterBuild//beta.Fixes
--sysroot, so clang searched /usr/include and /usr/lib for the Windows build as well: libstdc++ found glibc's sys/single_threaded.h and had shared_ptr read __libc_single_threaded, and every program that used one failed to link. CRAFTER_MINGW_DIR=/usr did the same outside the Flatpak. A prefix that also holds a Linux system (the host's /usr, or any prefix whose include/ has a C library's features.h) now reaches clang through a view of its mingw-w64 directories in the cache, and compiler messages still name its headers where they are installed. A prefix that holds mingw-w64 alone is the sysroot as before, so Windows libraries installed into its include/ and lib/ are found (#43).--sysroot, is built again from an empty build directory. It used to be reconfigured in place, keeping the objects and check results of the old configure, so a mingw external built by 4.0.0 would have kept failing to link after the fix above.-mtune (a project built with CRAFTER_BUILD_MTUNE set, next to its own project.cpp) or only in sysroot took turns rebuilding it, and every module built against it, on every run.crafter-build lint fails, and says why, when a configuration's compile command cannot be assembled or its std module cannot be built. Its files used to pass every rule that needs an AST as if they were clean.Breaking
Toolchain::mingwSysroot is now mingwPrefix, beside mingwPrefixIsSystem, because clang no longer always gets the prefix itself. A project.cpp that passes the mingw sysroot to a command of its own calls MingwSysroot(); passing mingwPrefix brings the bug above back for a prefix like /usr.crafter-build clean removes the old build directories; the old std module directories stay in the cache until it is cleared by hand.New
AGENTS.template.md, and crafter-build and crafter-build test write AGENTS.md from it with the dependencies' notes merged in: after the template's text, or between its marker lines. AGENTS.md is build output, so it goes into .gitignore, and a fresh clone has none until its first build. A project with a committed AGENTS.md moves over with git mv AGENTS.md AGENTS.template.md and echo /AGENTS.md >> .gitignore. An AGENTS.md no build wrote, such as a committed one still beside a new template, is never replaced; every build warns until it is deleted.Fixes
AGENTS.md, so a dependency that edited its notes, an unpinned one that moved on, or a flag that pulled one in showed up in the project's diff as a change nobody made.Breaking
AGENTS.template.md, a build leaves AGENTS.md alone. A section 3.0.0 kept in it is no longer updated, and every build warns about it until the file is moved to the template or the section is deleted.New
wasm32-wasip1 unit and the std module are compiled with WebAssembly exception handling in its standardized form (exnref), against the exception-enabled libc++ the sysroot ships under lib/<triple>/eh/, and -lunwind and -lsetjmp are linked automatically, so throw and catch, libc++'s own throws, setjmp and longjmp all work. The Flatpak's WASI sysroot is built with those libraries. A page from EnableWasiBrowserRuntime probes for the feature and names what an older browser lacks instead of failing with a CompileError.cfg.scripts; crafter-build run <name> [args...] runs it with everything after the name handed over untouched, a bare run lists the scripts, and the callback's return value is the exit status. ScriptContext gives it the project, the project directory, the arguments and Run(command), which runs a shell command with the terminal attached. Crafter::ShellQuote is exported. Only the scripts of the project crafter-build was pointed at can be run, never a dependency's.AGENTS.consumer.md beside its project.cpp; crafter-build and crafter-build test keep its dependencies' notes in a marked section of a consumer's AGENTS.md, when the consumer has one, and never create the file. cfg.dependencyNotes picks the dependencies: Transitive (the default), Direct or None, which also removes the section.EnableWasiBrowserRuntime, exit and _Exit end the program without running any of its code on the way out, no destructor and no catch (...), with the status in window.crafter_wasi.exitCode. A program that hands the thread to the browser for good and goes on serving calls imports crafter_runtime.park instead, which never returns and leaves main's locals valid for the calls that follow.x86_64-w64-mingw32-gcc on PATH, through CRAFTER_MINGW_DIR naming another prefix, and inside the Flatpak through the host's /usr when it has mingw-w64. Its std module comes from the toolchain's own libstdc++.modules.json, and a toolchain that is not there is a build error saying where it looked, not std::terminate.Fixes
#pragma crafter dependency tools, with the same args, got the tool's copy back: host tooling with -march=native and -fPIC, whose BMI clang then refused. Host tooling and everything it loads are now kept apart in the project cache.crafter-build format clean formats the rules matching "clean"; it used to delete bin/ and build/ and exit 0.-- ends crafter-build's options, as the help has advertised: every later word is an operand of the verb. It used to be forwarded as a project arg and change the variant hash, and the words after it were still read as options.ProjectDependency() works from a static initialiser of a project file; it used to find nothing there and terminate the process.Breaking
-fno-exceptions, -flto in compileFlags or linkFlags, and shared libraries, each with a message that says why; there is no switch back to building without exceptions. The result runs on engines with exnref: Chrome 137, Firefox 131, Safari 18.4 and wasmtime 47 or newer (the bundled one qualifies; an older wasmtime needs -W exceptions=y). An exception that escapes main ends the program as an uncaught WebAssembly exception without calling std::terminate, so catch it in main to report it. The flags are part of the variant hash, so the first wasm build after updating starts in a fresh directory.GitProject or LocalProject without .args now receives the args its loading project.cpp was given, so --target=, --march=, --debug and the project's own flags reach every sibling down the chain; releases up to 2.2.0 forwarded nothing. Set .args = {} to keep the old behaviour, and give every sibling the same list: a project that two paths load with different lists now stops the build. The default is read when the spec is made, so make it inside CrafterBuildProject; a spec made at namespace scope forwards nothing. A #pragma crafter dependency still gets none of the project's args.A Shader entry can carry defines, spelled like the compiler's -D (NAME is defined to 1, NAME=VALUE to VALUE), and a variant that names its output, so one source compiles into several outputs: ui.comp.glsl with variant sets becomes ui.comp.sets.spv. A configuration in which two entries share an output name is refused with both named, as are a malformed define and a variant with a path separator.
Compiles with a sysroot now use the sysroot's own libc++ headers instead of the bundled toolchain's, which fixes cross builds against a musl sysroot that include a standard header textually and stops glibc sysroot builds from silently compiling against the wrong libc++ release. The project.so stamp hashes every part of the host build, so a changed declaration recompiles it. The vendored json.hpp is gone.
The bundled toolchain is now LLVM 23.1.2. Build outputs are kept per compiler, so the first build after updating recompiles each project into a fresh directory and nothing has to be cleaned by hand.
Cross builds pick the std module source that matches the sysroot's libc++ release. The source for libc++ 22 ships beside the bundled 23 for sysroots that carry libc++ without one, such as Alpine, and a sysroot nothing matches fails with one line naming both releases. crafter-build --version prints the libc++ release in use.
First release distributed as a Flatpak, with a bundled LLVM 22 toolchain and WASI sysroot. Windows host support is removed; crafter-build gains --version and resolves its compiler from one place.