[Toybox] "bad xform" not very helpful

enh enh at google.com
Wed Aug 17 14:25:19 PDT 2022


On Wed, Aug 17, 2022 at 1:58 PM Rob Landley <rob at landley.net> wrote:

>
>
> 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...
>

a fresh `git clone` of your master branch?


> Is this statically or dynamically linked, built against musl or bionic...
> grrr,
>

glibc on debian (x86-64) and mac's anonymous libc on darwin (arm64).


> 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.
>

no need --- i'm just using your (macos_)?defconfig.


> 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.
>

but it's consistent across multiple users on multiple OSes, so i think it's
_your_ setup that's the odd one out so far :-)

i've made Android's host tools consistent with the device tools for now,
but there's probably _something_ for you to look into here...


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


More information about the Toybox mailing list