Skip to content

Commit

Permalink
don't override existing build runner files in cache
Browse files Browse the repository at this point in the history
the cache may be accessed by multiple ZLS processes
  • Loading branch information
Techatrix committed Nov 21, 2024
1 parent fa0e732 commit d120457
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1260,15 +1260,17 @@ fn resolveConfiguration(
cache_dir.writeFile(.{
.sub_path = "BuildConfig.zig",
.data = build_runner_config_source,
}) catch |err| {
.flags = .{ .exclusive = true },
}) catch |err| if (err != error.PathAlreadyExists) {
log.err("failed to write file '{s}/BuildConfig.zig': {}", .{ cache_path, err });
break :blk;
};

cache_dir.writeFile(.{
.sub_path = "build_runner.zig",
.data = build_runner_source,
}) catch |err| {
.flags = .{ .exclusive = true },
}) catch |err| if (err != error.PathAlreadyExists) {
log.err("failed to write file '{s}/build_runner.zig': {}", .{ cache_path, err });
break :blk;
};
Expand Down

0 comments on commit d120457

Please sign in to comment.