[Toybox] [PATCH] toysh: Shut up TEST_HOST, correct 3 test cases

Rob Landley rob at landley.net
Thu Mar 21 19:25:56 PDT 2024



On 3/17/24 10:23, Oliver Webb wrote:
> On Fri, Mar 8, 2024 at 19:46, Rob Landley <rob at landley.net <mailto:On Fri, Mar
> 8, 2024 at 19:46, Rob Landley <<a href=>> wrote:
>> On 3/7/24 19:39, Oliver Webb via Toybox wrote:
>> > Looking at toysh again since the toybox test suite should run under it
>> > (in mkroot or under a chroot) A problem seems to be that there is no
>> > return command, which breaks runtest.sh to it's core. Dont know how to add
>> one in yet
>> >
>> > On my version of bash (5.2.26) TEST_HOST fails on 3 test cases,
>> > and toysh also fails on those cases (Even tho toysh is doing the right
>> > thing, the same as bash) The attached patch changes the test file
>> > so that 3 test cases are resolved. And TEST_HOST works
>>
>> Because Chet changed stuff I asked him about, making bash a moving target.
> This does bring up the question of what to do with specific edge cases. Since
> bash can’t even be consistent with itself, most bash scripts don’t rely on them,
> at least the ones I’ve seen.
> 
> Should we set out to implement every specific edge case, and if so what version
> are we confirming with? Or should we pick what’s most sensible/easiest to deal
> with and toyonly the test cases for them.

I've been studying the problem space since 2006, have read the bash manual all
the way through more than once, read some subset of the 'advance bash scripting
guide", and was basically making judgement calls. then Elliott got me talking
directly to the bash mainintainer, which from my perspective made a lot of those
corner cases a moving target when they weren't before.

In fact my FIRST pass at this was matching the bash 2.04b behavior from like
1999 that I used in aboriginal linux, until gentoo's portage scripts needed
newer bash features, specifically ~= and some quoting corner case behavior...

"What should all those judgement calls be ahead of time, I demand preemptive
policy" does not personally strike me as helpful. I was mostly trying to
implement what seemed good to me (which still involves asking a LOT of questions
and turning them into test cases to see what bash's behavior actually IS), then
run the Linux From Scratch and Beyond Linux From Scratch package builds through
it to see what broke, then wait for people to complain and take it on a case by
case basis.

Rob


More information about the Toybox mailing list