Repository navigation
src/root.zig: imports were written from the repo root, not from the file - #95
Merged
Merged
Conversation
Every consumer of this package gets src/root.zig as the module root, and it imported "src/formats/gf_binary.zig" and twelve siblings. Zig resolves a relative import against the importing FILE's directory, and root.zig is already inside src/, so each of those asked for src/src/... Thirteen files, all of them present exactly one level above where the import looked. The effect is that @import("golden-float") could not compile for anybody outside this repository. It surfaced when zig-hdc tried to depend on it and the build stopped in .zig-cache/p/golden_float-2.1.0/src/src/formats/gf_binary.zig: FileNotFound -- a path with the doubling visible in it. Found by a checker written for exactly this class after the same mistake cost another repository four months of red CI: gHashTag/trinity tools/check_build_paths.py. Pointed here, it named all thirteen in a second. Twelve unresolvable imports remain under src/vm/ and src/vsa/, none of them reachable from this module root, so they do not affect consumers and are not touched here.
gHashTag
added a commit
to gHashTag/zig-hdc
that referenced
this pull request
Aug 11, 2026
The hash pins a tarball of main, and main moved: gHashTag/zig-golden-float#95 fixed thirteen imports in src/root.zig that were written from the repository root rather than from the file, so every consumer of that package was fetching a module root that could not compile.
gHashTag
added a commit
to gHashTag/zig-hdc
that referenced
this pull request
Aug 11, 2026
* Make this package possible to depend on, and prove it in CI
Nothing could consume zig-hdc, and nothing said so. Four separate faults, any
one of them fatal to a consumer:
* build.zig.zon opened with { instead of .{
* .name = zig_hdc where an enum literal .zig_hdc is required
* no .fingerprint (0.15 refuses the package without one)
* the dependency carried a url and no .hash
and in build.zig, addTest was passed root_source_file, which stopped being a
field of TestOptions in 0.15 -- so the build script itself failed to compile.
The repository had no CI at all, which is why all five sat here indefinitely: a
library that reads as available and is not. Now it builds and tests on the
version its consumer targets, and the three exported module names are asserted,
because a rename here is invisible until somebody else's build breaks.
The consumer is gHashTag/trinity, whose build has been failing since March
partly because src/vsa.zig lives here now. Its eleven consumers need all
fourteen symbols this module exports and no local copy has them all.
* Re-pin golden_float now that its module root resolves
The hash pins a tarball of main, and main moved: gHashTag/zig-golden-float#95
fixed thirteen imports in src/root.zig that were written from the repository
root rather than from the file, so every consumer of that package was fetching
a module root that could not compile.
* Stop exporting a facade that has never compiled, and re-pin the dependency
src/vsa.zig exported vsa/agent.zig, which imports five files under
src/vsa/agent/ that have never been tracked here and do not exist in
gHashTag/trinity either -- the repository the rest of this package came from.
So the facade was never buildable by anybody, and exporting it from the module
root made the whole package unbuildable for every consumer.
The file stays. Unreferenced sources are not compiled, and whether the agent
layer should be finished or dropped is a decision about this library rather
than a way to turn a build green.
Dependency re-pinned after gHashTag/zig-golden-float#96, which repaired two
more imports pointing at files that repository does not contain.
* Withdraw the eleven re-exports that resolved through the dead facade
Every name resolved through vsa/agent.zig, whose five parts have never existed
in any repository, so none of these has ever been a symbol anybody could
reference.
* Withdraw the last four accessors and the test root that dragged the facade back
vsa/tests.zig imports agent.zig for four types, so including it pulled the dead
facade back into the compilation and took the package with it. Those tests have
never run -- the files they exercise do not exist -- so nothing that worked
stops working.
gHashTag
added a commit
to gHashTag/zig-half
that referenced
this pull request
Aug 11, 2026
…ectory Same shape as gHashTag/zig-golden-float#95, and the same shape as root.zig: a file inside src/ writing @import("src/simd_config.zig") asks for src/src/simd_config.zig. The target is one level above where the import looked.
gHashTag
added a commit
to gHashTag/zig-half
that referenced
this pull request
Aug 11, 2026
* Give this package a workflow that builds it
Nothing here has ever run zig build. That is the gap that hid sixteen defects in
gHashTag/zig-golden-float and five in gHashTag/zig-hdc: a package can look
maintained, be imported by name, and not compile for anybody, because nothing
ever asked it to.
Pinned to 0.15.2, the version the packages that would consume it are built with.
This commit does not claim the build passes -- it makes the answer visible.
* Rewrite a build script that had never compiled, and analyse the module root
build.zig declared pub fn test, and test is a keyword. It also assigned
b.standardTargetOptions without calling it, passed two arguments to
installArtifact, and read b.step as a field. None of that is a version
difference: it is a sketch shaped like a build script, and nothing here ever ran
it because no workflow built anything.
The manifest was equally unusable -- a string where 0.15 requires an enum
literal, and no fingerprint -- so this package could not be depended on by
anything either.
src/root.zig now has a test target and refAllDeclsRecursive. It is the surface a
consumer gets and it was the one surface never compiled.
* Add the fingerprint the compiler asked for
* The module root was written in Rust
src/root.zig re-exported everything as 'pub use module.{ A, B as C };'. Zig has
no use statement and no as aliasing, so this file -- the surface every consumer
imports -- has never been valid Zig, and this package has therefore never been
usable by anybody.
Five such blocks, now sixty-seven pub const declarations with the aliases
preserved exactly as they were spelled.
Nothing reported this in the lifetime of the repository, for the same reason
nothing reported the build script that declared 'pub fn test': there was no
workflow that built anything, so the question was never asked.
* Three more files imported from the repository root, not their own directory
Same shape as gHashTag/zig-golden-float#95, and the same shape as root.zig: a
file inside src/ writing @import("src/simd_config.zig") asks for
src/src/simd_config.zig. The target is one level above where the import looked.
* Six re-exports named things that do not exist, and one 0.14 API
The Rust-style blocks listed VEC_F32_SIZE, DEFAULT_SYNC_INTERVAL,
DEFAULT_QUANTIZE_THRESHOLD, TRIT_NEG, TRIT_ZERO and TRIT_POS. None of those is
exported by the module it was taken from. Nothing could ever have used them,
because the file naming them has never compiled -- so they are dropped rather
than invented.
simd_config used std.io.getStdOut, removed in 0.15. A File writer borrows a
buffer the caller owns, so the buffer lives at the call site now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every consumer gets
src/root.zigas the module root, and it imported"src/formats/gf_binary.zig"and twelve siblings. Zig resolves a relative import against the importing file's directory, androot.zigis already insidesrc/— so each asked forsrc/src/…. All thirteen files sit exactly one level above where the import looked.@import("golden-float")could not compile for anybody outside this repository.It surfaced when
zig-hdctried to depend on it:— the doubling is visible in the path.
Found by a checker written for exactly this class after the same mistake cost another repository four months of red CI (
gHashTag/trinity,tools/check_build_paths.py). Pointed here, it named all thirteen in a second.Twelve unresolvable imports remain under
src/vm/andsrc/vsa/, none reachable from this module root, so they do not affect consumers and are left alone.