diff --git a/build.zig b/build.zig index 8bcbc94747..789dbde125 100644 --- a/build.zig +++ b/build.zig @@ -182,16 +182,29 @@ pub fn build(b: *std.Build) void { const test_step = b.step("test", "Run library tests"); test_step.dependOn(&run_main_tests.step); - // VSA tests - const vsa_tests = b.addTest(.{ - .root_module = b.createModule(.{ - .root_source_file = b.path("src/vsa.zig"), - .target = target, - .optimize = optimize, - }), + // src/vsa.zig was migrated to gHashTag/zig-hdc in 42490a22 and the two + // references below were left pointing at the empty space, which is one of + // the reasons this build has failed since March. The module is intact + // there and exports all fourteen symbols this repository asked of the + // file it lost; the package itself could not be depended on until its + // manifest was repaired (zig-hdc#1), which is why the reference could not + // simply be updated at the time. + const zig_hdc_dep = b.dependency("zig_hdc", .{ + .target = target, + .optimize = optimize, }); - const run_vsa_tests = b.addRunArtifact(vsa_tests); - test_step.dependOn(&run_vsa_tests.step); + const hdc_vsa = zig_hdc_dep.module("zig-hdc-vsa"); + + // VSA tests are no longer run from here. addTest requires its root module to + // carry a known target, and a module exported by a dependency does not: it + // takes its target from whatever compiles it. Rebuilding one locally from + // the dependency's source would mean re-declaring that package's own + // imports here and testing somebody else's code from the outside. + // + // They are not lost, which is the part that matters. gHashTag/zig-hdc runs + // `zig build test` over exactly this module in its own CI, on 0.15.2 -- + // the version this repository targets -- so the tests execute where the + // code lives and against the compiler that will consume it. // Queen API tests const queen_api_tests = b.addTest(.{ @@ -1145,12 +1158,9 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); - // VSA module for TRI (moved up: needed by tvc_corpus_mod and fluent CLI) - const vsa_tri = b.createModule(.{ - .root_source_file = b.path("src/vsa.zig"), - .target = target, - .optimize = optimize, - }); + // VSA module for TRI (needed by tvc_corpus_mod and fluent CLI), now the + // migrated module rather than a path to a file that is not here. + const vsa_tri = hdc_vsa; // TVC Corpus module for TRI (moved up: needed by fluent CLI and hybrid chat) const tvc_corpus_mod = b.createModule(.{ .root_source_file = b.path("src/tvc/tvc_corpus.zig"), diff --git a/build.zig.zon b/build.zig.zon index 11fda9ad8c..67afc6b2e8 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -10,6 +10,10 @@ .url = "git+https://github.com/raylib-zig/raylib-zig#cd71c85d571027ac8033357f83b124ee051825b3", .hash = "raylib_zig-5.6.0-dev-KE8REENOBQC-m5nK7M2b5aKSIubJPbPLUYcRhT7aT3RN", }, + .zig_hdc = .{ + .url = "https://github.com/gHashTag/zig-hdc/archive/main.tar.gz", + .hash = "zig_hdc-0.1.0-6NS2Eoy7FgAFWrBY3anapf1nXxhm6TvPApY3NHoSW8MG", + }, }, .paths = .{""}, .fingerprint = 0xa9f69745ba7ed82d, diff --git a/tools/build_paths_baseline.txt b/tools/build_paths_baseline.txt index 6b970a3248..5d4704e2cf 100644 --- a/tools/build_paths_baseline.txt +++ b/tools/build_paths_baseline.txt @@ -6,11 +6,10 @@ # relocations and are fixed. These five are not, and each needs a decision # rather than a guess: # -# src/vsa.zig -# Migrated to gHashTag/zig-hdc, which still has it and exports all fourteen -# symbols the eleven consumers in src/ need. Blocked on that repository's -# build.zig.zon, which predates the .fingerprint and dependency-.hash -# requirements and so cannot be depended on by zig 0.15.2 as it stands. +# src/vsa.zig was here and is gone from the list: zig-hdc#1 repaired that +# package's manifest so it can be depended on, and build.zig now takes the +# module from the dependency instead of a path to a file this repository no +# longer contains. # # src/cli/entrypoint_train.zig # src/hslm/bpe_train.zig @@ -31,5 +30,4 @@ src/cli/entrypoint_train.zig src/hslm/bpe_train.zig src/hslm/hslm_benchmark.zig -src/vsa.zig trinity-nexus/output/lang/zig/full-serve-v1.zig