Skip to content

Commit

Permalink
build(zig): use build root instead of cwd (tree-sitter#3944)
Browse files Browse the repository at this point in the history
`std.fs.cwd` refers to the cwd of the build process, which is not the
root of tree-sitter when tree-sitter is used as a sub-module.

Co-authored-by: ObserverOfTime <[email protected]>
  • Loading branch information
aleloi and ObserverOfTime authored Nov 15, 2024
1 parent bcf82da commit 00d34e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn wasmtimeDep(target: std.Target) []const u8 {
fn findSourceFiles(b: *std.Build) ![]const []const u8 {
var sources = std.ArrayList([]const u8).init(b.allocator);

var dir = try std.fs.cwd().openDir("lib/src", .{ .iterate = true });
var dir = try b.build_root.handle.openDir("lib/src", .{ .iterate = true });
var iter = dir.iterate();
defer dir.close();

Expand Down

0 comments on commit 00d34e8

Please sign in to comment.