// TODO: can not delete since FileBusy error
//
if (b.cache_root.path) |cache_dir| {
const delete_zig_cache_dir = b.addRemoveDirTree(cache_dir);
clean_step.dependOn(&delete_zig_cache_dir.step);
}
Builder is an executable in the zig-cache.
Deleting the zig-cache contents, includes the running builder executable.
In Windows you cannot delete a running executable.
As a quick follow up, I usually define a script that I run while I am developing that clears the cache first and then runs zig build (if the project calls for that).