Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shebang mode fails on JRuby due to bash script launcher #95

Open
headius opened this issue Nov 19, 2018 · 0 comments
Open

Shebang mode fails on JRuby due to bash script launcher #95

headius opened this issue Nov 19, 2018 · 0 comments

Comments

@headius
Copy link
Contributor

headius commented Nov 19, 2018

The "shebang" mode for the parser generator does not work properly on some configurations of JRuby due to the jruby command being a bash script.

This leads to the following error in CI (see #93):

Failure:
Racc::TestRaccCommand#test_executable_parser [/Users/headius/projects/racc/test/test_racc_command.rb:57]:
Expected false to be truthy.

In many installs of JRuby, including the default tarball you can download from https://jruby.org, the jruby command is actually implemented using a bash script. Due to stupidity in the design of shebangs on most *nix systems, this means that the jruby script cannot be used directly in the shebang line of a Ruby script, because bash will attempt to execute both the jruby command and the target script with bash.

This is the reason that RubyGems with binscripts are usually installed using so-called "env shebangs" on JRuby, like so:

#!/usr/bin/env jruby

It is possible to install the jruby-launcher gem which will install a native jruby binary that works with the non-env shebang. This may be an option to get the test to pass, but it may be better to use an env shebang when generating the parser script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant