Closed stephenafamo closed 5 months ago
This is the only similar issue I could find https://github.com/ziglang/zig/issues/18282
Hey there @stephenafamo , could you share us your code? Any repo we could help with?
The readme was slightly out of date, i updated it earlier and successfully built something with it, following the instructions, though i haven't tried on the latest zig.
So, I tried to recreate it on a fresh project created with zig init
with the current nightly, and I got a different error
❯ zig build --help
/Users/stephen/.cache/zig/p/12203b87a1274a0041a0aca82c2306035b7a4129bddc6a0ae86f9d942787f898530b/build.zig:233:31: error: no field named 'zig_exe' in struct 'Build'
try argv.append(b.zig_exe);
^~~~~~~
/Users/stephen/.local/bin/zig/lib/std/Build.zig:1:1: note: struct declared here
const std = @import("std.zig");
^~~~~
referenced by:
create: /Users/stephen/.cache/zig/p/12203b87a1274a0041a0aca82c2306035b7a4129bddc6a0ae86f9d942787f898530b/build.zig:171:27
build: /Users/stephen/.cache/zig/p/12203b87a1274a0041a0aca82c2306035b7a4129bddc6a0ae86f9d942787f898530b/build.zig:127:46
remaining reference traces hidden; use '-freference-trace' to see all reference traces
For this error I know the fix (since I cloned the package locally in my original project).
This line should be changed to:
try argv.append(b.graph.zig_exe);
So, I tried to recreate it on a fresh project created with
zig init
with the current nightly, and I got a different error❯ zig build --help /Users/stephen/.cache/zig/p/12203b87a1274a0041a0aca82c2306035b7a4129bddc6a0ae86f9d942787f898530b/build.zig:233:31: error: no field named 'zig_exe' in struct 'Build' try argv.append(b.zig_exe); ^~~~~~~ /Users/stephen/.local/bin/zig/lib/std/Build.zig:1:1: note: struct declared here const std = @import("std.zig"); ^~~~~ referenced by: create: /Users/stephen/.cache/zig/p/12203b87a1274a0041a0aca82c2306035b7a4129bddc6a0ae86f9d942787f898530b/build.zig:171:27 build: /Users/stephen/.cache/zig/p/12203b87a1274a0041a0aca82c2306035b7a4129bddc6a0ae86f9d942787f898530b/build.zig:127:46 remaining reference traces hidden; use '-freference-trace' to see all reference traces
For this error I know the fix (since I cloned the package locally in my original project). This line should be changed to:
try argv.append(b.graph.zig_exe);
Ok, i checked on latest zig and indeed, the line you mentioned needed to be changed. Thanks!
Latest master should properly be usable now. Can I count on you to check on your side and close the issue if everything's fine?
Thanks again.
Yes. I can confirm, everything works now.
Small quirk I encountered about zon
. When upgrading a package to a new commit, if the hash is cached, the old commit will still be used even the dependency's URL was updated.
Hello, sabe problem here with zig 0.12.0-dev.3161+377ecc6af
. It can't find protobuf
module and also complains that the project does not have a build.zig.zon
file so zig fetch --save
does not work.
Trying to follow the instructions in the README, but I zig seems unable to find the module.
I have tried with both
zig v0.11.0
and0.12.0-dev.2587+a1b607acb