zigzap / zap

blazingly fast backends in zig
MIT License
1.98k stars 71 forks source link

Provide Windows error message #75

Closed Froxcey closed 4 months ago

Froxcey commented 5 months ago

Yes, it is already in README. I just thought it would be nice if the build system explicitly fails Windows builds.

Test package available [here].

Just 2 LOC, thanks to Zig's beautiful build system.

Just wanna mention #74

vibe
Froxcey commented 4 months ago

Sorry, I was kind of on a vacation. Anyways, it should be good now

Example
Froxcey commented 4 months ago

Btw I saw your talk on Showtime, and I just want to say it's awesome :D

Froxcey commented 4 months ago

Should @panic or std.log.err message be used?

The difference lies in that @panic gives a stack trace pointing to where @panic is invoked, whereas std.log.err + std.os.exit seems cleaner. Here are the screenshots:

@panic:

Version one

std.log.err + std.os.exit:

Version two

I personally prefer std.log.err + std.os.exit because the stack trace is not really adding any useful information to the already self-explanatory error message. I will convert this to a Draft PR temporarily to prevent an accidental merge.

Froxcey commented 4 months ago

I just committed the version with less chunky error message