Zig Version
0.16.0 and 0.17.0-dev.313+27be3b069
Steps to Reproduce and Observed Behavior
When using zig build --watch, if I (1) add -fincremental and (2) am running a project inside the system's /tmp directory, then the compiler notices my edits when I save, but it runs an old version of the code.
~ $ mkdir /tmp/dir1; cd /tmp/dir1
/tmp/dir1 $ zig env | grep target
.target = "x86_64-linux.6.12.68...6.12.68-gnu.2.42",
/tmp/dir1 $ zig init
info: created build.zig
info: created build.zig.zon
info: created src/main.zig
info: created src/root.zig
info: see `zig build --help` for a menu of options
/tmp/dir1 $ zig build run --watch -fincremental
All your codebase are belong to us.
info: arg: /tmp/dir1/zig-out/bin/dir1
Run `zig build test` to run the tests.
Build Summary: 5/5 steps succeeded
All your codebase are belong to us.
info: arg: /tmp/dir1/zig-out/bin/dir1
Run `zig build test` to run the tests.
Build Summary: 5/5 steps succeeded
All your codebase are belong to us.
info: arg: /tmp/dir1/zig-out/bin/dir1
Run `zig build test` to run the tests.
Build Summary: 5/5 steps succeeded
^Ctching 77 directories, 1 processes
Those re-runs are from me changing one line of src/main.zig: I changed the args in std.debug.print("All your {s} are belong to us.\n", .{"codebase"}); to .{"linker"} and other variations, but the incremental compiler kept outputting "All your codebase are belong to us.", instead of the expected "All your linker are belong to us."
If I drop the -fincremental, it behaves as expected:
/tmp/dir1 $ zig build run --watch
All your linker are belong to us.
info: arg: /tmp/dir1/zig-out/bin/dir1
Run `zig build test` to run the tests.
Build Summary: 5/5 steps succeeded
All your compiler are belong to us.
info: arg: /tmp/dir1/zig-out/bin/dir1
Run `zig build test` to run the tests.
Build Summary: 5/5 steps succeeded
^Ctching 78 directories, 0 processes
It also behaves as expected if I do these exact same steps (including -fincremental) in a non-temporary directory, e.g. mkdir /home/pancelor/dir2; cd /home/pancelor/dir2
Expected Behavior
zig build --watch -fincremental inside /tmp/dir1 should run my up-to-date code (printing All your linker instead of All your codebase, etc). Or there should be a visible error instead of a silent miscompilation
### Zig Version
0.16.0 and 0.17.0-dev.313+27be3b069
### Steps to Reproduce and Observed Behavior
When using `zig build --watch`, if I (1) add `-fincremental` and (2) am running a project inside the system's `/tmp` directory, then the compiler notices my edits when I save, but it runs an old version of the code.
```shell
~ $ mkdir /tmp/dir1; cd /tmp/dir1
/tmp/dir1 $ zig env | grep target
.target = "x86_64-linux.6.12.68...6.12.68-gnu.2.42",
/tmp/dir1 $ zig init
info: created build.zig
info: created build.zig.zon
info: created src/main.zig
info: created src/root.zig
info: see `zig build --help` for a menu of options
/tmp/dir1 $ zig build run --watch -fincremental
All your codebase are belong to us.
info: arg: /tmp/dir1/zig-out/bin/dir1
Run `zig build test` to run the tests.
Build Summary: 5/5 steps succeeded
All your codebase are belong to us.
info: arg: /tmp/dir1/zig-out/bin/dir1
Run `zig build test` to run the tests.
Build Summary: 5/5 steps succeeded
All your codebase are belong to us.
info: arg: /tmp/dir1/zig-out/bin/dir1
Run `zig build test` to run the tests.
Build Summary: 5/5 steps succeeded
^Ctching 77 directories, 1 processes
```
Those re-runs are from me changing one line of `src/main.zig`: I changed the args in ` std.debug.print("All your {s} are belong to us.\n", .{"codebase"});` to `.{"linker"}` and other variations, but the incremental compiler kept outputting "All your codebase are belong to us.", instead of the expected "All your linker are belong to us."
If I drop the `-fincremental`, it behaves as expected:
```shell
/tmp/dir1 $ zig build run --watch
All your linker are belong to us.
info: arg: /tmp/dir1/zig-out/bin/dir1
Run `zig build test` to run the tests.
Build Summary: 5/5 steps succeeded
All your compiler are belong to us.
info: arg: /tmp/dir1/zig-out/bin/dir1
Run `zig build test` to run the tests.
Build Summary: 5/5 steps succeeded
^Ctching 78 directories, 0 processes
```
It also behaves as expected if I do these exact same steps (including `-fincremental`) in a non-temporary directory, e.g. `mkdir /home/pancelor/dir2; cd /home/pancelor/dir2`
### Expected Behavior
`zig build --watch -fincremental` inside `/tmp/dir1` should run my up-to-date code (printing `All your linker` instead of `All your codebase`, etc). Or there should be a visible error instead of a silent miscompilation