arclanguage / anarki

Community-managed fork of the Arc dialect of Lisp; for commit privileges submit a pull request.
http://arclanguage.github.io
Other
1.17k stars 160 forks source link

Unable to run under FreeBSD 11.1 on Racket 6.12 #96

Closed matthewwiese closed 6 years ago

matthewwiese commented 6 years ago

When I run sh arc.sh in the anarki repository, the script does not run and I am greeted with the message:

arc.sh: [[: not found Sorry, this script doesn't run on your platform FreeBSD yet. Please create a new issue at https://github.com/arclanguage/anarki/issues.

I'm fairly new to FreeBSD so perhaps this is a vanilla response. Nevertheless, I'm not entirely sure how to get it working myself.

EDIT: Just checked the arc.sh file and realized that this is a message from the script, not my system.

akkartik commented 6 years ago

The error seems unnecessarily heavyhanded. All that case block is doing is installing Racket and rlwrap. Can you try installing Racket, then commenting out the error message and exit, then running it from the top-level directory for Anarki? Instead, make it look like this:

*)
    arc_dir=$(pwd)

You may still run into issues. The error above about [[: not found suggests that you may need to explicitly install bash.

matthewwiese commented 6 years ago

Thank you for the assistance akkartik. The [[: not found error didn't immediately occur to me to be a shell error. Will try to figure that issue out (as I do have bash installed and running).

Should your change to the catchall be added to the repository? From your comment it sounds like your fix should be the default for users.

akkartik commented 6 years ago

Yes, once you can confirm you get it working I'll send you a PR.

matthewwiese commented 6 years ago

Hey @akkartik I made the change and everything works fine when I run bash arc.sh!

The only problem is to execute ./arc.sh directly I have to change the first line to #!/usr/local/bin/bash but that's just because I have it installed there on my system. My suggestion is to make it more explicit in the README for users of other Unix variants -- perhaps a little blurb much like your comment to me telling users to make sure they are using the correct shell and that it's assumed bash is located at /bin/bash?

akkartik commented 6 years ago

Awesome! Does FreeBSD have /usr/bin/env?

matthewwiese commented 6 years ago

Yes it does! I see where you're going with this... change the shebang to #!/usr/bin/env bash?

akkartik commented 6 years ago

Thanks for https://github.com/arclanguage/anarki/pull/97!

akkartik commented 6 years ago

A coda on "standard paths":

Looks like POSIX is silent on where utilities should be located. (Though perhaps it wasn't always thus?)

Everyone has /usr/bin/env, but that's considered insecure. What is a sophont to do?