jepsen-io / maelstrom

A workbench for writing toy implementations of distributed systems.
Eclipse Public License 1.0
3.05k stars 189 forks source link

properly handle symlinks #50

Closed llimllib closed 1 year ago

llimllib commented 1 year ago

if maelstrom is a symlink then the wrapper script doesn't work properly.

For example, I install maelstrom to ~/.local/share/maelstrom and symlink the script to ~/.local/bin; the script as currently composed gives:

$ maelstrom help
Error: Unable to access jarfile ~/.local/bin/lib/maelstrom.jar

because it's searching in bin instead of share.

To fix it, I took the readlink solution from #34 and added it to the script from #46.

After applying the patch, the symlink works as expected:

$ maelstrom help
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.core.matrix.impl.mathsops, being replaced by: #'clojure.core.matrix.impl.mathsops/abs
Warning: protocol #'clojure.core.matrix.protocols/PMathsFunctions is overwriting function abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.core.matrix.protocols, being replaced by: #'clojure.core.matrix.protocols/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.core.matrix, being replaced by: #'clojure.core.matrix/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.core.matrix.dataset, being replaced by: #'clojure.core.matrix/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: incanter.core, being replaced by: #'incanter.core/abs
Usage: lein run -- COMMAND [OPTIONS ...]
Commands: analyze, demo, doc, serve, test
aphyr commented 1 year ago

Righto, thanks!