I think the issue here is that a nonzero exit status can either mean
"this haredo invocation shouldn't cause anything to be rebuilt" or "this
haredo invocation errored out". Not really sure what the right way to
distinguish between the two is.
[2023-02-03 18:20:04+0000] Ember Sawady:
>I think the issue here is that a nonzero exit status can either mean>"this haredo invocation shouldn't cause anything to be rebuilt" or "this>haredo invocation errored out". Not really sure what the right way to>distinguish between the two is.
That seems quite weird… at least coming with a make(1) mindset/bias I feel
like it should be done like so:
- 0 means success / done / no need to rebuild
- !0 means failure / could be rebuilt
Should be noted that make(1) can make use of child processes, including itself.
> I think the issue here is that a nonzero exit status can either mean> "this haredo invocation shouldn't cause anything to be rebuilt" or "this> haredo invocation errored out". Not really sure what the right way to> distinguish between the two is.
Yeah ecs you're right but i've just had a thought -- we could try using
status codes like normal for "should/shouldn't be rebuilt" but try using
*signals* for errors in scripts?
I only have a vague understanding of this but the hare stdlib lets you
distinguish between a signal and an exit code of a child process.
> That seems quite weird… at least coming with a make(1) mindset/bias I> feel like it should be done like so:> - 0 means success / done / no need to rebuild> - !0 means failure / could be rebuilt
The reason that success = rebuild is so that you can just write e.g.
if haredo targets...
then
# build
fi
which is seems simpler and marginally more intuitive to me than negating
it. But yeah you're right that the cluttering of "did this succeed" with
"does this need rebuilding" is a genuine shortcoming of haredo (at the
moment).
This is now fixed in Haredo 1.0.2.
The specific new behavior is that haredo will return an error code if
any of its descendant .do scripts fails. Thank Ember for the patch :)
~Autumn