eliminate absolute paths from the build system #18450
Labels
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
standard library
This issue involves writing Zig code for the standard library.
zig build system
std.Build, the build runner, `zig build` subcommand, package management
Milestone
Absolute paths are generally problematic:
For general improvement in robustness as well as progress towards #14286, this issue is to eliminate all absolute paths from the zig build system. Here are some example violations:
zig/lib/std/Build/Step/Run.zig
Lines 572 to 573 in 501a235
zig/lib/std/Build/Step/Run.zig
Lines 642 to 656 in 501a235
zig/lib/std/Build/Step/WriteFile.zig
Lines 216 to 218 in 501a235
There are plenty more.
Instead, this API should be moved from the compiler implementation (
Package.Path
) tostd.Cache.Path
:zig/src/Package.zig
Lines 6 to 10 in 501a235
Then, Path objects should be passed around rather than strings. This will improve the correctness of a bunch of stuff as well as reduce the amount of unnecessary string manipulation that is happening, and make it easier to implement detection of going outside a directory root.
The text was updated successfully, but these errors were encountered: