Crafter.Build/implementations
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf e280c955f7
fix(host-cache): hash every part of the project.so stamp
The stamp that decides whether a compiled project file can be reused
was meant to cover the crafter-build version, the toolchain key, the
module-source stamp and the compile command. Only the version went in.
The four parts were joined by a format string with "\0" between the
fields, and a format string is read as a C string: it ended at the
first NUL, so std::format saw "{}" and dropped the other arguments
without a diagnostic.

A project.so is loaded into the crafter-build process and fills in
Configuration objects by their layout. With the stamp blind to the
declarations, one built against other module sources was loaded as
current whenever the version string was unchanged, which is every
working-tree build (`git describe --dirty` does not follow the tree's
contents) and every local Flatpak build. Growing a class that project
files construct then corrupts the heap: a project.so built while Shader
was 56 bytes, loaded after it had become 104, aborted with "free():
invalid size" as soon as it declared a shader. CI builds were spared
only because each carries its own version.

The parts are now appended to a std::string with NUL separators, the
way the other stamps in this file are built. Every existing project.so
carries a stamp of the version alone, so each is recompiled once.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-06 16:50:41 +02:00
..
Crafter.Build-Asset.cpp linting 2026-07-23 01:24:42 +02:00
Crafter.Build-Clang.cpp fix(sysroot): take the std module source from the sysroot's libc++ release 2026-10-03 16:37:00 +02:00
Crafter.Build-External.cpp feat(toolchain): resolve the compiler in one place 2026-10-02 22:26:31 +02:00
Crafter.Build-Implementation.cpp fix: decide a build step by its exit code, not by whether it printed 2026-08-26 00:51:15 +00:00
Crafter.Build-Interface.cpp fix: decide a build step by its exit code, not by whether it printed 2026-08-26 00:51:15 +00:00
Crafter.Build-Lint.cpp feat(toolchain): resolve the compiler in one place 2026-10-02 22:26:31 +02:00
Crafter.Build-Platform.cpp fix(host-cache): hash every part of the project.so stamp 2026-10-06 16:50:41 +02:00
Crafter.Build-Progress.cpp refactor: drop Windows host support 2026-10-02 22:03:34 +02:00
Crafter.Build-Shader.cpp fix(lint): constexpr-constant asks clang's evaluator, not the initialiser tokens 2026-07-31 02:05:37 +02:00
Crafter.Build-Test.cpp feat(toolchain): resolve the compiler in one place 2026-10-02 22:26:31 +02:00
Crafter.Build-Toolchain.cpp fix(sysroot): take the std module source from the sysroot's libc++ release 2026-10-03 16:37:00 +02:00
main.cpp refactor: drop Windows host support 2026-10-02 22:03:34 +02:00