Skip to content

Commit 445b417

Browse files
gHashTagclaude
andcommitted
chore: Zig 0.15.x compatibility + cleanup
- Updated build.zig for Zig 0.15.x API (createModule, addLibrary) - Added B2T CLI to build_zig15.zig - Updated b2t_loader.zig (ArrayListUnmanaged) - Added releases/, debug_test.zig to .gitignore 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent be9a088 commit 445b417

5 files changed

Lines changed: 179 additions & 142 deletions

File tree

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,12 @@ vite.svg
141141

142142
# Vibee client (separate project)
143143
vibee-client/
144+
145+
# Releases (use GitHub Releases for binaries)
146+
releases/
147+
148+
# Temp test files
149+
debug_test.zig
150+
151+
# Old build files
152+
build_zig13_old.zig

build.zig

Lines changed: 97 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,38 @@
11
const std = @import("std");
22

3+
// Build file for Zig 0.15.x
4+
// For Zig 0.13.x use build.zig
5+
36
pub fn build(b: *std.Build) void {
47
const target = b.standardTargetOptions(.{});
58
const optimize = b.standardOptimizeOption(.{});
69

7-
// Library module
8-
const trinity_mod = b.addModule("trinity", .{
10+
// Library module for imports
11+
const trinity_mod = b.createModule(.{
912
.root_source_file = b.path("src/trinity.zig"),
1013
.target = target,
1114
.optimize = optimize,
1215
});
1316

1417
// Library artifact
15-
const lib = b.addStaticLibrary(.{
18+
const lib = b.addLibrary(.{
1619
.name = "trinity",
17-
.root_source_file = b.path("src/trinity.zig"),
18-
.target = target,
19-
.optimize = optimize,
20+
.linkage = .static,
21+
.root_module = b.createModule(.{
22+
.root_source_file = b.path("src/trinity.zig"),
23+
.target = target,
24+
.optimize = optimize,
25+
}),
2026
});
2127
b.installArtifact(lib);
2228

2329
// Tests
2430
const main_tests = b.addTest(.{
25-
.root_source_file = b.path("src/trinity.zig"),
26-
.target = target,
27-
.optimize = optimize,
31+
.root_module = b.createModule(.{
32+
.root_source_file = b.path("src/trinity.zig"),
33+
.target = target,
34+
.optimize = optimize,
35+
}),
2836
});
2937

3038
const run_main_tests = b.addRunArtifact(main_tests);
@@ -33,28 +41,34 @@ pub fn build(b: *std.Build) void {
3341

3442
// VSA tests
3543
const vsa_tests = b.addTest(.{
36-
.root_source_file = b.path("src/vsa.zig"),
37-
.target = target,
38-
.optimize = optimize,
44+
.root_module = b.createModule(.{
45+
.root_source_file = b.path("src/vsa.zig"),
46+
.target = target,
47+
.optimize = optimize,
48+
}),
3949
});
4050
const run_vsa_tests = b.addRunArtifact(vsa_tests);
4151
test_step.dependOn(&run_vsa_tests.step);
4252

4353
// VM tests
4454
const vm_tests = b.addTest(.{
45-
.root_source_file = b.path("src/vm.zig"),
46-
.target = target,
47-
.optimize = optimize,
55+
.root_module = b.createModule(.{
56+
.root_source_file = b.path("src/vm.zig"),
57+
.target = target,
58+
.optimize = optimize,
59+
}),
4860
});
4961
const run_vm_tests = b.addRunArtifact(vm_tests);
5062
test_step.dependOn(&run_vm_tests.step);
5163

5264
// Benchmark executable
5365
const bench = b.addExecutable(.{
5466
.name = "trinity-bench",
55-
.root_source_file = b.path("src/vsa.zig"),
56-
.target = target,
57-
.optimize = .ReleaseFast,
67+
.root_module = b.createModule(.{
68+
.root_source_file = b.path("src/vsa.zig"),
69+
.target = target,
70+
.optimize = .ReleaseFast,
71+
}),
5872
});
5973
b.installArtifact(bench);
6074

@@ -65,29 +79,35 @@ pub fn build(b: *std.Build) void {
6579
// Examples
6680
const example_memory = b.addExecutable(.{
6781
.name = "example-memory",
68-
.root_source_file = b.path("examples/memory.zig"),
69-
.target = target,
70-
.optimize = optimize,
82+
.root_module = b.createModule(.{
83+
.root_source_file = b.path("examples/memory.zig"),
84+
.target = target,
85+
.optimize = optimize,
86+
.imports = &.{.{ .name = "trinity", .module = trinity_mod }},
87+
}),
7188
});
72-
example_memory.root_module.addImport("trinity", trinity_mod);
7389
b.installArtifact(example_memory);
7490

7591
const example_sequence = b.addExecutable(.{
7692
.name = "example-sequence",
77-
.root_source_file = b.path("examples/sequence.zig"),
78-
.target = target,
79-
.optimize = optimize,
93+
.root_module = b.createModule(.{
94+
.root_source_file = b.path("examples/sequence.zig"),
95+
.target = target,
96+
.optimize = optimize,
97+
.imports = &.{.{ .name = "trinity", .module = trinity_mod }},
98+
}),
8099
});
81-
example_sequence.root_module.addImport("trinity", trinity_mod);
82100
b.installArtifact(example_sequence);
83101

84102
const example_vm = b.addExecutable(.{
85103
.name = "example-vm",
86-
.root_source_file = b.path("examples/vm.zig"),
87-
.target = target,
88-
.optimize = optimize,
104+
.root_module = b.createModule(.{
105+
.root_source_file = b.path("examples/vm.zig"),
106+
.target = target,
107+
.optimize = optimize,
108+
.imports = &.{.{ .name = "trinity", .module = trinity_mod }},
109+
}),
89110
});
90-
example_vm.root_module.addImport("trinity", trinity_mod);
91111
b.installArtifact(example_vm);
92112

93113
// Run examples step
@@ -103,9 +123,11 @@ pub fn build(b: *std.Build) void {
103123
// Firebird CLI
104124
const firebird = b.addExecutable(.{
105125
.name = "firebird",
106-
.root_source_file = b.path("src/firebird/cli.zig"),
107-
.target = target,
108-
.optimize = .ReleaseFast,
126+
.root_module = b.createModule(.{
127+
.root_source_file = b.path("src/firebird/cli.zig"),
128+
.target = target,
129+
.optimize = .ReleaseFast,
130+
}),
109131
});
110132
b.installArtifact(firebird);
111133

@@ -116,54 +138,47 @@ pub fn build(b: *std.Build) void {
116138
const firebird_step = b.step("firebird", "Run Firebird CLI");
117139
firebird_step.dependOn(&run_firebird.step);
118140

119-
// IGLA GloVe - Production semantic reasoning
120-
const igla_glove = b.addExecutable(.{
121-
.name = "igla-glove",
122-
.root_source_file = b.path("src/vibeec/igla_glove.zig"),
123-
.target = target,
124-
.optimize = .ReleaseFast,
125-
});
126-
b.installArtifact(igla_glove);
127-
128-
const run_igla_glove = b.addRunArtifact(igla_glove);
129-
const igla_step = b.step("igla-glove", "Run IGLA GloVe semantic engine");
130-
igla_step.dependOn(&run_igla_glove.step);
131-
132141
// Firebird tests
133142
const firebird_tests = b.addTest(.{
134-
.root_source_file = b.path("src/firebird/b2t_integration.zig"),
135-
.target = target,
136-
.optimize = optimize,
143+
.root_module = b.createModule(.{
144+
.root_source_file = b.path("src/firebird/b2t_integration.zig"),
145+
.target = target,
146+
.optimize = optimize,
147+
}),
137148
});
138149
const run_firebird_tests = b.addRunArtifact(firebird_tests);
139150
test_step.dependOn(&run_firebird_tests.step);
140151

141152
// WASM parser tests
142153
const wasm_tests = b.addTest(.{
143-
.root_source_file = b.path("src/firebird/wasm_parser.zig"),
144-
.target = target,
145-
.optimize = optimize,
154+
.root_module = b.createModule(.{
155+
.root_source_file = b.path("src/firebird/wasm_parser.zig"),
156+
.target = target,
157+
.optimize = optimize,
158+
}),
146159
});
147160
const run_wasm_tests = b.addRunArtifact(wasm_tests);
148161
test_step.dependOn(&run_wasm_tests.step);
149162

150163
// Cross-platform release builds
151164
const release_step = b.step("release", "Build release binaries for all platforms");
152165

153-
const targets: []const std.Target.Query = &.{
166+
const targets_list: []const std.Target.Query = &.{
154167
.{ .cpu_arch = .x86_64, .os_tag = .linux },
155168
.{ .cpu_arch = .x86_64, .os_tag = .macos },
156169
.{ .cpu_arch = .aarch64, .os_tag = .macos },
157170
.{ .cpu_arch = .x86_64, .os_tag = .windows },
158171
};
159172

160-
for (targets) |t| {
173+
for (targets_list) |t| {
161174
const release_target = b.resolveTargetQuery(t);
162175
const release_exe = b.addExecutable(.{
163176
.name = "firebird",
164-
.root_source_file = b.path("src/firebird/cli.zig"),
165-
.target = release_target,
166-
.optimize = .ReleaseFast,
177+
.root_module = b.createModule(.{
178+
.root_source_file = b.path("src/firebird/cli.zig"),
179+
.target = release_target,
180+
.optimize = .ReleaseFast,
181+
}),
167182
});
168183

169184
const target_output = b.addInstallArtifact(release_exe, .{
@@ -182,47 +197,41 @@ pub fn build(b: *std.Build) void {
182197

183198
// Extension WASM tests
184199
const extension_tests = b.addTest(.{
185-
.root_source_file = b.path("src/firebird/extension_wasm.zig"),
186-
.target = target,
187-
.optimize = optimize,
200+
.root_module = b.createModule(.{
201+
.root_source_file = b.path("src/firebird/extension_wasm.zig"),
202+
.target = target,
203+
.optimize = optimize,
204+
}),
188205
});
189206
const run_extension_tests = b.addRunArtifact(extension_tests);
190207
test_step.dependOn(&run_extension_tests.step);
191208

192209
// DePIN tests
193210
const depin_tests = b.addTest(.{
194-
.root_source_file = b.path("src/firebird/depin.zig"),
195-
.target = target,
196-
.optimize = optimize,
211+
.root_module = b.createModule(.{
212+
.root_source_file = b.path("src/firebird/depin.zig"),
213+
.target = target,
214+
.optimize = optimize,
215+
}),
197216
});
198217
const run_depin_tests = b.addRunArtifact(depin_tests);
199218
test_step.dependOn(&run_depin_tests.step);
200219

201-
// IGLA Metal SWE - GPU accelerated semantic agent
202-
const igla_metal_swe = b.addExecutable(.{
203-
.name = "igla-metal-swe",
204-
.root_source_file = b.path("src/vibeec/igla_metal_swe.zig"),
205-
.target = target,
206-
.optimize = .ReleaseFast,
207-
});
208-
// Link Accelerate framework on macOS
209-
igla_metal_swe.linkFramework("Accelerate");
210-
b.installArtifact(igla_metal_swe);
211-
212-
const run_igla_metal = b.addRunArtifact(igla_metal_swe);
213-
const igla_metal_step = b.step("igla-metal", "Run IGLA Metal SWE agent");
214-
igla_metal_step.dependOn(&run_igla_metal.step);
215-
216-
// IGLA Semantic Optimized
217-
const igla_opt = b.addExecutable(.{
218-
.name = "igla-opt",
219-
.root_source_file = b.path("src/vibeec/igla_semantic_opt.zig"),
220-
.target = target,
221-
.optimize = .ReleaseFast,
220+
// B2T CLI
221+
const b2t = b.addExecutable(.{
222+
.name = "b2t",
223+
.root_module = b.createModule(.{
224+
.root_source_file = b.path("src/b2t/b2t_cli.zig"),
225+
.target = target,
226+
.optimize = optimize,
227+
}),
222228
});
223-
b.installArtifact(igla_opt);
229+
b.installArtifact(b2t);
224230

225-
const run_igla_opt = b.addRunArtifact(igla_opt);
226-
const igla_opt_step = b.step("igla-opt", "Run IGLA optimized semantic engine");
227-
igla_opt_step.dependOn(&run_igla_opt.step);
231+
const run_b2t = b.addRunArtifact(b2t);
232+
if (b.args) |args| {
233+
run_b2t.addArgs(args);
234+
}
235+
const b2t_step = b.step("b2t", "Run B2T CLI");
236+
b2t_step.dependOn(&run_b2t.step);
228237
}

build_zig15.zig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,22 @@ pub fn build(b: *std.Build) void {
216216
});
217217
const run_depin_tests = b.addRunArtifact(depin_tests);
218218
test_step.dependOn(&run_depin_tests.step);
219+
220+
// B2T CLI
221+
const b2t = b.addExecutable(.{
222+
.name = "b2t",
223+
.root_module = b.createModule(.{
224+
.root_source_file = b.path("src/b2t/b2t_cli.zig"),
225+
.target = target,
226+
.optimize = optimize,
227+
}),
228+
});
229+
b.installArtifact(b2t);
230+
231+
const run_b2t = b.addRunArtifact(b2t);
232+
if (b.args) |args| {
233+
run_b2t.addArgs(args);
234+
}
235+
const b2t_step = b.step("b2t", "Run B2T CLI");
236+
b2t_step.dependOn(&run_b2t.step);
219237
}

0 commit comments

Comments
 (0)