What is the replacement for --prominent-compile-errors in 0.16.0

Hello,

In my 0.15.2 scripts I used prominent-compile-errors so that compile errors are the bottom of the terminal so i dont have to scroll up too far. I see in master this option has been removed. Is it replaced by anything else?

1 Like

If you look at output of zig build --help you’ll see new flag which supports bunch of options which can replace prominent-compile-errors

  --error-style [style]        Control how build errors are printed
    verbose                    (Default) Report errors with full context
    minimal                    Report errors after summary, excluding context like command lines
    verbose_clear              Like 'verbose', but clear the terminal at the start of each update
    minimal_clear              Like 'minimal', but clear the terminal at the start of each update

Set it to minimal/minimal_clear and it won’t print long invocation argument.

You can also change it using environment variables. Like this:
ZIG_BUILD_ERROR_STYLE=minimal

3 Likes

Only recently found out about it: #std > configure phase / make phase separation @ :speech_balloon:
It is definitely pretty hidden feature right now.

the *_clear will clear the terminal screen, though it seems they only do so under --watch, which is the point of them any way.

just clarifying so if they dont want that they can just use then non _clear variants.

I am trying--minimal but I still need to scroll up a bit to see the compile errors with or without clearing the screen

It should be --error-style minimal not just --minimal.

Yes, I was typing from memory. still doesn’t do what I want.

So I played around with some flags and this is almost perfect (note the whole thing is in a justfile). also for whatever reason -fno-reference-trace just didnt work.

run *args:
	zig build run \
		--error-style minimal \
		-freference-trace=0 \
		--summary none \
		-- {{args}}
2 Likes

By the way, this is covered in the 0.16.0 release notes: 0.16.0 Release Notes ⚡ The Zig Programming Language

As a general tip, if something you were using goes away in a Zig release, try Ctrl-F searching for that thing in the release notes. We do our best in all the release notes to specifically mention issues you might hit while upgrading and how to solve them.

(If you use this flag most or all of the time, I highly recommend using the ZIG_BUILD_ERROR_STYLE environment variable to specify your “default”: I’ve been finding it super convenient!)

2 Likes