[Toybox] "bad xform" not very helpful

enh enh at google.com
Wed Sep 7 21:54:55 PDT 2022


On Wed, Sep 7, 2022 at 1:56 PM Rob Landley <rob at landley.net> wrote:

> On 9/6/22 18:16, enh wrote:
> > and to the surprise of absolutely no-one ...
> >
> > they got back to me with a test script to repro this with (which i
> assume will
> > work in any kernel tree, and isn't specific to ACK)...
> > ```
> > #!/bin/bash
> >
> > set -x
> >
> > run () {
> >   start_time=$(date +%s)
> >
> >   find /usr/include/linux/ -name *.h -print0 | \
> >       /usr/bin/perf record -g --               \
> >       tar czf target.$1.tar.gz                 \
> >       --absolute-names                         \
> >       --dereference                            \
> >       --transform "s,/usr/include/,,"          \
> >       --null -T -
> >
> >   mv perf.data perf.$1.data
> >
> >   end_time=$(date +%s)
> >   elapsed=$(( end_time - start_time ))
> >   echo $elapsed s
> > }
> > ```
> >
> > ...and reported that all the time is going into tar fork()ing and
> exec()ing sed :-(
>
> Yeah, not surprised.
>
> > so although NORECURSE was a clever hack to work around the _first_
> tar+sed
> > problem, it seems to have had the expected result of landing me back
> with the
> > original tar+sed problem :-(
>
> I just checked in some more test tweaking, which hopefully lets me park
> that for
> a bit. (I still need to fix the chattr tests, which are skipped because
> root and
> last worked who KNOWS when,


remember that Android's CI typically tests as root (which is why i hit all
these root-only things first), so i can tell you it worked last week :-)


> the first test is failing the same way on the host
> and with toybox because the output it expects is the wrong LENGTH...
> filesystem
> type probably changed out from under it in a distro version upgrade. But I
> poked
> them because that's the other remaining SKIPNEXT=1 usage I missed removing
> when
> I changed the test plumbing's semantics.)
>

the tricky thing to note with the chattr tests is that depending on the fs,
any subset of them might pass/fail.


> I'm also 2/3 of the way through adding toysh support for blockless
> functions ala
> "x() echo hello; x" which of course spawned a couple tangents:
>

(speaking of features that seem more like bugs than features ... that's
just awful. given that bash doesn't support it, don't you want to wait
until you see an actual real-world use first? the fact that bash doesn't
support this makes me doubt we'll ever see any? which seems like a good
thing, because i don't think there are many people still alive who can read
that syntax and know what it actually does!)


> 1) after parsing the function body gets pulled out of the current parse
> block
> and moved to a linked list of defined functions because object lifetime:
> when
> you exit the current block and it frees it the function that got defined
> needs
> to persist, so I made a reference counted structure. But the transplant
> code
> assumed it was starting in a block and didn't know when to end if it
> wasn't, so
> it needed some massaging.
>
> 2) I was adding a placeholder type 'f' pipeline segment and I do NOT
> remember
> why, it not only seems unnecessary but I have a TODO not to remove it?
>
> And of course I want to get diff finished and checked in.
>
> (And Moritz Weber sent me a git.c drop to help him debug, and reminded me
> we
> were poking at host/nslookup, and that I was doing videos, and...)
>
> I'm trying to get the symlink stuff converted so it passes better on mac,
> then
> lemme try to get diff and sh parked, and then I need to implement the sed
> extension so tar can use one persistent instance in a streaming manner.
> And then
> I can finish the redo of readlink.c so I can have "make test_tar" detect
> the
> output directory from "make install_airlock", and write up a FAQ entry
> about
> doing that...
>
> Sorry I'm not faster. :(
>

no worries, i probably won't have much time the next couple of weeks
anyway... (but note that the chattr.test breakage means i can't take any
other changes until that's working again.)


> Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20220907/712a3928/attachment.htm>


More information about the Toybox mailing list