From 75fc6ca6fe161fbafb89fde1865e40d222d74397 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Tue, 11 Aug 2026 11:41:57 +0700 Subject: [PATCH 1/2] Analyse the whole public surface, not the part the tests happened to touch zig build test over this module proved only that the declarations it happened to reference compile. Zig analyses top-level declarations lazily, so everything else was never handed to the compiler -- and a consumer referencing any of it got errors this package's own green CI could not see. gHashTag/trinity#701 hit exactly that: vsa/core.zig expects HybridBigInt to carry an `allocator` field, and the golden-float version pinned here does not. CI here was green throughout. refAllDeclsRecursive forces the public surface through the compiler, which is the only version of "this package builds" that means anything to somebody outside it. It is expected to go RED, and that is the point: the defect existed before this commit and only the instrument changes. --- src/vsa.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/vsa.zig b/src/vsa.zig index 747da43..357ebb2 100644 --- a/src/vsa.zig +++ b/src/vsa.zig @@ -144,3 +144,17 @@ test { } // φ² + 1/φ² = 3 | TRINITY + +test "every public declaration of this module is analysed" { + // Zig analyses top-level declarations lazily, so `zig build test` over this + // file proved only that the declarations it happened to reference compile. + // A consumer referencing anything else got errors this package's own green + // CI could not see -- gHashTag/trinity#701 hit exactly that: vsa/core.zig + // expects HybridBigInt to carry an `allocator` field and the golden-float + // version pinned here does not. + // + // refAllDeclsRecursive forces the whole public surface through the + // compiler, which is the only version of "this package builds" that means + // anything to somebody outside it. + @import("std").testing.refAllDeclsRecursive(@This()); +} From bc6b1a057b63fe7f3f65a80d0c03015775e338b4 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Tue, 11 Aug 2026 13:15:38 +0700 Subject: [PATCH 2/2] Re-pin golden_float now that its public surface compiles gHashTag/zig-golden-float#97 repaired sixteen defects across that package, including the two this one tripped over: HybridBigInt without an allocator field, and the u32/i32 mismatch. Both originated there. --- build.zig.zon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig.zon b/build.zig.zon index 23d425b..b109ac5 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -7,7 +7,7 @@ .dependencies = .{ .zig_golden_float = .{ .url = "https://github.com/gHashTag/zig-golden-float/archive/main.tar.gz", - .hash = "golden_float-2.1.0-h7LKhQ3lCgBfkjryIT9MnOTWleMQrdrgOIxQOhxqzTVu", + .hash = "golden_float-2.1.0-h7LKhZMGCwBW0FS_zsli6CWxs9d5pElRE1pFFiy3WRSD", }, }, }