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