Zig Version
0.17.0-dev.889+e6be5cfe3
Steps to Reproduce, Observed Behavior, and Expected Behavior
Reproduction Steps
build.zig:
conststd=@import("std");pubfnbuild(b:*std.Build)void{consttarget=b.standardTargetOptions(.{});constoptimize=b.standardOptimizeOption(.{});constexe=b.addExecutable(.{.name="incr",.root_module=b.createModule(.{.root_source_file=b.path("src/main.zig"),.target=target,.optimize=optimize,}),.use_llvm=false,.use_lld=false,});b.installArtifact(exe);}
src/main.zig
conststd=@import("std");pubfnmain()!void{std.debug.print("All your {s} are belong to us.\n",.{"foo8"});}
Steps to reproduce, using a compiler running on windows (0.17.0-dev.889+e6be5cfe3 from official zip). I first noticed this on my coff linker branch, but I'm using a linux target here to simplify, since incremental is working on master branch.
This bug does not occur with a linux compiler.
Windows terminal:
> E:\\dev\\zig-x86_64-windows-0.17.0-dev.889+e6be5cfe3\\zig.exe build -fincremental --watch -Dtarget=x86_64-linux-musl --verbose
info(verbose): "E:\\dev\\zig-x86_64-windows-0.17.0-dev.889+e6be5cfe3\\zig.exe" build-exe -fno-llvm -fno-lld -ODebug -target x86_64-linux
-musl -mcpu baseline "-Mroot=C:\\cygwin64\\home\\kcbanner\\temp\\incr\\src\\main.zig" --cache-dir .zig-cache --global-cache-dir "E:\\dev\\zig-cache" --name incr --zig-lib-dir "E:\\dev\\zig-x86_64-windows-0.17.0-dev.889+e6be5cfe3\\lib\\" -fincremental --listen=-
info(verbose): install -C ".zig-cache\\o\4549円e80ad9ebcb1d18e68f55257abb4f\\incr" "C:\\cygwin64\\home\\kcbanner\\temp\\incr\\zig-out\\bin\\incr"
Build Summary: 3/3 steps succeeded
(edit main.zig, change "foo" to "bar")
info(verbose): install -C ".zig-cache\\o\4549円e80ad9ebcb1d18e68f55257abb4f\\incr" "C:\\cygwin64\\home\\kcbanner\\temp\\incr\\zig-out\\bin\\incr"
Build Summary: 3/3 steps succeeded
watching 76 directories, 1 processes
Linux terminal:
$ zig-out/bin/incr
All your foo are belong to us.
(after the update)
$ zig-out/bin/incr
All your foo are belong to us.
$ .zig-cache/o/4549e80ad9ebcb1d18e68f55257abb4f/incr
All your bar are belong to us.
Subsequent edits result in more install logs being printed, but the result is the same, the binary is not copied from the cache.
I also noticed on a project of mine that after the first incremental update, subsequent edits don't trigger any compilations, however I don't have a reduction for that. I suspect if this is some kind of cache issue, it may be related.
Here is a procmon trace of what occurs after an incremental update:
image
Expected Behaviour
All incrementally updated artifacts should be re-installed.
### Zig Version
0.17.0-dev.889+e6be5cfe3
### Steps to Reproduce, Observed Behavior, and Expected Behavior
### Reproduction Steps
build.zig:
```zig
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "incr",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
}),
.use_llvm = false,
.use_lld = false,
});
b.installArtifact(exe);
}
```
src/main.zig
```zig
const std = @import("std");
pub fn main() !void {
std.debug.print("All your {s} are belong to us.\n", .{"foo8"});
}
```
Steps to reproduce, using a compiler running on windows (0.17.0-dev.889+e6be5cfe3 from official zip). I first noticed this on my [coff linker branch](https://codeberg.org/ziglang/zig/pulls/35674), but I'm using a linux target here to simplify, since incremental is working on master branch.
This bug does *not* occur with a linux compiler.
Windows terminal:
```
> E:\\dev\\zig-x86_64-windows-0.17.0-dev.889+e6be5cfe3\\zig.exe build -fincremental --watch -Dtarget=x86_64-linux-musl --verbose
info(verbose): "E:\\dev\\zig-x86_64-windows-0.17.0-dev.889+e6be5cfe3\\zig.exe" build-exe -fno-llvm -fno-lld -ODebug -target x86_64-linux
-musl -mcpu baseline "-Mroot=C:\\cygwin64\\home\\kcbanner\\temp\\incr\\src\\main.zig" --cache-dir .zig-cache --global-cache-dir "E:\\dev\\zig-cache" --name incr --zig-lib-dir "E:\\dev\\zig-x86_64-windows-0.17.0-dev.889+e6be5cfe3\\lib\\" -fincremental --listen=-
info(verbose): install -C ".zig-cache\\o\4549円e80ad9ebcb1d18e68f55257abb4f\\incr" "C:\\cygwin64\\home\\kcbanner\\temp\\incr\\zig-out\\bin\\incr"
Build Summary: 3/3 steps succeeded
(edit main.zig, change "foo" to "bar")
info(verbose): install -C ".zig-cache\\o\4549円e80ad9ebcb1d18e68f55257abb4f\\incr" "C:\\cygwin64\\home\\kcbanner\\temp\\incr\\zig-out\\bin\\incr"
Build Summary: 3/3 steps succeeded
watching 76 directories, 1 processes
```
Linux terminal:
```
$ zig-out/bin/incr
All your foo are belong to us.
(after the update)
$ zig-out/bin/incr
All your foo are belong to us.
$ .zig-cache/o/4549e80ad9ebcb1d18e68f55257abb4f/incr
All your bar are belong to us.
```
Subsequent edits result in more `install` logs being printed, but the result is the same, the binary is not copied from the cache.
I also noticed on a project of mine that after the first incremental update, subsequent edits don't trigger any compilations, however I don't have a reduction for that. I suspect if this is some kind of cache issue, it may be related.
Here is a procmon trace of what occurs after an incremental update:

### Expected Behaviour
All incrementally updated artifacts should be re-installed.