Skip to content

Commit

Permalink
build_runner: don't attempt to find build.zig in packages without bui…
Browse files Browse the repository at this point in the history
…ld.zig (#1805)

Co-authored-by: nullptrdevs <[email protected]>
  • Loading branch information
truemedian and llogick authored Mar 2, 2024
1 parent d034594 commit 0a89177
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/build_runner/master.zig
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ pub fn main() !void {

var deps_build_roots: std.ArrayListUnmanaged(BuildConfig.DepsBuildRoots) = .{};
for (dependencies.root_deps) |root_dep| {
inline for (@typeInfo(dependencies.packages).Struct.decls) |package| {
inline for (@typeInfo(dependencies.packages).Struct.decls) |package| blk: {
if (std.mem.eql(u8, package.name, root_dep[1])) {
const package_info = @field(dependencies.packages, package.name);
if (!@hasDecl(package_info, "build_root")) continue;
if (!@hasDecl(package_info, "build_root")) break :blk;
if (!@hasDecl(package_info, "build_zig")) break :blk;
try deps_build_roots.append(allocator, .{
.name = root_dep[0],
// XXX Check if it exists?
.path = try std.fs.path.resolve(allocator, &[_][]const u8{ package_info.build_root, "./build.zig" }),
});
}
Expand Down

0 comments on commit 0a89177

Please sign in to comment.