aboutsummaryrefslogtreecommitdiff
path: root/lib/std/array_list.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-11-25 17:12:50 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-11-28 01:23:39 -0500
commit3ae4931dc1a3b1b338d2fd3a49a5a79b445bebf6 (patch)
tree8c6f031412192a2024f17506a8f9d10e0fd13343 /lib/std/array_list.zig
parent7411be3c9e6d169108456f03b3cbb9b476ee7498 (diff)
downloadzig-3ae4931dc1a3b1b338d2fd3a49a5a79b445bebf6.tar.gz
zig-3ae4931dc1a3b1b338d2fd3a49a5a79b445bebf6.zip
CLI: more careful resolution of paths
In general, we prefer compiler code to use relative paths based on open directory handles because this is the most portable. However, sometimes absolute paths are used, and sometimes relative paths are used that go up a directory. The recent improvements in 81d2135ca6ebd71b8c121a19957c8fbf7f87125b regressed the use case when an absolute path is used for the zig lib directory mixed with a relative path used for the root source file. This could happen when, for example, running the standard library tests, like this: stage3/bin/zig test ../lib/std/std.zig This happened because the zig lib dir was inferred to be an absolute directory based on the zig executable directory, while the root source file was detected as a relative path. There was no common prefix and so it was not determined that the std.zig file was inside the lib directory. This commit adds a function for resolving paths that preserves relative path names while allowing absolute paths, and converting relative upwards paths (e.g. "../foo") to absolute paths. This restores the previous functionality while remaining compatible with systems such as WASI that cannot deal with absolute paths.
Diffstat (limited to 'lib/std/array_list.zig')
0 files changed, 0 insertions, 0 deletions