Update build_runner.zig

I'm not 100% sure if the `GeneratedFile`'s path will have been resolved when this code runs or if this will hit the panic inside `getPath()` as I havent had a chance to actually mess about with the new functionality.
This commit is contained in:
Lee Cannon 2021-06-12 23:06:48 +01:00 committed by GitHub
parent 0eee9dcd9f
commit a077cf901d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,11 @@ fn processStep(stdout_stream: anytype, step: *std.build.Step) anyerror!void {
} }
fn processPackage(out_stream: anytype, pkg: Pkg) anyerror!void { fn processPackage(out_stream: anytype, pkg: Pkg) anyerror!void {
try out_stream.print("{s}\x00{s}\n", .{ pkg.name, pkg.path }); switch (pkg.path) {
.path => |path| try out_stream.print("{s}\x00{s}\n", .{ pkg.name, path }),
.generated => |generated| try out_stream.print("{s}\x00{s}\n", .{ pkg.name, generated.getPath() }),
}
if (pkg.dependencies) |dependencies| { if (pkg.dependencies) |dependencies| {
for (dependencies) |dep| { for (dependencies) |dep| {
try processPackage(out_stream, dep); try processPackage(out_stream, dep);