hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.6K
active users

Jordan Sissel

Debugging a makefile, as one does..

turns out...

zip(1) exits with code 12 if it "has nothing to do"

mother fucker we have a code for that already it's called zero. There's *got* to be a history here and I wanna know it.

@whack bazel has some formatting tools which exit with code 3 when this occurs and google is a terrible company as usual

@whack fwiw i'm kind of sympathetic to this idea in general but it should not be the default and there should be a flag to enable more informative error codes to avoid breaking builds based on reasonable assumptions

@hipsterelectron +1 to structured output. I don’t love trying to compress all possible communications into a small integer

@whack i have a whole thesis on this topic but i just woke up

@hipsterelectron was it possibly about how we went from integer error types in C to mostly-strings error types in Go and seemingly learned nothing in the past 50 years 🥲

@whack oh it was about how to eventually work towards a framework for structured output for shell commands without going the powershell/nushell approach and simply rewriting all the commands yourself where the structure only works if you use the enclosed shell ecosystem. standardized schemas for json input/output corresponding to the cli are both normal to want and possible to achieve

@whack you could argue that string errors are a step down from numerics as those are at least introspectable according to a defined schema

@whack that's a bit of a made-up argument to be clear

@whack http 200, check json payload for errors

lol

@whack I mean, I can instantly construct the scenario that leads to this … and I can also think three seconds further to scream, “Why, God, Why?!??”

@whack@hachyderm.io I sympathize. I had to debug the same issue before at a previous job; build scripts breaking because zip return codes. I don't remember how I ended up handling them. Might have wrapped zip in a shell script that checked for last $? exit code or something, not sure, it was a long time ago.

@rozenglass Always weird finding surprising software behavior; I check the exit code and move on - `x=$?; [ "$x" -eq 0 -o "$x" -eq 12 ] || exit $x` -