History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-1967
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Thomas E Enebo
Reporter: Thorbjørn Ravn Andersen
Votes: 0
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
JRuby

jruby bash scripts do not work on bash-less unix'es

Created: 15/Jan/08 08:17 AM   Updated: 04/May/08 02:50 PM
Component/s: Miscellaneous
Affects Version/s: JRuby 1.0.3
Fix Version/s: JRuby 1.1+

Time Tracking:
Not Specified

File Attachments: 1. GZip Archive jruby.gz (2 kb)
2. Text File jruby_sh.patch (2 kb)
3. Text File me.patch (2 kb)
4. Text File sh_jruby.patch (1 kb)

Environment: AS/400 V5R3
Issue Links:
Related
 


 Description  « Hide
The AS/400 contain Java environment and a AIX emulation environment. The latter provide sh and ksh but not bash, so the jruby script (and all the others requiring bash) do not work on this system.

Is there any pressing need for requireing bash or would a regression to sh be reasonable?

A proper raw sh implementation should run on every unix box in existance



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Oliver Nutter - 15/Jan/08 05:07 PM
We are very interested in any improvements to our UNIX startup scripts, but we are not sh experts. We started using bash because we could not find a way to make it work with simple sh. If there's a way to do what we do now and go back to sh, we'd include it.

Yannick "Pouype" Francois - 15/Jan/08 05:24 PM
I'm trying to use JRuby (1.0.3) on my OpenBSD Box and OpenBSD use ksh (by default). Then I have this problem too.

I made some change in jruby script to could use jruby .
See in attachment a patch file (made from trunk January 15th 2008).

This fix could resolve #1671 <http://jira.codehaus.org/browse/JRUBY-1671> (and perhaps other I don't see)

Hope it's could help other, and hope it's work for *nix with bash.


Charles Oliver Nutter - 15/Jan/08 06:03 PM
With this change it seems like filename processing breaks in the script:
~/NetBeansProjects/jruby $ bin/jruby test/test_big_decimal.rb 
Error opening script file: /Users/headius/NetBeansProjects/jruby/tteesstt/tteesstt__bbiigg__ddeecciimmaall..rrb (No such file or directory)

Charles Oliver Nutter - 15/Jan/08 06:04 PM
Fix if possible for 1.1. It would be nice to not depend on bash...if possible.

Thorbjørn Ravn Andersen - 01/Feb/08 07:01 AM
Just for the record: This also applies to bin/jruby in JRuby 1.1RC1

Charles Oliver Nutter - 06/Mar/08 10:36 AM
Ping! We're pushing out RC3 soon...if there's way to get sh scripts that will do everything our current bash scripts do, across all platforms, we'd love to include them. But the window is rapidly closing.

Thorbjørn Ravn Andersen - 07/Mar/08 02:09 PM
Revised bin/jruby which works with Solaris /bin/sh. Cygwin stuff commented out due to insufficient knowledge about what it does.

Thorbjørn Ravn Andersen - 07/Mar/08 02:19 PM
I have now looked at the jruby command under Solaris, and adapted it to use "expr" and "cut" to do string stuff, and changed the arrays to plain single strings.

The cygwin stuff is commented out, as /bin/sh dislikes the syntax and I do not understand what it does so I will not change it.

I have understood that the "dash" shell is good for weeding out bashisms from shell scripts, but I have not tested it myself.

Let me know if this works for others than me. If not, please run with "sh -xv bin/jruby ...." and attach the output.


Thomas E Enebo - 17/Mar/08 06:45 PM
Not a 100% patch (either attachment as far as I can tell). Bumping. We can fix in point release.

Yannick "Pouype" Francois - 08/Apr/08 04:20 PM
I'm back again with this SH problem.
I made a new patch for jruby sh script.

I test it under my default Ksh 5.2.14 and for bash 3.2.33.

"Keep It Smart Simple" please. Do not use some bash specific keyword (like "declare" or "{1:3}").

I hope it will work for everyone.


Thomas E Enebo - 10/Apr/08 12:28 PM
My modifications which work for regular command-line elements, but fails for things like -e "puts 'heh'"

Thomas E Enebo - 10/Apr/08 12:32 PM
Poutype, I started with your patch but it had some old stuff in it (like jruby.base) so it was not right. Also it was not quoting properly for certain arguments which have spaces in them. I thought I modified it to my satisfaction, but it is still broken for things like ./bin/jruby -e 'puts "HEH"'. I uploaded this version as a patch so someone can nudge this along. While people are at it they may also want to look at:

http://www.weiqigao.com/blog/2008/04/08/your_jirb_groovysh_and_clj_commands_doesnt_work_in_cygwin.html


Yannick "Pouype" Francois - 04/May/08 02:50 PM
Sorry for the delay, but I always have problem with my OpenBSD KSH based machine ! I made a test with latest trunk from svn...

I'm so sad to couldn't use Jruby under my OS. I can't help on other part because of this shell problem :-/

I probably continue to use my own script to launch jruby :-/