New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't stop compilation if compileLog is used #5469
Comments
Note: when #5348 will merged this issue will have a special meaning. |
I think having it fail compilation by default is good since it then encourages library developers, etc to keep |
compileLog erroring and the lack of warnings are both deliberate design decisions. If something isn't enough of a priority to warrant an error, it should not be printed out IMO. |
Another proposals:
|
I don't think separating the As others have mentioned, Zig is choosing to avoid a concept of "warning", and instead encourage libraries to make bad uses illegal. (I think it's unlikely you can detect most bad uses at In addition, it could get noisy. Some libraries may more liberally use some log levels, and you probably don't care about most of them when you're "raising" the level of logs printed. I do think there are times when there are "interesting" logs that don't indicate a problem that you might still sometimes want to inspect, perhaps when something is behaving strangely or you're trying to figure out all of the ways a Perhaps something like this:
On the other hand, using a tag might be a mistake, since it might encourage everyone to just use a tag called It might also be interesting to allow And perhaps like the existing |
Another important benefit is that the current behavior enables incremental compilation. A major drawback of incremental compilation in other languages is that you don't see warnings for compilation units that don't get recompiled. Since Zig's unit of incremental compilation is a declaration, it's important that we don't have this problem. We solve it by not having warnings, so either something is printed and compilation fails or compilation succeeds and nothing is printed. This behavior has to extend to compileLog as well, in order to see this benefit. |
The explanation step by step:
The important benefit is that |
|
fn func() void { Compile Log Output:
|
That's the same behavior as stage1, just a different format:
This proposal is to (imo, optionally) make it possible to stop the |
|
@compileLog
is a very useful auxiliary function and I wonder why the compilation should stop.The text was updated successfully, but these errors were encountered: