Zig Version
0.17.0-dev.640+ea044a4b8
Steps to Reproduce, Observed Behavior, and Expected Behavior
mkdir -p ~/tmp/foo
cd ~/tmp/foo
zig init
zig build run # observe that it compiles configurer
cd src/
zig build run # observe that it compiles configurer again
I expect the cwd to not affect whether the configurer needs to be recompiled.
This happens because in the first one, the cache manifest contains:
8056 57443266 1779594529138626853 5a83591f61e2713a38200dd649d689b9 0 build.zig
i.e. it has a cwd-relative reference to build.zig. That's what the last 0 there means, it's a base directory of cwd.
In the second one, the manifest contains:
8056 57443266 1779594529138626853 5a83591f61e2713a38200dd649d689b9 0 /home/andy/tmp/abc/build.zig
This is a cwd-relative absolute path to build.zig. Since those don't match, it's a cache miss.
What I would expect instead is that file entry to have a project-relative path to build.zig. In this case it would be a cache hit, plus if you moved the ~/tmp/foo directory to somewhere else, it would stay cached.
Related: #32097
### Zig Version
0.17.0-dev.640+ea044a4b8
### Steps to Reproduce, Observed Behavior, and Expected Behavior
```
mkdir -p ~/tmp/foo
cd ~/tmp/foo
zig init
zig build run # observe that it compiles configurer
cd src/
zig build run # observe that it compiles configurer again
```
I expect the cwd to not affect whether the configurer needs to be recompiled.
This happens because in the first one, the cache manifest contains:
```
8056 57443266 1779594529138626853 5a83591f61e2713a38200dd649d689b9 0 build.zig
```
i.e. it has a cwd-relative reference to `build.zig`. That's what the last `0` there means, it's a base directory of cwd.
In the second one, the manifest contains:
```
8056 57443266 1779594529138626853 5a83591f61e2713a38200dd649d689b9 0 /home/andy/tmp/abc/build.zig
```
This is a cwd-relative absolute path to `build.zig`. Since those don't match, it's a cache miss.
What I would expect instead is that file entry to have a project-relative path to build.zig. In this case it would be a cache hit, plus if you moved the ~/tmp/foo directory to somewhere else, it would stay cached.
Related: #32097