summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 13:48:37 -0300
committerGabriel Schneider <[email protected]>2026-11-05 19:16:07 -0300
commit38d21b0cb34ef1f555e5bda8155150bda9bfbaee (patch)
treec4090f2aab0635c36cfad8ebe67e80474c3755a6
parent323add8ead6160dee62d48efde69fcee7b333f3a (diff)
downloadpardes-38d21b0cb34ef1f555e5bda8155150bda9bfbaee.tar.gz
pardes-38d21b0cb34ef1f555e5bda8155150bda9bfbaee.zip
build: xitdb, the database pardes's disk state is to go through (architecture §14), vendored as every dependency is: `zig fetch --save=xitdb` of the tarball of github.com/xit-vcs/xitdb at its pinned commit 6b93af1a (Zig 0.17, MIT, no dependencies) into build.zig.zon and zig-pkg, and imported by every core module (wireCore); pure Zig, so there is no C library to share and no allocator hook to set (it allocates through the allocators it is given), its row in docs/shared-libs.md; nothing uses it yet
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
-rw-r--r--build.zig7
-rw-r--r--build.zig.zon4
-rw-r--r--docs/shared-libs.md1
3 files changed, 12 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index f435a39f..e1544e74 100644
--- a/build.zig
+++ b/build.zig
@@ -817,6 +817,10 @@ pub fn build(b: *std.Build) void {
for (core_mods) |m| m.linkLibrary(zstd);
}
+ // xitdb keeps what pardes writes to disk (src/Db.zig): pure Zig, no C
+ // library and no allocator hook of its own (it takes Zig allocators).
+ const xitdb_mod = b.dependency("xitdb", .{ .target = target, .optimize = optimize }).module("xitdb");
+
// One call per module instead of one line per module per dependency, and
// BEFORE the fold below, which reads what these imports put in the table.
for (core_mods) |m| wireCore(m, .{
@@ -832,6 +836,7 @@ pub fn build(b: *std.Build) void {
.vaxis = vaxis_mod,
.uucode = uucode_mod,
.wuffs = wuffs_mod,
+ .xitdb = xitdb_mod,
});
const iso_off = b.addOptions();
@@ -1906,6 +1911,7 @@ fn wireCore(m: *std.Build.Module, d: struct {
vaxis: ?*std.Build.Module = null,
uucode: ?*std.Build.Module = null,
wuffs: ?*std.Build.Module = null,
+ xitdb: ?*std.Build.Module = null,
}) void {
if (d.themes) |x| m.addImport("generated_themes", x);
if (d.tree_sitter) |x| m.addImport("tree-sitter", x);
@@ -1919,4 +1925,5 @@ fn wireCore(m: *std.Build.Module, d: struct {
if (d.vaxis) |x| m.addImport("vaxis", x);
if (d.uucode) |x| m.addImport("uucode", x);
if (d.wuffs) |x| m.addImport("wuffs", x);
+ if (d.xitdb) |x| m.addImport("xitdb", x);
}
diff --git a/build.zig.zon b/build.zig.zon
index 09860fb1..c79bd483 100644
--- a/build.zig.zon
+++ b/build.zig.zon
@@ -197,6 +197,10 @@
.url = "https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz",
.hash = "N-V-__8AAPZ7fwBg4JoCzM_0o2A8wxH2hsUUeiU1iuZv53L5",
},
+ .xitdb = .{
+ .url = "https://github.com/xit-vcs/xitdb/archive/6b93af1af3a260399fa0a0b1b268ded2cbf5eec5.tar.gz",
+ .hash = "xitdb-0.0.0-EEFkxhwmBwDz1N8H9oHhVhd1Al5YZp8iDhaMLm2_79pS",
+ },
},
.minimum_zig_version = "0.17.0",
.paths = .{""},
diff --git a/docs/shared-libs.md b/docs/shared-libs.md
index 662579ea..fe6c5018 100644
--- a/docs/shared-libs.md
+++ b/docs/shared-libs.md
@@ -50,6 +50,7 @@ and gui columns are the two binaries.
| Parsing | tree-sitter | pardes | 1 → 1 | | `ts_set_allocator` → c_heap |
| Window, input, GPU | SDL 3.4.18 | gui | 1 → 1 | 1009 KiB | `SDL_SetMemoryFunctions` |
| Compress and decompress a far replica's stream (2026-10-30) | zstd 1.5.7 (the upstream tarball; build.zig compiles its lib/: no assembly, no threads, the dfast and lazy block compressors alone) | src/replica.zig | 0 → 1 | 380 KiB tty (516 with every block compressor) | `ZSTD_customMem` → c_heap |
+| On-disk databases: the state file (Recent, the dumps) and a far client's blob cache (2026-11-05) | xitdb (pure Zig, a pinned commit of github.com/xit-vcs/xitdb, MIT) | src/Db.zig | 0 → 1 | | Zig: it allocates through the allocators it is given (a database's buffer, a read's), so it has no hook of its own; no C |
Text section: tty 61,369,343 → 61,294,855 bytes (**−74,488**); gui
67,336,392 → 67,182,000 bytes (**−154,392**).