<div dir="auto">it does by default. that's what i turned off as a workaround for this bug.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 31, 2022, 18:15 David Seikel <<a href="mailto:onefang_toybox@dave.isageek.net">onefang_toybox@dave.isageek.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2022-08-31 14:55:24, enh via Toybox wrote:<br>
>Â Â On Tue, Aug 16, 2022 at 12:22 PM enh <<a href="mailto:enh@google.com" target="_blank" rel="noreferrer">enh@google.com</a>> wrote:<br>
> <br>
>Â Â Â On Tue, Aug 16, 2022 at 10:28 AM enh <<a href="mailto:enh@google.com" target="_blank" rel="noreferrer">enh@google.com</a>> wrote:<br>
> <br>
>Â Â Â Â On Tue, Aug 16, 2022 at 1:43 AM Rob Landley <<a href="mailto:rob@landley.net" target="_blank" rel="noreferrer">rob@landley.net</a>> wrote:<br>
> <br>
>Â Â Â Â Â On 8/15/22 18:50, enh via Toybox wrote:<br>
>Â Â Â Â Â > and here's their minimized repro case:<br>
>Â Â Â Â Â ><br>
>Â Â Â Â Â > echo > /tmp/foo.txt; echo /tmp/foo.txt > /tmp/find.txt<br>
>Â Â Â Â Â ><br>
>Â Â Â Â Â > cat /tmp/find.txt | prebuilts/build-tools/path/linux-x86/tar czf<br>
>Â Â Â Â Â /tmp/out.tar.gz \<br>
>Â Â Â Â Â > Â --absolute-names \<br>
>Â Â Â Â Â > Â --transform 's,^/,,' -T -<br>
>Â Â Â Â Â ><br>
>Â Â Â Â Â > This fails with<br>
>Â Â Â Â Â ><br>
>Â Â Â Â Â > tar: bad xform<br>
> <br>
>Â Â Â Â Â Hmmm...<br>
> <br>
>Â Â Â Â Â $ echo > /tmp/foo.txt; echo /tmp/foo.txt > /tmp/find.txt<br>
>Â Â Â Â Â $ cat /tmp/find.txt | PATH=$PWD/sub9:$PATH ./tar czf out.tar.gz \<br>
>Â Â Â Â Â Â --absolute-names --transform 's,^/,,' -T -<br>
>Â Â Â Â Â $ tar tvf /tmp/out.tar.gz<br>
>     -rw-r--r-- landley/landley  1 2022-08-16 01:53 tmp/foo.txt<br>
> <br>
>Â Â Â Â Â Working for me? (The sub9 bit was because I stuck toybox sed in the<br>
>Â Â Â Â Â $PATH to<br>
>Â Â Â Â Â make sure that wasn't it...)<br>
> <br>
>Â Â Â Â repos for me, both with their prebuilt but also with a fresh clone (on<br>
>Â Â Â Â either macos or linux):<br>
> <br>
>    /tmp/toybox$ cat /tmp/find.txt | ./toybox tar czf /tmp/out.tar.gz  <br>
>    --absolute-names  --transform 's,^/,,' -T -<br>
> <br>
>Â Â Â Â tar: bad xform<br>
> <br>
>Â Â Â Â /tmp/toybox$Â <br>
> <br>
>Â Â Â Â Â <br>
>Â Â Â Â a bit of printf debugging shows we're reading nothing back:<br>
> <br>
>Â Â Â Â /tmp/toybox$ cat /tmp/find.txt | strace -f ./toybox tar czf<br>
>    /tmp/out.tar.gz  --absolute-names  --transform 's,^/,,' -T - 2><br>
>Â Â Â Â /tmp/out<br>
> <br>
>Â Â Â Â argv[0]="sed"<br>
> <br>
>Â Â Â Â argv[1]="-e"<br>
> <br>
>Â Â Â Â argv[2]="s,^/,,"<br>
> <br>
>Â Â Â Â pid=1779946<br>
> <br>
>Â Â Â Â stdin="/tmp/foo.txt"<br>
> <br>
>Â Â Â Â Â len=0 Success<br>
> <br>
>Â Â Â Â total=0 result="(null)"<br>
> <br>
>Â Â Â Â but strace implies we're not actually exec()ing sed at all?<br>
> <br>
>Â Â Â and if i `CONFIG_TOYBOX_NORECURSE=y`, it calls sed and works...<br>
> <br>
>Â Â ...though this might be about to come back and bite me. i'm hearing as-yet<br>
>Â Â unconfirmed reports that toybox `tar czf` is a lot slower than gnu tar,<br>
>Â Â and -- given that they're using --transform` while they're assuming it's<br>
>Â Â tar or gzip, i'm wondering whether it's actually the fact that we're<br>
>Â Â forking out to sed for every file?<br>
>Â Â i've asked for repro steps or a `perf record` i can look at...<br>
<br>
That reminds me...<br>
<br>
I've long thought it would be great if toybox toys could call other<br>
toybox toys directly. So tar wouldn't fork out to sed, we have our own<br>
sed, just call it directly. Then you avoid the fork and other overhead,<br>
which will probably speed things up.<br>
<br>
-- <br>
A big old stinking pile of genius that no one wants<br>
coz there are too many silver coated monkeys in the world.<br>
_______________________________________________<br>
Toybox mailing list<br>
<a href="mailto:Toybox@lists.landley.net" target="_blank" rel="noreferrer">Toybox@lists.landley.net</a><br>
<a href="http://lists.landley.net/listinfo.cgi/toybox-landley.net" rel="noreferrer noreferrer" target="_blank">http://lists.landley.net/listinfo.cgi/toybox-landley.net</a><br>
</blockquote></div>