zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 97692cb4fefcfe54564fdea0e70b656aec5e6f77 (tree)
parent d9c808e3ff5dc6f72d92457ac448b427d1ce66ff
Author: Timon Kruiper <timonkruiper@gmail.com>
Date:   Mon,  9 Nov 2020 21:17:57 +0100

Do not keep the build.zig cache manifest file locked.

This allows to have multiple instances of `zig build` at the same
time. For example when you have a long running `zig build run` and
then want to run `zig build somethingelse`.

Diffstat:
Msrc/main.zig | 11++---------
1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/main.zig b/src/main.zig @@ -2208,7 +2208,7 @@ pub const usage_build = pub fn cmdBuild(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !void { // We want to release all the locks before executing the child process, so we make a nice // big block here to ensure the cleanup gets run when we extract out our argv. - const lock_and_argv = lock_and_argv: { + const child_argv = argv: { const self_exe_path = try fs.selfExePathAlloc(arena); var build_file: ?[]const u8 = null; @@ -2403,15 +2403,8 @@ pub fn cmdBuild(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v &[_][]const u8{exe_basename}, ); - break :lock_and_argv .{ - .child_argv = child_argv.items, - .lock = comp.bin_file.toOwnedLock(), - }; + break :argv child_argv.items; }; - const child_argv = lock_and_argv.child_argv; - var lock = lock_and_argv.lock; - defer lock.release(); - const child = try std.ChildProcess.init(child_argv, gpa); defer child.deinit();