on a clean folder, when using “zig build”
(zig version 0.12)
I get this error:
/root/.cache/zig/p/1220582ea45580eec6b16aa93d2a9404467db8bc1d911806d367513aa40f3817f84c/build.zig:14:16: error: no field named 'filter' in struct 'Build.Step.Compile'
unit_tests.filter = test_filter;
^~~~~~
/usr/local/bin/zig/lib/std/Build/Step/Compile.zig:1:1: note: struct declared here
const builtin = @import("builtin");
^~~~~
referenced by:
runBuild__anon_15309: /usr/local/bin/zig/lib/std/Build.zig:2079:27
dependencyInner__anon_14169: /usr/local/bin/zig/lib/std/Build.zig:2060:29
remaining reference traces hidden; use '-freference-trace' to see all reference traces
I have no idea if this is user error
or if the package is perpahs broken with zig 0.12
It would be great if you can check this package with me, if you can replicate the issue.
The error is saying that there is not member of the Compile struct called filter. There is a filters and it takes a slice of slices, but no filter member.
In fact, filter was deprecated at some point in the past:
/// deprecated: use `.filters = &.{filter}` instead of `.filter = filter`.
That line of code in your source can be corrected via:
unit_tests.filters = &.{ test_filter };
However, running through both the source at the repo (from both links), I’m not seeing anything of the sort there. I tried building on 13.0 which is what my local machine is on and it failed for a different reason, so I can’t help much here on the 12.0 hunt, but hopefully that gives someone something to start from.
I think @squeek502 or @castholm would be the best people to answer this given the git history.
The example code is using the version 0.0.8 of the library.
Library README says that version 0.0.9 corresponds to zig 0.12.0.
From the example directory, run: zig fetch --save https://github.com/speed2exe/myzql/archive/refs/tags/0.0.9.tar.gz this shall update build.zig.zon to use version 0.0.9