[Toybox] macOS realpath test failures

Rob Landley rob at landley.net
Wed Nov 30 15:06:45 PST 2022



On 11/30/22 15:59, enh wrote:
> 
> 
> On Wed, Nov 30, 2022 at 1:54 PM Rob Landley <rob at landley.net
> <mailto: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
>     <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 :-)

Oh no, I can cheat. I can add a period to the README or something and commit on
top of the branch and it'll re-evaluate and should eventually run.

It's just a pain, and my laptop battery's at 19%...

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

I have a half-dozen things ALMOST ready to check in. They're just all fiddly
ones that have accumulated (or I would have checked them in already)...

They're all doing the Xeno's implementation thing...

Rob


More information about the Toybox mailing list