diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-02-09 10:01:01 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-02-13 06:42:26 -0700 |
| commit | d97042ad2e41b173334ec542eb4b07e81864d10e (patch) | |
| tree | bf7f000a33e84ad37190b69963ac187d785d1ccd /build.zig | |
| parent | 066632261492ee7624117ad09269f57526aca4c0 (diff) | |
| download | zig-d97042ad2e41b173334ec542eb4b07e81864d10e.tar.gz zig-d97042ad2e41b173334ec542eb4b07e81864d10e.zip | |
std.Build: start using the cache system with RunStep
* Use std.Build.Cache.Directory instead of a string for storing the
cache roots and build roots.
* Set up a std.Build.Cache in build_runner.zig and use it in
std.Build.RunStep for avoiding redundant work.
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -40,11 +40,8 @@ pub fn build(b: *std.Build) !void { }); docgen_exe.single_threaded = single_threaded; - const rel_zig_exe = try fs.path.relative(b.allocator, b.build_root, b.zig_exe); - const langref_out_path = fs.path.join( - b.allocator, - &[_][]const u8{ b.cache_root, "langref.html" }, - ) catch unreachable; + const rel_zig_exe = try b.build_root.join(b.allocator, &.{b.zig_exe}); + const langref_out_path = try b.cache_root.join(b.allocator, &.{"langref.html"}); const docgen_cmd = docgen_exe.run(); docgen_cmd.addArgs(&[_][]const u8{ "--zig", @@ -215,7 +212,7 @@ pub fn build(b: *std.Build) !void { var code: u8 = undefined; const git_describe_untrimmed = b.execAllowFail(&[_][]const u8{ - "git", "-C", b.build_root, "describe", "--match", "*.*.*", "--tags", + "git", "-C", b.build_root.path orelse ".", "describe", "--match", "*.*.*", "--tags", }, &code, .Ignore) catch { break :v version_string; }; |
