How to run langref generation

Today I tried to generate the Zig Language Reference, and I assumed the right thing to do was:

zig build -Dno-bin -Dno-lib

Unfortunately, -Dno-lib disabled running the doc generation process.
Personally, I think this behavior it’s not intuitive.
Is there a reason for it? If the behavior is really incorrect, then the langref step can probably be removed.

Thanks.

I’m not following, if you run zig build langref you will get the langref. Without the langref subcommand you will build an entire copy of the compiler, not just the langref, at which point it makes sense to not generate the langref if -Dno-lib was passed.

If you’re developing the langref, you will want to (if necessary) build the compiler once, and then after that always just build the langref by itself using the relative subcommand.

2 Likes

The fact is that with -Dno-bin -Dno-lib, the compiler will not build the compiler and std. Since langref is generated by default, the actual generated artifact should be the language reference.

Here is a post about how to build the langref (I hope its still accurate)

Thanks, but I was only curious about why -Dno-lib does not trigger the generation of the language reference.