aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-08-07 11:55:30 -0700
committerGitHub <noreply@github.com>2024-08-07 11:55:30 -0700
commit0e99f517f2a1c8c19d7350a221539521b365230e (patch)
treef487716661a5771d7c41f45106bf264da1ea133f /lib/std/Build.zig
parentf9f894200891c8af6ce3a3ad222cd0bf1ee15587 (diff)
parentd721d9af69220c059a7be825d295a0b53081c4a0 (diff)
downloadzig-0e99f517f2a1c8c19d7350a221539521b365230e.tar.gz
zig-0e99f517f2a1c8c19d7350a221539521b365230e.zip
Merge pull request #20958 from ziglang/fuzz
introduce a fuzz testing web interface
Diffstat (limited to 'lib/std/Build.zig')
-rw-r--r--lib/std/Build.zig12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/std/Build.zig b/lib/std/Build.zig
index 7612ad0d6d..03743cf52e 100644
--- a/lib/std/Build.zig
+++ b/lib/std/Build.zig
@@ -2300,22 +2300,26 @@ pub const LazyPath = union(enum) {
}
pub fn path(lazy_path: LazyPath, b: *Build, sub_path: []const u8) LazyPath {
+ return lazy_path.join(b.allocator, sub_path) catch @panic("OOM");
+ }
+
+ pub fn join(lazy_path: LazyPath, arena: Allocator, sub_path: []const u8) Allocator.Error!LazyPath {
return switch (lazy_path) {
.src_path => |src| .{ .src_path = .{
.owner = src.owner,
- .sub_path = b.pathResolve(&.{ src.sub_path, sub_path }),
+ .sub_path = try fs.path.resolve(arena, &.{ src.sub_path, sub_path }),
} },
.generated => |gen| .{ .generated = .{
.file = gen.file,
.up = gen.up,
- .sub_path = b.pathResolve(&.{ gen.sub_path, sub_path }),
+ .sub_path = try fs.path.resolve(arena, &.{ gen.sub_path, sub_path }),
} },
.cwd_relative => |cwd_relative| .{
- .cwd_relative = b.pathResolve(&.{ cwd_relative, sub_path }),
+ .cwd_relative = try fs.path.resolve(arena, &.{ cwd_relative, sub_path }),
},
.dependency => |dep| .{ .dependency = .{
.dependency = dep.dependency,
- .sub_path = b.pathResolve(&.{ dep.sub_path, sub_path }),
+ .sub_path = try fs.path.resolve(arena, &.{ dep.sub_path, sub_path }),
} },
};
}