Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instead of embedding the compiler in the check-cases process, spawn the compiler as a sub-process and communicate the updates using the compiler protocol #14966

Open
Tracked by #14647
andrewrk opened this issue Mar 17, 2023 · 0 comments
Milestone

Comments

@andrewrk
Copy link
Member

Extracted from #14647.

zig/test/src/Cases.zig

Lines 989 to 991 in b4d58e9

// TODO: instead of embedding the compiler in this process, spawn the compiler
// as a sub-process and communicate the updates using the compiler protocol.
pub fn main() !void {

zig/test/src/Cases.zig

Lines 455 to 472 in b4d58e9

incremental_exe: *std.Build.CompileStep,
) void {
for (self.incremental_cases.items) |incr_case| {
if (opt_test_filter) |test_filter| {
if (std.mem.indexOf(u8, incr_case.base_path, test_filter) == null) continue;
}
const case_base_path_with_dir = std.fs.path.join(b.allocator, &.{
cases_dir_path, incr_case.base_path,
}) catch @panic("OOM");
const run = b.addRunArtifact(incremental_exe);
run.setName(incr_case.base_path);
run.addArgs(&.{
case_base_path_with_dir,
b.zig_exe,
});
run.expectStdOutEqual("");
parent_step.dependOn(&run.step);
}

zig/build.zig

Lines 69 to 73 in b4d58e9

const check_case_exe = b.addExecutable(.{
.name = "check-case",
.root_source_file = .{ .path = "test/src/Cases.zig" },
.optimize = optimize,
});

@andrewrk andrewrk added this to the 0.11.0 milestone Mar 17, 2023
@andrewrk andrewrk modified the milestones: 0.11.0, 0.12.0 Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant