[Toybox] "bad xform" not very helpful

Rob Landley rob at landley.net
Wed Aug 17 14:06:36 PDT 2022



On 8/16/22 14:36, enh wrote:
> 
> 
> On Tue, Aug 16, 2022 at 12:22 PM enh <enh at google.com <mailto:enh at google.com>> wrote:
> 
> 
> 
>     On Tue, Aug 16, 2022 at 10:28 AM enh <enh at google.com
>     <mailto:enh at google.com>> wrote:
> 
> 
> 
>         On Tue, Aug 16, 2022 at 1:43 AM Rob Landley <rob at landley.net
>         <mailto:rob at landley.net>> wrote:
> 
>             On 8/15/22 18:50, enh via Toybox wrote:
>             > and here's their minimized repro case:
>             >
>             > echo > /tmp/foo.txt; echo /tmp/foo.txt > /tmp/find.txt
>             >
>             > cat /tmp/find.txt | prebuilts/build-tools/path/linux-x86/tar czf
>             /tmp/out.tar.gz \
>             >   --absolute-names \
>             >   --transform 's,^/,,' -T -
>             >
>             > This fails with
>             >
>             > tar: bad xform
> 
>             Hmmm...
> 
>             $ echo > /tmp/foo.txt; echo /tmp/foo.txt > /tmp/find.txt
>             $ cat /tmp/find.txt | PATH=$PWD/sub9:$PATH ./tar czf out.tar.gz \
>               --absolute-names --transform 's,^/,,' -T -
>             $ tar tvf /tmp/out.tar.gz
>             -rw-r--r-- landley/landley   1 2022-08-16 01:53 tmp/foo.txt
> 
>             Working for me? (The sub9 bit was because I stuck toybox sed in the
>             $PATH to
>             make sure that wasn't it...)
> 
> 
>         repos for me, both with their prebuilt but also with a fresh clone (on
>         either macos or linux):
> 
>         */tmp/toybox$ *cat /tmp/find.txt | ./toybox tar czf /tmp/out.tar.gz  
>         --absolute-names   --transform 's,^/,,' -T -
> 
>         tar: bad xform
> 
>         */tmp/toybox$ *
> 
>          
>         a bit of printf debugging shows we're reading nothing back:
> 
>         */tmp/toybox$ *cat /tmp/find.txt | strace -f ./toybox tar czf
>         /tmp/out.tar.gz   --absolute-names   --transform 's,^/,,' -T - 2> /tmp/out
> 
>         argv[0]="sed"
> 
>         argv[1]="-e"
> 
>         argv[2]="s,^/,,"
> 
>         pid=1779946
> 
>         stdin="/tmp/foo.txt"
> 
>           len=0 Success
> 
>         total=0 result="(null)"
> 
> 
>         but strace implies we're not actually exec()ing sed at all?

> > Multiplexer instead of standalone build shouldn't make a difference if
> > you've disabled command recursion.
> 
>     and if i `CONFIG_TOYBOX_NORECURSE=y`, it calls sed and works...
> 
> (and, although we have NORECURSE=y on the *device*, apparently i didn't make the
> equivalent change in the linux/mac host configs /facepalm) 

Sigh. I should have tested it anyway...

And I just did and it's still working for me? Weird. Confirmed with strace that
it didn't call external sed...

Is this statically or dynamically linked, built against musl or bionic... grrr,
trying to build against your .config-linux from the 16th without running
oldconfig causes it to throw a bunch of "CFG_WGET_LIBTLS" not defined errors.
And when I run oldconfig:

$ ./toybox tar czf /tmp/out.tar.gz --absolute-names --transform 's,^/,,' -T
/tmp/find.txt
$ echo $?
0

Alright, let me try it in the android checkout directory... Still had to run
oldconfig... And it ran fine for me.

Something different about the build environment.

Rob


More information about the Toybox mailing list