<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 1, 2021 at 1:04 PM Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 8/31/21 6:23 PM, enh via Toybox wrote:<br>
> PowerPC may be dead and gone, but arm64 is the new x86-64, and<br>
> x86-64 the new PowerPC :-)<br>
> ---<br>
> tests/file.test | 4 ++++<br>
> toys/posix/file.c | 36 +++++++++++++++++++++++++++++++-----<br>
<br>
Grrr, clashes a lot with my tests/file.test local changes. (My tree accumulating<br>
unfinished changes is yet another tabsplosion-style accumulation of minor<br>
technical debt.) Anyway, backed my changes out to apply yours, then applied them<br>
again.<br>
<br>
It's a pity you don't use bash to run the test suite, because $'\x0a\xbc\xde' in<br>
the "input" argument would be a more concise way of doing those tests. (Yes, I<br>
need to find time to work on toysh again...)<br></blockquote><div><br></div><div>speaking of which... your use of fancy bash stuff upsets both Android and macOS. here's the complaint from macOS, but iirc Android is similar:</div><div><br></div><div>~/toybox$ make test_file<br>scripts/test.sh file<br>scripts/runtest.sh: line 217: syntax error near unexpected token `;'<br>scripts/runtest.sh: line 217: ` R) LEN=0; B=1; ;&'<br></div><div><br></div><div>seems not to actually cause trouble in either case, though, so i'd been ignoring it for now.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Your TEST_HOST output didn't match my TEST_HOST output on devuan. Is this<br>
version skew in the "file" command or did you not run TEST_HOST? I get:<br>
<br>
universal: Mach-O universal binary with 2 architectures: [x86_64] [arm64]<br>
<br>
Which has [name] instead of commas, and uses x86_64 instead of x86-64.<br></blockquote><div><br></div><div>oh, interesting. *my* host file wasn't giving output that useful. (and macOS file is different from linux file here.)</div><div><br></div><div>yeah, i'm not particularly wedded to the specific format i used, and macOS used [] too, but included more info:</div><div><br></div><div>~/toybox$ file /bin/sh<br>/bin/sh: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]<br>/bin/sh (for architecture x86_64): Mach-O 64-bit executable x86_64<br>/bin/sh (for architecture arm64e): Mach-O 64-bit executable arm64e<br></div><div><br></div><div>(note that that's really three lines for one file, which seems quite a major script-breaker!)</div><div><br></div><div>anyway, my choice of x86-64 was just because that's what we've used for everything else; ELF, Windows, and even regular single-architecture Mach-O files. personally i tend towards internal consistency rather than outward consistency when they differ, but the opposite argument is obviously equally valid. you can't really win. but if we change mach-o universal binaries, we should probably change regular mach-o binaries too?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hmmm, I have a big list of tests I need to add to file.test and some of them are...<br>
<br>
$ echo hello > test; chmod 000 test; file test<br>
test: regular file, no read permission<br>
$ toybox file test<br>
file: test: Permission denied<br>
test: unknown<br>
<br>
Eh, how much do we care about matching exactly in the corner cases? Hmmm...<br></blockquote><div><br></div><div>yeah, there's also fancy stuff like UTF-8 vs ASCII, and guessing the language if it's UTF-8, but although they're kind of cool, they do cost time as well as code, and i haven't personally had a use for them yet, so i've been ignoring all the fancy bits.</div><div><br></div><div>(the specific motivating case for adding mach-o universal binary support was a script that's just checking for "universal binary", so they'd be fine if you want to change the output format.)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Rob<br>
</blockquote></div></div>