www.ziglang.org
www.ziglang.org copied to clipboard
`zig init-exe` is deprecated
Related to:
- https://github.com/ziglang/zig/pull/18103
- https://github.com/ziglang/zig/issues/18101
I was going through the install / hello world tutorial today and saw that it recommends the use of zig init-exe
which seems to be deprecated:
https://github.com/ziglang/www.ziglang.org/blob/da27179eacd8c87b86ca7a191ded9e382d5b586f/content/learn/getting-started.en.md?plain=1#L120-L125
Just using zig init
worked just fine.
I'd be happy to tackle this if need be! Thanks!!
Interesting! The issue I have is the opposite! The latest stable release version as of today is 0.11, and I installed it through my OS package manager (pacman, on Arch Linux). And in this version, zig init
is an unknown command:
error: unknown command: init
But, the commands init-exe
and init-lib
do exist, and running the former does work:
❯ zig init-exe
info: Created build.zig
info: Created src/main.zig
info: Next, try `zig build --help` or `zig build run`
Which matches the version of the docs you linked to! But, the current master
has the docs: https://github.com/ziglang/www.ziglang.org/blob/b66e89a9750968aa92c330b2de4e920828aa6dfa/content/learn/getting-started.en.md#L116-L134
Which makes me think that the docs have been updated to some newer version (e.g 0.12) that isn't stable yet, and can result in confusing behaviour for new users :sweat_smile:
this issue still persists in 0.12 init works. It would be nice to get a deprecation notice
I'm curious what the reason was to merge init-exe
and init-lib
?
Couldn't find anything so far 😇
I'm curious what the reason was to merge
init-exe
andinit-lib
? Couldn't find anything so far 😇
- https://github.com/ziglang/zig/pull/18055