Files
aji/build.zig
T
dev d405d4ea50 Phase 2: I/O intrinsics, linear resources, deterministic profile (RFC 0007)
- air: resource types file<read|write|append>, listener, stream; io_error;
  intrinsic registry (19 intrinsics) synced with reference/intrinsics.md;
  fallible intrinsics as ok/err terminators; fs prefix narrowing;
  linear_aggregates gating
- verifier: intrinsic form, operand, result and capability-kind checks
  (E1001, E3201, E5002); intrinsic effects (E3101); resource linearity
  in the borrow walker with per-edge moves: E3002 leaks and join
  mismatches, E3001, E2001, E2002, E2101 for close while borrowed;
  resources as borrow roots
- interp: deterministic world (captured console, VFS, loopback TCP,
  instruction clock, pinned xoshiro256 PRNG), blocked outcome, run
  record with stdout/stderr/files
- CLI: --stdin, --vfs, --seed, --result-file, --profile (hosted: exit 3),
  exit code 7; runner: stdin/vfs/seed/stdout/stderr/file/blocked headers
- conformance: hello, file copy and TCP echo exit programs; 37 new tests;
  4000 mutants without a crash
2026-10-04 14:02:17 +03:00

69 lines
2.6 KiB
Zig

const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// Library: verifier, AIR, interpreter. Everything the TCB contains lives here.
const mod = b.addModule("aji", .{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
});
// The error-code registry in docs/ is the source of truth; a test keeps
// src/diag.zig in sync with it.
mod.addAnonymousImport("error_codes_md", .{
.root_source_file = b.path("docs/reference/error-codes.md"),
});
mod.addAnonymousImport("air_features_md", .{
.root_source_file = b.path("docs/reference/air-features.md"),
});
mod.addAnonymousImport("effects_md", .{
.root_source_file = b.path("docs/reference/effects.md"),
});
mod.addAnonymousImport("capabilities_md", .{
.root_source_file = b.path("docs/reference/capabilities.md"),
});
mod.addAnonymousImport("intrinsics_md", .{
.root_source_file = b.path("docs/reference/intrinsics.md"),
});
// CLI: `aji`.
const exe = b.addExecutable(.{
.name = "aji",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
.imports = &.{.{ .name = "aji", .module = mod }},
}),
});
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
run_cmd.addPassthruArgs();
b.step("run", "Run the aji CLI").dependOn(&run_cmd.step);
// Unit tests.
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = mod })).step);
test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = exe.root_module })).step);
// Conformance suite runner (tests/conformance).
const conformance = b.addExecutable(.{
.name = "aji-conformance",
.root_module = b.createModule(.{
.root_source_file = b.path("tools/conformance.zig"),
.target = target,
.optimize = optimize,
.imports = &.{.{ .name = "aji", .module = mod }},
}),
});
const run_conformance = b.addRunArtifact(conformance);
run_conformance.addArg("tests/conformance");
run_conformance.addPassthruArgs();
b.step("conformance", "Run the conformance suite").dependOn(&run_conformance.step);
test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = conformance.root_module })).step);
}