Skip to content

Commit ac53933

Browse files
committed
dirs should be absolute
1 parent 0f04072 commit ac53933

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

build.zig

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ const V8_VERSION: []const u8 = "14.0.365.4";
55
const LazyPath = std.Build.LazyPath;
66

77
fn getDepotToolExePath(b: *std.Build, depot_tools_dir: []const u8, executable: []const u8) []const u8 {
8-
return b.fmt("{s}/{s}", .{ b.pathFromRoot(depot_tools_dir), executable });
8+
return b.fmt("{s}/{s}", .{ depot_tools_dir, executable });
99
}
1010

11-
fn addDepotToolsToPath(b: *std.Build, step: *std.Build.Step.Run, depot_tools_dir: []const u8) void {
12-
const depot_tools_absolute_path = b.pathFromRoot(depot_tools_dir);
13-
step.addPathDir(depot_tools_absolute_path);
11+
fn addDepotToolsToPath(step: *std.Build.Step.Run, depot_tools_dir: []const u8) void {
12+
step.addPathDir(depot_tools_dir);
1413
}
1514

1615
pub fn build(b: *std.Build) !void {
@@ -24,7 +23,7 @@ pub fn build(b: *std.Build) !void {
2423
b.option(bool, "inspector_subtype", "Export default valueSubtype and descriptionForValueSubtype") orelse true,
2524
);
2625

27-
const cache_root = b.option([]const u8, "cache_root", "Root directory for the V8 and depot_tools cache") orelse ".lp-cache";
26+
const cache_root = b.option([]const u8, "cache_root", "Root directory for the V8 and depot_tools cache") orelse b.pathFromRoot(".lp-cache");
2827
std.fs.cwd().access(cache_root, .{}) catch {
2928
try std.fs.cwd().makeDir(cache_root);
3029
};
@@ -141,7 +140,7 @@ fn bootstrapDepotTools(b: *std.Build, depot_tools_dir: []const u8) !*std.Build.S
141140
getDepotToolExePath(b, depot_tools_dir, "ensure_bootstrap"),
142141
});
143142
ensure_bootstrap.setCwd(.{ .cwd_relative = depot_tools_dir });
144-
addDepotToolsToPath(b, ensure_bootstrap, depot_tools_dir);
143+
addDepotToolsToPath(ensure_bootstrap, depot_tools_dir);
145144
ensure_bootstrap.step.dependOn(&copy_depot_tools.step);
146145

147146
const create_marker = b.addSystemCommand(&.{ "touch", marker_file });
@@ -304,7 +303,7 @@ fn bootstrapV8(
304303
"sync",
305304
});
306305
gclient_sync.setCwd(.{ .cwd_relative = v8_dir });
307-
addDepotToolsToPath(b, gclient_sync, depot_tools_dir);
306+
addDepotToolsToPath(gclient_sync, depot_tools_dir);
308307
gclient_sync.step.dependOn(&write_gclient_args.step);
309308

310309
// Run clang update
@@ -313,7 +312,7 @@ fn bootstrapV8(
313312
"tools/clang/scripts/update.py",
314313
});
315314
clang_update.setCwd(.{ .cwd_relative = v8_dir });
316-
addDepotToolsToPath(b, clang_update, depot_tools_dir);
315+
addDepotToolsToPath(clang_update, depot_tools_dir);
317316
clang_update.step.dependOn(&gclient_sync.step);
318317

319318
// Create marker file
@@ -381,7 +380,7 @@ fn buildV8(
381380
b.fmt("--args={s}", .{gn_args.items}),
382381
});
383382
gn_run.setCwd(v8_dir_lazy_path);
384-
addDepotToolsToPath(b, gn_run, depot_tools_dir);
383+
addDepotToolsToPath(gn_run, depot_tools_dir);
385384
gn_run.step.dependOn(&bootstrapped_v8.step);
386385

387386
const ninja_run = b.addSystemCommand(&.{
@@ -391,7 +390,7 @@ fn buildV8(
391390
"c_v8",
392391
});
393392
ninja_run.setCwd(v8_dir_lazy_path);
394-
addDepotToolsToPath(b, ninja_run, depot_tools_dir);
393+
addDepotToolsToPath(ninja_run, depot_tools_dir);
395394
ninja_run.step.dependOn(&gn_run.step);
396395

397396
const wf = b.addWriteFiles();

0 commit comments

Comments
 (0)