Prose and benchmark tables use MultiforaDB; the binary, the CLI usage line, the log-message prefix and the default database file use multiforadb. Two consequences worth noting: - build.zig.zon's fingerprint is derived from the package name, so it had to change with it (Zig refuses to build otherwise). A consumer pinning this package by fingerprint needs updating. - the default --db path is now multiforadb.log, and getCmdLineOpts reports it as dbpath. An existing mongo-lite.log has to be passed explicitly with --db. The e2e harness abbreviated the old name as ML_; that is now MFDB_, including the documented ML_BIN override (MFDB_BIN) and the scratch file names. MD_ (mongod) is untouched. compare-run.sh spawned the server by absolute path under a sandbox/mongo-lite directory that no longer exists; that block already runs from tests/e2e, so it uses a relative path now. The archived reports under tests/e2e/results/ keep the old name: they record what the old binary measured.
50 lines
1.6 KiB
Zig
50 lines
1.6 KiB
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
// ReleaseFast by default: a Debug server is 10-200x slower (measured in
|
|
// tests/e2e/compare-run.sh). Devs can still opt into Debug or
|
|
// ReleaseSafe with -Doptimize=Debug / -Doptimize=ReleaseSafe.
|
|
const optimize = b.option(std.builtin.OptimizeMode, "optimize", "Prioritize performance, safety, or binary size") orelse .ReleaseFast;
|
|
|
|
const lib_mod = b.createModule(.{
|
|
.root_source_file = b.path("src/lib.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
|
|
const exe_mod = b.createModule(.{
|
|
.root_source_file = b.path("src/main.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "mongo", .module = lib_mod },
|
|
},
|
|
});
|
|
|
|
const exe = b.addExecutable(.{
|
|
.name = "multiforadb",
|
|
.root_module = exe_mod,
|
|
});
|
|
b.installArtifact(exe);
|
|
|
|
const run_cmd = b.addRunArtifact(exe);
|
|
run_cmd.step.dependOn(b.getInstallStep());
|
|
if (b.args) |args| run_cmd.addArgs(args);
|
|
const run_step = b.step("run", "Run multiforadb server");
|
|
run_step.dependOn(&run_cmd.step);
|
|
|
|
const test_mod = b.createModule(.{
|
|
.root_source_file = b.path("src/lib.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
|
|
const test_step = b.addTest(.{
|
|
.root_module = test_mod,
|
|
});
|
|
const run_tests = b.addRunArtifact(test_step);
|
|
const test_help = b.step("test", "Run unit tests");
|
|
test_help.dependOn(&run_tests.step);
|
|
}
|