bertsky / workflow-configuration

a makefilization for OCR-D workflows, with configuration examples
Apache License 2.0
9 stars 4 forks source link

`realpath` used but missing on macOS #10

Closed stweil closed 4 years ago

stweil commented 4 years ago

The default command line on macOS does not provide realpath which is used in ocrd-make, so an error message is shown:

/venv/bin/ocrd-make: line 19: realpath: command not found
make: the `-C' option requires a non-empty string argument
bertsky commented 4 years ago

Thanks for pointing this out.

realpath is used here to resolve relative to absolute paths in a reliable way. On GNU systems it is included in coreutils in recent years.

What do you propose to use instead, readlink perhaps? IIUC this is not reliable either, having an incompatible CLI between BSDs and GNUs. (Cf https://unix.stackexchange.com/questions/136494/whats-the-difference-between-realpath-and-readlink-f)

BTW in the meantime, you can use make directly, provided you stick to the direct installation method.

stweil commented 4 years ago

$(realpath "$PWD") might not need realpath, so could be replaced by $PWD. And $(realpath $(dirname "$0")) always has a directory argument, so $(cd $(dirname "$0") && pwd) could work.

stweil commented 4 years ago

Other people suggest to use Python: python3 -c "import os; print(os.path.realpath('$1'))".

bertsky commented 4 years ago

Ok, I also let go of symlink canonicalization and used your suggestions @stweil. Fingers crossed!