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

build: add zig build check #1538

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,27 @@ pub fn build(b: *std.Build) !void {
},
});

{
// Run a tigerbeetle build without running codegen and waiting for llvm
// see <https://github.com/ziglang/zig/commit/5c0181841081170a118d8e50af2a09f5006f59e1>
// how it's supposed to work.
// In short, codegen only runs if zig build sees a dependency on the binary output of
// the step. So we duplicate the build definition so that it doesn't get polluted by
// b.installArtifact.
// TODO(zig): https://github.com/ziglang/zig/issues/18877
const tigerbeetle = b.addExecutable(.{
.name = "tigerbeetle",
.root_source_file = .{ .path = "src/tigerbeetle/main.zig" },
.target = target,
.optimize = mode,
});
tigerbeetle.addModule("vsr", vsr_module);
tigerbeetle.addModule("vsr_options", vsr_options_module);

const check = b.step("check", "Check if Tigerbeetle compiles");
check.dependOn(&tigerbeetle.step);
}

const tigerbeetle = b.addExecutable(.{
.name = "tigerbeetle",
.root_source_file = .{ .path = "src/tigerbeetle/main.zig" },
Expand Down