[Toybox] xargs

enh enh at google.com
Thu Nov 21 15:08:22 PST 2019


On Tue, Nov 19, 2019 at 9:30 PM Rob Landley <rob at landley.net> wrote:
>
> On 11/19/19 10:16 PM, enh wrote:
> > On Fri, Nov 15, 2019 at 5:56 PM Rob Landley <rob at landley.net> wrote:
> >> Is there a "make airlock" style list of what darwin would need that's not in
> >> defconfig yet? (Or needs fixing on darwin?)
> >
> > it's kind of the opposite...
> >
> > afaik toybox works fine on macOS. the AOSP build is currently using
> > toybox on macOS in every case where we use toybox on linux. (modulo me
> > getting a new prebuilt so i can switch back to toybox xargs(1) on the
> > mac.)
>
> Yay!
>
> > what doesn't work is the tests. take the truncate(1) tests, say. afaik
> > toybox truncate(1) works fine on macOS. but because the built-in
> > stat(1) is junk, and the first lines of truncate.test are...
> >
> >   SIZE='&& stat -c %s freep'
> >   testing "0" "truncate -s 0 freep $SIZE" "0\n" "" ""
> >
> > ...we "fail" the test with an error message about stat not having a -c option.
> >
> > i think macOS would be better off if make test* just created a
> > directory of symlinks to toybox and stuck that on the path.
>
> It's got plumbing for that:
>
>   PREFIX=$PWD/airlock make distclean defconfig toybox install_airlock
>   PATH=$PWD/airlock # plus :$PATH if you like
>
> But in theory when you do "make tests" every toybox command that's enabled in
> the config already gets prepended to the $PATH for all tests, so each test is
> using all the toybox commands you built (with fallback to host $PATH for any you
> haven't built)?

ah, i didn't realize that. i guess i assumed it was equivalent to
`make test_X` for all X.

/me checks `make tests`...

ah, we need to actually admit that we can build stat now. patch attached.

env.test was failing because it was accidentally calling the system
env(1). patch attached.

other than that, it's looking pretty good. nothing very serious. i'll
try to have a look at . some of the other . stuff tomorrow.

(excuse . the random '.'s and spaces. the stories you've heard about
how broken MacBook "Pro" keyboards are are all true.)


> I designed it that way from the start. Why isn't it working? (It only tests the
> commands currently enabled in the .config: if you disable stat between the build
> and the test it won't put that command in the $PATH. It's doing "make
> install_flat" on scripts/test.sh line 20 which uses the config to get the list,
> it doesn't try to run the ./toybox binary because cross compiling. But that's
> intentional here: the commands you're TESTING are used in all tests, but the
> ones you're NOT testing use the host versions even if you built them in the
> toybox binary.)
>
> > it's effectively how we're testing on Android, so i need to keep the tests
> > passing on all-toybox anyway. (and it's not been much of an issue so
> > far.)
>
> Maybe install_airlock will fix scripts/test.sh on macos? It worked for me, but
> I'm mostly just using it on Linux? Still, have you tried:
>
>   PREFIX=$PWD/airlock make distclean defconfig toybox install_airlock
>   PATH=$PWD/airlock:$PATH VERBOSE=nopass make tests
>
> Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mac-build-fallocate-and-stat-by-default.patch
Type: application/octet-stream
Size: 874 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20191121/29444398/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-env.test-be-sure-to-call-toybox-env.patch
Type: application/octet-stream
Size: 1175 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20191121/29444398/attachment-0007.obj>


More information about the Toybox mailing list