6.4.0 lets a project.cpp return several configurations from
CrafterBuildConfigurations, which are all built, lets a GitProject or
LocalProject spec pick one of a sibling's configurations by name, keeps
the Configuration of a project loaded through either of them where its
project file built it, and builds a wasm32 library that two
configurations of one build share once when its project file sets the
target itself.
A minor, by the version rule: the notes have New and Fixes and nothing
Breaking.
The README's opening and the start of "Writing a project.cpp" say that a
project file returns one configuration or several, and so does the
description in the Flatpak's metainfo. The README has a "Several
configurations" section in "Writing a project.cpp":
CrafterBuildConfigurations with an example, how the configurations it
returns have to be kept, and what a build, test, run, lint, format, -r,
install and bundle do with several. "Dependencies" says how a GitProject
or LocalProject spec picks one of a sibling's configurations, and that a
`#pragma crafter dependency` gets the first; its sentences on the args a
sibling gets, on where to make a spec and on IsTopLevelProject() speak
of a project file's entry point, where they named CrafterBuildProject.
"Dependency notes for agents" says how the dependencyNotes of several
configurations combine, and which runs leave AGENTS.md alone now that a
list of configurations can be refused before a build starts: its
sentence on that said that a build that fails still has the notes, and
named an `install` or `bundle` refused before building as the one
refusal that writes none. The table of ScriptContext says that a
script's `project` is the configuration it is declared on.
6.3.0 holds a build to as many steps at once as the machine has
hardware threads, where every stale shader, asset to compress, C, CUDA
and C++ unit got a thread of its own and nothing bounded how many ran
at once. It makes the object of a module interface unit that an earlier
build left with its BMI alone, or with the object of before an edit,
and it refuses interface units of one configuration that import each
other, whose first build hung.
A minor, by the version rule: the notes have New and Fixes and nothing
Breaking, and Jorijn's "6.3.0, that's internal and not user facing"
settled it. What he was asked about: the range takes Compile() off
Module, ModulePartition and Implementation, and the `compiled` flag off
the first two, all of which interfaces/ exports. They are what Build()
itself compiled a unit with, and none of the 35 project.cpp files of
this checkout and the ones beside it reads the flag or calls Compile().
6.2.0 makes CUDA sources compile in the Flatpak: crafter-build finds
nvcc itself, under CUDA_PATH, /opt/cuda or the host's /usr/local/cuda,
or in an absolute entry of PATH, where it used to run whatever the
sandbox's PATH gave, which never holds the host's toolkit, and it links
that toolkit's static CUDA runtime itself where the toolkit's lib64
holds it. The GPU architecture CUDA sources compile for is configurable
and native by default, and a .cu compiles again when a header it
includes changes.
A minor, by the version rule: the notes have New and Fixes and nothing
Breaking, and Jorijn's "6.2.0 is fine" settled it. The default
architecture moves from sm_89, which carries its PTX, to native, which
carries none, so a program built for native has no PTX for a GPU of a
newer architecture. That is under New rather than Breaking because no
Flatpak release compiled a .cu with the PATH its manifest sets: each ran
a bare nvcc in the sandbox, whose PATH, /app/bin:/usr/bin, holds no
toolkit, so a project had to set another PATH itself to compile one. A
program for other machines takes another architecture, such as
--cuda-arch=all-major, as the notes say. A project that names -lcudart
in cfg.linkFlags keeps building, with its shared runtime first on the
link line. VariantId changes for no configuration without CUDA sources
but one built with --cuda-arch=, which was a project argument and is
crafter-build's own now; a configuration with CUDA sources builds once
in new bin/ and build/ directories, keyed by its architecture, for
native by crafter-build's reading of the machine's GPUs, and by its
nvcc.
6.1.0 lets a program crafter-build builds run outside its sandbox: an
executable can be packaged as a Flatpak of its own, installed with
`crafter-build install` or bundled into a file with
`crafter-build bundle`, with flatpak-builder modules and data under
/app/share where it needs them. The Flatpak gains the
org.freedesktop.Flatpak permission those two verbs run the host's
flatpak with. It also fixes programs built on a shared library on Linux,
which did not start, compiles that took headers from what a build left
in a dependency's bin/ or build/, `format --check format`, which rewrote
the sources, and wasm tests declared with AddTest, which never ran.
A minor, by the version rule: the notes have New and Fixes and nothing
Breaking. Default still builds an executable as linked, and VariantId
and the bin/ layout change for nothing that is not packaged as a
Flatpak, but for a build given --packaging=, which moves to other bin/
and build/ directories: the argument was a project arg, hashed into
VariantId, and is a standard arg now, for dependencies too. `install`,
`bundle` and `--packaging=` were project args until this range made them
two verbs and a standard arg, and no sibling project.cpp reads any of
them: the only `install` in one is the name of a `run` script, which
`run` takes before any verb. `test test`, `lint lint` and
`format format` now take the second word as a glob. The include walk
leaves out every directory named bin or build now, and that is under
Fixes rather than Breaking: those are the names crafter-build gives what
it writes, and in the Crafter repositories and the dependencies
crafter-build has cloned, the one #include that needs a header found
only there is glslang's, in a source its own CMake build compiles, not
crafter-build. The permission is listed under New, and `flatpak update`
lists it before it asks to proceed.
install and bundle run the host's flatpak and flatpak-builder, and the
only way out of the sandbox to them is the Flatpak session helper, so
the manifest grants --talk-name=org.freedesktop.Flatpak. crafter-build's
own code uses it only through HostCommand, for the host's flatpak and
flatpak-builder, but the permission is the whole sandbox's: every
project.cpp crafter-build loads, its scripts, its dependencies' builds
and the programs -r and test start can run host commands through
flatpak-spawn --host as well. --filesystem=host already lets all of
them arrange that, by writing ~/.bashrc or a systemd user unit; the
permission makes it immediate, it does not make it possible. `flatpak
update` lists it among the app's new permissions before it asks to
proceed.
The run flatpak and run install scripts of project.cpp still refuse
inside the Flatpak, now for the reason that holds there: they run
flatpak themselves, which the sandbox does not have.
The release of this push and of everything on master since 5.0.0: lldb,
the Khronos validation layer and the SPIRV-Tools programs in the
Flatpak, --die-with-parent in the README's alias, and the release
.flatpakref with the repository's key in it. Its Breaking item, the end
of beta and of the rolling release, makes it a major.
Crafter.Graphics' PushConstantRewrite and UIFusedShader tests require
tool:spirv-val, and the Sdk has no spirv-val, so inside the Flatpak they
are skipped. The spirv-tools module the validation layer needs built
only the libraries, and removed them afterwards.
It now builds the programs as well, spirv-val, spirv-opt, spirv-dis and
the rest, which link SPIRV-Tools statically, and ships them. The
headers, the static libraries, the CMake and pkg-config files and
libSPIRV-Tools-shared.so, which nothing here links, are still removed,
and a post-install step runs spirv-val --version.
Programs that -r and the test runner start run inside the Flatpak's
sandbox, and the Sdk it runs on has gdb but neither lldb nor the Khronos
validation layer: in the sandbox of beta 5.0.0, a vkCreateInstance that
asks for VK_LAYER_KHRONOS_validation returns VK_ERROR_LAYER_NOT_PRESENT.
flatpak run clears VK_LAYER_PATH and VK_ADD_LAYER_PATH, so the layer the
host has cannot stand in.
lldb becomes a project of the llvm module and brings lldb-server,
lldb-dap and lldb-mcp. Its Python, libedit, curses, libxml2 and lzma
support are set ON instead of being left to detection, so a dependency
that goes missing fails the configure step rather than shipping an lldb
without it. The Sdk has neither SWIG nor libedit, so both become modules
before llvm, SWIG as build-only.
The layer is Vulkan-ValidationLayers vulkan-sdk-1.4.357.0, the Vulkan
SDK release of the Sdk's loader (libvulkan.so.1.4.357), built from
Vulkan-Headers, Vulkan-Utility-Libraries, SPIRV-Headers and SPIRV-Tools
at the revisions that release's scripts/known_good.json names. Those
four are built into /app at those revisions and removed afterwards. All
five come after the LLVM and WASI modules, so that bumping them reuses
the cached LLVM and WASI builds. UPDATE_DEPS is turned off: it defaults
to ON, which has update_deps.py clone the dependencies, and of all the
modules only crafter-build's build-args share the network.
The fix for #43, a mingw build that saw the host's glibc headers and
Linux libraries through a prefix like /usr as clang's sysroot, and what
the review of it brought along: units that recompile after a std module
rebuilt in place, CMake externals built again when their configure
inputs change, std modules keyed on every flag they are compiled with,
and lint that fails rather than passing files it could not parse. A
major, because Toolchain::mingwSysroot is now mingwPrefix and every
build directory moves once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AGENTS.md written from a tracked AGENTS.template.md, so the dependency
notes no longer change a file the project commits. A major, because a
project that kept 3.0.0's notes section in its committed AGENTS.md
stops getting it updated until it moves to the template: the rule is a
major whenever the notes have a Breaking section, even one that no
build fails over.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This repository now uses the template itself. AGENTS.md is written by
the self-host build and `test` and is gitignored, so the notes
Crafter.Math ships reach the agents working here, and a change to them
no longer leaves a tracked file modified, which also made every build
afterwards a dirty-tree version, a new crafter.build-lib variant and a
full rebuild.
The gotcha that described the old arrangement now says where to edit,
that a fresh clone or worktree has no AGENTS.md until its first build
(./build.sh does not write it), and what an older harness does to the
generated file. The paths table and the never-commit list name both
files. The CI error for a missing signing key and a manifest comment
point at the template, since the forge no longer shows an AGENTS.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C++ exceptions in wasm builds, scripts, dependency notes, the browser
runtime's exit and park, and mingw found where it is; the fixes since
2.2.0; and the two changes that need a look when upgrading: the wasm
sysroot and engine requirements, and siblings inheriting the loading
project's args. A major, because a wasm project.cpp with
-fno-exceptions or an older sysroot, and a project.cpp whose siblings
relied on getting no args, build differently or not at all on this
release.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
-flto in a wasm configuration's compileFlags or linkFlags reached the
link, where LTO code generation runs without the backend options that
keep exception handling: every landing pad was dropped, and the build
succeeded with throws that escaped their catch blocks. -fno-exceptions
there made every `import std;` fail on the std module built with
exceptions, and a wasm shared library failed to link against the eh/
libc++, which is static archives built without -fPIC. Build() refuses
all three now, each with a line that says why, before it makes a
directory or starts a thread.
The sysroot check sat in BuildStdPcm, which the linter calls as well.
There the error only dropped the compile command, so lint ran no AST
rule on a wasm configuration and reported it clean. It also refused
static libraries, which never link, fired after the shader and
external threads had started, and called a missing sysroot, or one
without the target, "no C++ exception support". It is part of the same
early check now, which first says when the sysroot or the target's
directory is missing, and asks for libunwind only where something
links.
C sources got only the signal.h define. setjmp.h refused to compile in
C, and a C object given -wasm-enable-sjlj through compileFlags used the
legacy exception encoding next to C++ objects in the standard one, a
mix engines refuse to load. They get WasmCompileFlags now, like the C++
units, a variant pass's flags included.
The baseline probes include simd: V8 and SpiderMonkey switch SIMD off
on x86 CPUs without SSE4.1, which virtual machines often present, and
such an engine passed the exception-handling probe only to fail
compiling the module; the manifest tests expect it on every entry. The
Flatpak pins WASI_SDK_EXCEPTIONS=DUAL, which
wasi-sdk 34 defaults to only with clang 23 or newer, and checks that
the eh/ libunwind got installed: the wasm tests skip without it, so CI
would otherwise pass a Flatpak whose every wasm build fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI takes the newest <release> as the notes of a tag and refuses a tag
that does not match it. 2.2.0 covers what changed since 2.1.0: Shader
entries with per-entry defines and a named output variant, sysroot
compiles against the sysroot's own libc++ headers, a project.so stamp
that hashes every part of the host build, and the vendored json.hpp
removed.
The variant API is what catcrafts.net's deploy needs: Crafter.Graphics
master has used it since 2026-10-06, and a stable Flatpak that lacks it
cannot build the site.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
CI takes the newest <release> as the notes of a tag and refuses a tag
that does not match it. 2.1.0 covers what changed since 2.0.0: the
bundled LLVM 23.1.2, build outputs kept per compiler, and the std
module source chosen by the sysroot's libc++ release.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The previous commit made the LLVM tree inside the wasi-sdk checkout a
git repository with `git init`, so that wasi-sdk's patch step would
apply. That was half the fix: wasi-sdk also runs `git rev-parse HEAD`
in that tree to write the sysroot's VERSION file, which on an empty
repository raises a traceback during configure and leaves VERSION
without its llvm lines. The build went on regardless, so the suite
passed and the published beta carries the truncated file.
Fetching the tree as a git source pinned to the release tag gives
wasi-sdk what it has upstream, a submodule checkout at a commit, and
removes the shell step instead of stacking a second workaround on it.
The llvm module keeps the release tarball: it is the same commit, and a
tarball is the cheaper download for a tree that is only compiled.
flatpak-builder keeps a mirror of the clone in its state directory, so
the fetch costs the cold run about 300 MB once.
Verified locally: no traceback, VERSION lists llvm 85ac56026243 and
llvm-version 23.1.2, the eight patch steps apply, the suite passes in
the sandbox and a wasm32-wasip1 program runs under the bundled wasmtime.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
With LLVM 23 bundled, a sysroot still on libc++ 22 without its own
module source (Alpine v3.24) is the mirror image of the case that
started this: the toolchain's source is a release ahead of the
sysroot's headers. The new libcxx-22-modules module installs libc++
22.1.8's module source under share/crafter-build/libc++-modules/22,
where SysrootStdModule looks for the release a sysroot is on.
It only configures libc++'s runtimes build and installs the cxx-modules
component: std.cppm as configure generates it and the .inc files from
the source tree, nothing compiled, about 600 KB installed. The
component is staged and copied because it also writes
lib/libc++.modules.json, which belongs to the bundled libc++.
Verified in the built Flatpak: `crafter-build --version` lists release
22, and a cross build against an Alpine v3.24 aarch64 sysroot (libc++
22.1.3) precompiles that source with clang 23, links and runs under
qemu.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
LLVM 23 has been the stable series since September, and the distros
crafter-build cross-builds for have moved to it: Alpine edge ships
libc++ 23.1.2, which is what surfaced the std module mismatch fixed in
the previous commits. wasi-sdk 34 already builds against a newer LLVM
than 22 upstream, so the WASI sysroot loses nothing by following.
The bump exposed a patch step that never ran. wasi-sdk patches its LLVM
tree with `git apply` in src/llvm-project, which upstream is a
submodule. Here that directory is a tarball unpacked inside the
wasi-sdk checkout, and git, finding the outer repository, treats every
patched path as outside the current directory, prints "Skipped patch"
and exits 0. LLVM 22 built without the three patches; libc++ 23 does
not compile for WASI without the one that keeps the z/OS locale shim
out of other platforms' builds (strtod_l redeclared with an abi_tag).
`git init` on the unpacked tree makes it a repository of its own, so
wasi-sdk's step applies whatever patch list the pinned tag carries, as
it does upstream, and fails loudly when a patch no longer fits.
Built locally: the whole manifest, the suite inside the sandbox (26
passed, WasmHelloRuns under the bundled wasmtime included), and aarch64
musl cross builds against Alpine edge and v3.24 sysroots that run under
qemu. The native development loop is unaffected and stays on whatever
clang the machine has.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
flatpak-builder printed "Building module llvm" on every CI run instead
of "Cache hit". The build environment, CRAFTER_BUILD_VERSION included,
sat in the manifest's top-level build options, and those are part of
every module's cache key; the version changes with each commit, so no
module ever hit. Runs still took twelve minutes rather than eighty only
because ccache made the LLVM rebuild cheap.
The variables only matter to crafter-build's own module, so they move
there, and CI rewrites the version on that module. LLVM, the WASI
sysroot and wasmtime are now keyed on nothing that changes between
commits.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every non-tag build called itself 0.0.0-dev+<hash>, a placeholder that
said nothing about which release it came after and put a `+` in the
bundle's download URL. A master build now uses `git describe`, as a
local checkout already does: 2.0.0-3-g21746b1 is three commits past
2.0.0. The placeholder remains only for history that has no tag yet.
Three more things the tag path needed before its first run. The
forgejo-release action takes the notes text in `release-notes` and a
path in `release-notes-file`; the workflow passed a path to the former,
so the release body would have been the file name. The tag filter is
spelled with globs so it reads the same as a workflow pattern or a plain
glob. Python, used to extract the notes from the metainfo, was only in
the container as somebody else's dependency and is now listed. The
2.0.0 entry carries the date it is tagged on.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
wasi-sdk's sysroot build hands its compiler-rt sub-build
CMAKE_C_COMPILER_TARGET but nothing for the ASM language, so the two
wasm/*.S stubs in the builtins (the setjmp/longjmp and C++ exception
tags) were assembled for x86-64. wasm-ld warned on every wasm link that
the archive members were neither Wasm objects nor bitcode, and anything
that reaches those tags, which crafter-build's -wasm-enable-sjlj does,
would fail to link. wasi-sdk's own toolchain never sees it because its
clang defaults to wasm32-wasip1; the sysroot-only mode against a host
clang does. A one-line patch adds CMAKE_ASM_COMPILER_TARGET to that
sub-build; it belongs upstream.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Three findings from building the manifest locally.
LLVM's runtimes build installs libc++ under lib/<triple>/ by default.
clang finds it there, but the rpath crafter-build adds for a toolchain
outside /usr points at <prefix>/lib, and so does every distro layout the
resolver was modelled on; the bootstrap failed to start with
libc++.so.1 missing. LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF puts the
runtimes in lib/ and include/c++/v1.
flatpak-builder's default CFLAGS carry -g. For all of LLVM that is a
30 GB build tree and a multi-gigabyte .Debug extension; the module now
builds without debug info and strips, keeping the hardening flags. The
no-debuginfo key also moves under build-options, where flatpak-builder
actually reads it.
The same default CFLAGS and LDFLAGS (-fcf-protection, -z relro) reach
wasi-sdk's nested wasm32 builds through the environment, and clang
rejects them for that target. The wasi-sysroot module clears them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
packaging/flatpak/ holds the manifest for net.catcrafts.CrafterBuild and
its side files. The runtime is the Freedesktop Sdk, not the Platform: a
build tool needs glibc's headers and crt objects, gcc's libgcc_s, cmake,
ninja, git and python at run time. Everything compiler-shaped is ours
under /app, built from one LLVM 22.1.8 source tree: clang, lld, libclang,
libc++ with its std module, compiler-rt for the host and for wasm32, the
WASI sysroot (wasi-sdk 34 in sysroot-only mode, driven by the clang just
built) and wasmtime for running the result. One tree means the modules
crafter-build builds and the compiler that consumes them cannot drift
apart, and the toolchain resolver finds all of it beside the executable
with no configuration.
The crafter-build module runs the bootstrap, the self-host build and the
test suite inside the sandbox, so a Flatpak that installs has passed the
suite with the toolchain it ships. CRAFTER_BUILD_MARCH is x86-64-v2 for
the shipped binary; user projects keep -march=native.
WasmHelloRuns compiles a fixture for wasm32-wasip1 and runs it under
wasmtime. The existing wasm tests only inspect generated files, so this
is the one that proves the sysroot, the std module for wasm and wasm-ld
work together; it skips where the sysroot or wasmtime is missing.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>