From f66120a8eba71382c47796d92f74110b2fa0b479 Mon Sep 17 00:00:00 2001 From: catbot Date: Fri, 31 Jul 2026 11:11:44 +0000 Subject: [PATCH] fix(incremental): relink when a C or CUDA object is rebuilt The C compile loop sets no repack flag, and the "is any object newer than the archive" sweep only walked interfaces and implementations. So editing a .c recompiled its object and then linked nothing: the archive and the executable kept the previous one. Surfaced by the header-change test, where a rebuilt counter.c produced a binary still printing the old value. --- implementations/Crafter.Build-Clang.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/implementations/Crafter.Build-Clang.cpp b/implementations/Crafter.Build-Clang.cpp index c59df50..9262475 100644 --- a/implementations/Crafter.Build-Clang.cpp +++ b/implementations/Crafter.Build-Clang.cpp @@ -1109,6 +1109,21 @@ BuildResult Crafter::Build(Configuration& config, std::unordered_map& sources) { + for (const fs::path& source : sources) { + if (objNewer(buildDir / std::format("{}_source.o", source.filename().string()))) return true; + } + return false; + }; + if (sourceObjNewer(config.cFiles) || sourceObjNewer(config.cuda)) { + buildResult.repack = true; + } + } } } }