stewartsmith / libeatmydata

libeatmydata - because fsync() should be a no-op
https://www.flamingspork.com/projects/libeatmydata/
GNU General Public License v3.0
409 stars 21 forks source link

Wrapper uses readlink -f which is not supported on all versions of macOS #28

Open johnsonjh opened 2 years ago

johnsonjh commented 2 years ago

The eatmydata wrapper uses readlink -f which is not supported on all versions of macOS - the simplest workaround is to use readlink from coreutils.

I will take a look further at the usage in the script and see if an alternative that does not require any dependencies could be possible unless someone beats me to it.

johnsonjh commented 2 years ago

I don't know the exact versions where -f is supported, but the failure noted was from Homebrew's CI on ARM64 macOS 11.

39DE0B5C-57C4-4AAC-A1FD-24BFDE469AEE

johnsonjh commented 2 years ago

Perhaps realpath -e would work here.

As with readlink, since this is non-POSIX, I'd need to check if it's widely supported ...

jjwatt commented 1 year ago

FYI, http://mywiki.wooledge.org/BashFAQ/029

tl;dr: You can use perl:

perl -le 'print readlink "/bin/sh"'

or find with printf %l:

$ find /bin/ -type l -printf '%p points to %l\n'
/bin/sh points to bash
/bin/bunzip2 points to bzip2

or write a custom function (that is a little gnarly--see the link for it).