[Toybox] toybox ebuild.

Rob Landley rob at landley.net
Thu Feb 9 17:21:08 PST 2023


On 2/9/23 07:01, Rob Landley wrote:
> On 2/9/23 03:51, Patrick Lauer wrote:
>> On 2/5/23 12:59, Rob Landley wrote:
>>> Doing my irregular trawl to see if distro repos have any interesting patches or
>>> bug reports that haven't made it upstream, and... at the risk of opening a can
>>> of worms:
>>> 
>>> https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-apps/toybox/toybox-0.8.8.ebuild#n52
>>> 
>>> You probably want "make tests" (plural), because "make test" builds the "test"
>>> command as a standalone executable. (Which should usually succeed?)
>> 
>> Aye. That makes sense. Fixed.
>> 
>> Now I'm reliably running into a test failure:
>> 
>> FAIL: cut -C test1.txt
>> echo -ne '' | 
>> "/var/tmp/portage/sys-apps/toybox-0.8.9/work/toybox-0.8.9/generated/testdir/cut" 
>> -C -1 "$FILES/utf8/test1.txt"
>> --- expected	2023-02-09 09:49:21.525159648 -0000
>> +++ actual	2023-02-09 09:49:21.525159648 -0000
>> @@ -1 +1 @@
>> -l̴̗̠
>> +l
>> make: *** [Makefile:77: tests] Error 1
>> 
>> No idea yet what's triggering it, maybe you have some insight.
> 
> Sigh, I hit something similar on bionic with the NDK build (because even a
> static build of bionic wanted to read files out of /System in order to tell me
> what is and isn't a combining character):
> 
> http://lists.landley.net/pipermail/toybox-landley.net/2021-October/028766.html
> 
> I do my own utf8 parsing, but _unicode_ is a bear to do yourself (just answering
> the question "is this a combining character" involves
> http://lists.landley.net/pipermail/toybox-landley.net/2021-October/028753.html
> and
> http://lists.landley.net/pipermail/toybox-landley.net/2021-October/028758.html
> and I decided it was just all out of scope), but the dance to get glibc to admit
> unicode exists is nontrivial. (And if the state isn't set, ze functions: zey do
> nothink.)
> 
> Lemme see what I can do with livegui-amd64 under qemu to reproduce this here...

Reproduced. Haven't really root caused, but I was reminded of:

  https://github.com/landley/toybox/issues/300

Which boils down to "the locale we're trying to use is not installed".

Toybox is doing:

    setlocale(LC_CTYPE, "");
    if (strcmp("UTF-8", nl_langinfo(CODESET)))
      uselocale(newlocale(LC_CTYPE_MASK, "en_US.UTF-8", NULL));

And it looks like gentoo has "C.utf8" instead (no dash), which... yeah, it works
if I tell it to uselocale() that instead. I probably need multiple fallbacks in
a loop. (Does it care about the dash? Is it case sensitive? How many iterations
here...)

Oh goddess why is it doing uselocale(newlocale()), I think it was a macos thing?
Yeah, git annotate says commit 4786fd610 which was Elliott. (Do you remember why
it was doing that?)

And then the NEXT failure is du which boils down to "oh right, overlayfs is
broken and says everything is 0 blocks long", which admittedly makes testing du
problematic there. Probably just a livecd thing...

And then a bunch of "id" failures because all the tests examining root (as a
presumably known portable account) are confused because you guys added root to a
zillion other groups. (Why? Root can access any group. Why would you grant
additional permissions to _root_? Something something selinux?)

Alright, the locale thing I can fix up, the passwd plumbing is undergoing a
rewrite anyway, and du is useless on overlayfs...

I note that what tests are and aren't included in "make tests" is determined by
the executable bit on tests/*.test so you could locally chmod -x
tests/{du,id}.test once I fix up the locale thing cut's barfing on. (I can also
try to fix them, but in both cases I'm not entirely sure _how_? The commands
built fine, the tests don't match the distro environment...)

Rob


More information about the Toybox mailing list