Progress towards #32097
I am not sure how to test this change properly, I ran zig build -Dskip-llvm=true test-cases and used my own script for testing moving the package around in various ways. I had some errors in the test-cases, but it seemed relevant to llvm as the error was ZigCompilerNotBuiltWithLLVMExtensions even despite the skip-llvm.
I wanted to do more with dependencies having relative paths, but that seems to require bigger changes of scope that I am unsure of. I think I will attempt to solve that later if this passes.
Note: I am fine with waiting with this for build-runner-process branch and rebasing after that, feedback would be appreciated even before that though.
Problems solved:
- Files of current package are stored as build root relative.
Moving package does not invalidate all project file cache entries.
- Path to a dependency now contains path only to the dependency, ".." segments are resolved so current package
path does not necessarily need to be mentioned inside the path. Moving only the package does not invalidate cache
entry for build.zig.zon and does not cause build.zig rebuild.
Problems remaining after this:
- Dependencies still have their cache entries with absolute paths.
- This causes that when common ancestor of built package and its dependency moves, dependency is rebuilt.
- Or when common ancestor is mounted to two different mountpoints, building from the other directory causes rebuild
- Path to a dependency is stored as absolute
- build script cache miss whenever dependency path changes, even if relative path from package to dep remained the same.
Progress towards #32097
I am not sure how to test this change properly, I ran `zig build -Dskip-llvm=true test-cases` and used my own script for testing moving the package around in various ways. I had some errors in the test-cases, but it seemed relevant to llvm as the error was `ZigCompilerNotBuiltWithLLVMExtensions` even despite the skip-llvm.
I wanted to do more with dependencies having relative paths, but that seems to require bigger changes of scope that I am unsure of. I think I will attempt to solve that later if this passes.
Note: I am fine with waiting with this for build-runner-process branch and rebasing after that, feedback would be appreciated even before that though.
### Problems solved:
- Files of current package are stored as build root relative.
Moving package does not invalidate all project file cache entries.
- Path to a dependency now contains path only to the dependency, ".." segments are resolved so current package
path does not necessarily need to be mentioned inside the path. Moving only the package does not invalidate cache
entry for build.zig.zon and does not cause build.zig rebuild.
### Problems remaining after this:
- Dependencies still have their cache entries with absolute paths.
- This causes that when common ancestor of built package and its dependency moves, dependency is rebuilt.
- Or when common ancestor is mounted to two different mountpoints, building from the other directory causes rebuild
- Path to a dependency is stored as absolute
- build script cache miss whenever dependency path changes, even if relative path from package to dep remained the same.