[Toybox] macOS realpath test failures

enh enh at google.com
Wed Nov 30 13:59:01 PST 2022


On Wed, Nov 30, 2022 at 1:54 PM Rob Landley <rob at landley.net> wrote:

> On 11/28/22 12:41, enh via Toybox wrote:
> > github CI caught a few failures
>
> Sigh. There's a reason this has been on the todo list for literally years.
> It's
> corner cases all the way down and I don't have a mac test environment.
> (Works on
> linux not on mac means a libc function is returning something different,
> possibly because a syscall did, possibly because the VFS did something
> funky...)
>
> > (
> https://github.com/landley/toybox/actions/runs/3561813808/jobs/5983047254
> ):
> >
> > PASS: realpath -s
> >
> ............................................................................
> > ................................................
> > realpath: dos/three: Not a directory
>
> Not a directory? Up top we did:
>
>   mkdir -p one/two/three
>   ln -s ./one uno
>   ln -s one/two dos
>
> I don't THINK anything's done a cd or filesystem write since then?
> (one/two/three is a directory and dos points to "one/two"...)
>
> > FAIL: realpath -s link/..
> > echo -ne '' |
> "/Users/runner/work/toybox/toybox/generated/testdir/realpath" -es
> > dos/three
> > --- expected 2022-11-28 04:54:16.000000000 +0000
> > +++ actual 2022-11-28 04:54:16.000000000 +0000
> > @@ -1 +0,0 @@
> > -/Users/runner/work/toybox/toybox/generated/testdir/testdir/dos/three
>
> Debris from that failure...
>
> > PASS: realpath -s .. eats symlink
> > PASS: realpath -s .. eats symlink in $PWD
>
> Neither of those actually looks at the filesystem because -s (don't expand
> symlinks) so there's potentially a getcwd() prepend then the ..
> cancellation is
> entirely string based...
>
> > FAIL: realpath -es dangling symlink
> > echo -ne '' |
> "/Users/runner/work/toybox/toybox/generated/testdir/realpath" -es
> > dangling 2>/dev/null || echo ok
> > --- expected 2022-11-28 04:54:16.000000000 +0000
> > +++ actual 2022-11-28 04:54:16.000000000 +0000
> > @@ -1 +1 @@
> > -ok
> > +/Users/runner/work/toybox/toybox/generated/testdir/testdir/dangling
>
> Adding -e however checks if the result exists. And the failure here is it
> SHOULDN'T, but MacOS thinks it DOES. (How do you even...?)
>
> > PASS: realpath -ms
> > realpath: one/two/ichi/two/ichi/two: Not a directory
>
> Our old friend again...
>
> > FAIL: realpath -es
> > echo -ne '' |
> "/Users/runner/work/toybox/toybox/generated/testdir/realpath" -es
> > one/two/ichi/two/ichi/two
> > --- expected 2022-11-28 04:54:16.000000000 +0000
> > +++ actual 2022-11-28 04:54:17.000000000 +0000
> > @@ -1 +0,0 @@
> >
> -/Users/runner/work/toybox/toybox/generated/testdir/testdir/one/two/ichi/two/ichi/two
>
> Sigh. If I stick printfs into a commit and push to a branch it'll
> _sometimes_
> run the tests on the new commit based on github server load, correct?
>

yeah, if it doesn't fire, let me know and i'll run it locally. my latency's
poor too, but unlike github i'm not one-shot, and will get to it when
things are quiet again :-)


> Lemme finish fixing cp -s first (I.E. the rest of my relative path
> untangling
> todo item)...
>

yeah, no hurry, just explaining in advance why i'm not looking at a
post-thanksgiving update yet :-)


> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20221130/84aa9395/attachment.htm>


More information about the Toybox mailing list