-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
"Invalid extended option" error for legit -X
options
#5091
Comments
Who's building this Docker image? https://hub.docker.com/_/jruby/ says this is "official", but maybe you should report to https://github.com/cpuguy83/docker-jruby/issues instead, because I don't see the problem on our release. Output from ./bin/jruby -Xjit.max=16384 -v in the released 9.1.16.0 archive$ curl -LO https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.1.16.0/jruby-dist-9.1.16.0-bin.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 20.4M 100 20.4M 0 0 9365k 0 0:00:02 0:00:02 --:--:-- 9364k $ tar zxf jruby-dist-9.1.16.0-bin.tar.gz $ cd jruby-9.1.16.0 $ ./bin/jruby -Xjit.max=16384 -v jruby 9.1.16.0 (2.3.3) 2018-02-21 8f3f95a Java HotSpot(TM) 64-Bit Server VM 25.144-b01 on 1.8.0_144-b01 +jit [darwin-x86_64] I can reproduce the problem with the Alpine docker image, but not with the This leads me to believe that the problem stems from the difference between Debian and Alpine distros; namely,
works on the former, and fails on the latter. Since Alpine's |
Oops, I was under impression the image is official indeed. If it's not, but claims so – isn't it a problem? Thank you. |
Well, if Alpine's |
I hate to say it but I am thinking we should start pushing an official image with our releases. Issues like this that we can't fix directly will impact people disproportionately. |
Both 9.1.15 and 9.1.16 images inherit from the same Alpine 3.7.0 and The only change to the shell scripts in Anyone who would try to pack JRuby 9.1.16 into Alpine (including |
@alaz Are you saying it worked ok in 9.1.15? A workaround may be to install the native launcher ( We'll need a patch for the bash launcher that doesn't regress the FreeBSD fix. |
@headius yes, 9.1.15 accepts arguments w/o problems:
|
Reproduced locally. |
This patch appears to work on both Darwin and Alpine for me. I'll test Ubuntu shortly. Edit: wrong patch diff --git a/bin/jruby.bash b/bin/jruby.bash
index 5c841fedb6..fb090a8818 100755
--- a/bin/jruby.bash
+++ b/bin/jruby.bash
@@ -20,6 +20,14 @@ case "`uname`" in
MINGW*) jruby.exe "$@"; exit $?;;
esac
+# ----- Determine how to call expr (jruby/jruby#5091) -------------------------
+# On Alpine linux, expr takes no -- arguments, and 'expr --' echoes '--'.
+_expr_dashed=$(expr -- 2>/dev/null)
+if [ "$_expr_dashed" != '--' ] ; then
+ alias expr="expr --"
+fi
+unset _expr_dashed
+
# ----- Verify and Set Required Environment Variables -------------------------
if [ -z "$JAVA_VM" ]; then
JAVA_VM=-client
@@ -244,7 +252,7 @@ do
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X*)
val=${1:2}
- if expr -- "$val" : '.*[.]' > /dev/null; then
+ if expr "$val" : '.*[.]' > /dev/null; then
java_args=("${java_args[@]}" "-Djruby.${val}")
else
ruby_args=("${ruby_args[@]}" "-X${val}") |
In #5013 we modified our bash script to use -- when calling the `expr` command, but this form is not supported on Alpine Linux's version of expr. This patch tests the behavior of `expr --` to determine which form to use.
The fix appears to work on Darwin, Ubuntu, and Alpine. I have committed it and it will be in 9.1.17. |
JRuby version:
The list of valid
-X
options:And here it is an error when specifying any option:
The text was updated successfully, but these errors were encountered: