Re: [13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
Vladimir, if you're okay with it I'd like to propose this as a patch to the problem instead: http://cr.openjdk.java.net/~ihse/JDK-8217404-fix-multiple-disabled-jvm-features/webrev.01 Looks good! I verified that it fixes the bug. Best regards, Vladimir Ivanov On Jan 18, 2019, at 3:33 PM, Vladimir Ivanov wrote: http://cr.openjdk.java.net/~vlivanov/8217404/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8217404 --with-jvm-features doesn't work properly when multiple features are explicitly disabled: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... yes checking if graal module jdk.internal.vm.compiler should be built... yes checking if aot should be enabled... yes ... The problem in the following code: DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` if test "x$DISABLE_AOT" = "xaot"; then ENABLE_AOT="false" fi Since DISABLED_JVM_FEATURES ("aot jvmci graal") contains the list of explicitly disabled features, grep over it returns the whole list when there's a match. The subsequent check fails because there's no exact match, though DISABLE_AOT contains "aot" . Proposed fix is to check there's no match instead. After the fix it works as expected: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... no, forced checking if graal module jdk.internal.vm.compiler should be built... no, forced checking if aot should be enabled... no, forced ... (The fix doesn't address the case when one feature has a name which is a proper substring of another feature, but there are no such cases at the moment.) Best regards, Vladimir Ivanov
Re: [13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
On 2019-01-19 01:39, Vladimir Ivanov wrote: Thanks, Igor. overall your fix looks reasonable, but w/ it we can get unintentionally disabled features (b/c grep doesn't do full word match). although this problem wasn't really introduced by your fix, I think it's be better to fix it as a part of your patch. I see two possible solutions: I was aware of such drawback, but decided to leave it as is, since it doesn't affect existing features. - add "-w" to grep, but I am not sure if "-w" is supported by all grep implementations - use $XARGS instead of $ECHO when we get DISABLE_X. in this case you will need to revert your changes in 'if test ...' lines I'm in favor of using "-w" and I see different grep flags being used already, but would like somebody from Build team confirm they are OK with such solution. I think an even better solution is to use the pattern of HOTSPOT_CHECK_JVM_FEATURE. This should solve all potential problems, and is moving the abstraction level up slightly. I've been working for some time now on better structure for handling the JVM feature testing. While we are using the feature testing as I intended it, the underlying support for doing this in a good way has never been put into place. Unfortunately, this fix has been on low priority and been mostly idling on my disk, half done, for several months now. So we need to have an interim solution to this problem. But I'd like to see that the fix takes at least a step towards a better abstraction. Vladimir, if you're okay with it I'd like to propose this as a patch to the problem instead: http://cr.openjdk.java.net/~ihse/JDK-8217404-fix-multiple-disabled-jvm-features/webrev.01 /Magnus Best regards, Vladimir Ivanov On Jan 18, 2019, at 3:33 PM, Vladimir Ivanov wrote: http://cr.openjdk.java.net/~vlivanov/8217404/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8217404 --with-jvm-features doesn't work properly when multiple features are explicitly disabled: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... yes checking if graal module jdk.internal.vm.compiler should be built... yes checking if aot should be enabled... yes ... The problem in the following code: DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` if test "x$DISABLE_AOT" = "xaot"; then ENABLE_AOT="false" fi Since DISABLED_JVM_FEATURES ("aot jvmci graal") contains the list of explicitly disabled features, grep over it returns the whole list when there's a match. The subsequent check fails because there's no exact match, though DISABLE_AOT contains "aot" . Proposed fix is to check there's no match instead. After the fix it works as expected: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... no, forced checking if graal module jdk.internal.vm.compiler should be built... no, forced checking if aot should be enabled... no, forced ... (The fix doesn't address the case when one feature has a name which is a proper substring of another feature, but there are no such cases at the moment.) Best regards, Vladimir Ivanov
Re: [13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
On 2019-01-20 09:45, Kim Barrett wrote: On Jan 18, 2019, at 7:31 PM, Vladimir Ivanov wrote: Thanks, Vladimir. I usually used --with-jvm-features=-aot,-jvmci,-graal Did not work in this case too? I didn't know it supports comma-separated list, but it doesn't work as well: $ bash configure --with-jvm-features="-aot,-jvmci,-graal" checking if jvmci module jdk.internal.vm.ci should be built... yes checking if graal module jdk.internal.vm.compiler should be built... yes checking if aot should be enabled… yes Isn’t the problem here simply incorrect syntax in that command line? Drop the quotes around the —with-jvm-features argument and I think it should work fine. Let me bring some clarity in the syntax here. For --with-jvm-features, if you want to list multiple features, you can separate them by either space or comma. Both are valid and officially supported. My recommendation, though, is to use comma, to avoid the problem with spaces in command line options. If you want to use spaces, you *must* use quotes. A command line like: bash configure --with-jvm-features=-aot -jvmci would be interpreted as "-jvmci" was a flag for configure, which it is not. There are multiple ways of quoting, you could use ' or ", and include the flag name like "--with-jvm-features=aot graal", or just the argument list. My preference, if I need to use quotes, is to use the style Vladimir uses in his example; I believe that maximizes readability. But, as I said, for --with-jvm-features, I recommend using comma instead, to avoid the quoting issue completely. Internally, the list of enabled/disabled features are treated as lists of space-separated words; but that is an implementation detail and not part of the command-line interface. /Magnus
Re: [13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
> On Jan 18, 2019, at 7:31 PM, Vladimir Ivanov > wrote: > > Thanks, Vladimir. > >> I usually used --with-jvm-features=-aot,-jvmci,-graal >> Did not work in this case too? > > I didn't know it supports comma-separated list, but it doesn't work as well: > > $ bash configure --with-jvm-features="-aot,-jvmci,-graal" > > checking if jvmci module jdk.internal.vm.ci should be built... yes > checking if graal module jdk.internal.vm.compiler should be built... yes > checking if aot should be enabled… yes Isn’t the problem here simply incorrect syntax in that command line? Drop the quotes around the —with-jvm-features argument and I think it should work fine.
Re: [13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
+1 Thanks Vladimir > On Jan 18, 2019, at 5:29 PM, Igor Ignatev wrote: > > Still looks good to me. > > — Igor > >> On Jan 18, 2019, at 5:26 PM, Vladimir Ivanov >> wrote: >> >> Updated webrev: >> http://cr.openjdk.java.net/~vlivanov/8217404/webrev.01 >> >> Verified that it works as expected on Linux, Windows, MacOS, and Solaris. >> >> Best regards, >> Vladimir Ivanov >> On 18/01/2019 16:39, Vladimir Ivanov wrote: Thanks, Igor. overall your fix looks reasonable, but w/ it we can get unintentionally disabled features (b/c grep doesn't do full word match). although this problem wasn't really introduced by your fix, I think it's be better to fix it as a part of your patch. I see two possible solutions: >>> I was aware of such drawback, but decided to leave it as is, since it >>> doesn't affect existing features. - add "-w" to grep, but I am not sure if "-w" is supported by all grep implementations - use $XARGS instead of $ECHO when we get DISABLE_X. in this case you will need to revert your changes in 'if test ...' lines >>> I'm in favor of using "-w" and I see different grep flags being used >>> already, but would like somebody from Build team confirm they are OK with >>> such solution. >>> Best regards, >>> Vladimir Ivanov > On Jan 18, 2019, at 3:33 PM, Vladimir Ivanov > wrote: > > http://cr.openjdk.java.net/~vlivanov/8217404/webrev.00/ > https://bugs.openjdk.java.net/browse/JDK-8217404 > > --with-jvm-features doesn't work properly when multiple features are > explicitly disabled: > > $ bash configure --with-jvm-features="-aot -jvmci -graal" > ... > checking if jvmci module jdk.internal.vm.ci should be built... yes > checking if graal module jdk.internal.vm.compiler should be built... yes > checking if aot should be enabled... yes > ... > > The problem in the following code: > > DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` > if test "x$DISABLE_AOT" = "xaot"; then >ENABLE_AOT="false" > fi > > Since DISABLED_JVM_FEATURES ("aot jvmci graal") contains the list of > explicitly disabled features, grep over it returns the whole list when > there's a match. The subsequent check fails because there's no exact > match, though DISABLE_AOT contains "aot" . > > Proposed fix is to check there's no match instead. > > After the fix it works as expected: > > $ bash configure --with-jvm-features="-aot -jvmci -graal" > ... > checking if jvmci module jdk.internal.vm.ci should be built... no, forced > checking if graal module jdk.internal.vm.compiler should be built... no, > forced > checking if aot should be enabled... no, forced > ... > > (The fix doesn't address the case when one feature has a name which is a > proper substring of another feature, but there are no such cases at the > moment.) > > Best regards, > Vladimir Ivanov >
Re: [13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
Still looks good to me. — Igor > On Jan 18, 2019, at 5:26 PM, Vladimir Ivanov > wrote: > > Updated webrev: > http://cr.openjdk.java.net/~vlivanov/8217404/webrev.01 > > Verified that it works as expected on Linux, Windows, MacOS, and Solaris. > > Best regards, > Vladimir Ivanov > >> On 18/01/2019 16:39, Vladimir Ivanov wrote: >> Thanks, Igor. >>> overall your fix looks reasonable, but w/ it we can get unintentionally >>> disabled features (b/c grep doesn't do full word match). although this >>> problem wasn't really introduced by your fix, I think it's be better to fix >>> it as a part of your patch. I see two possible solutions: >> I was aware of such drawback, but decided to leave it as is, since it >> doesn't affect existing features. >>> - add "-w" to grep, but I am not sure if "-w" is supported by all grep >>> implementations >>> - use $XARGS instead of $ECHO when we get DISABLE_X. in this case you >>> will need to revert your changes in 'if test ...' lines >> I'm in favor of using "-w" and I see different grep flags being used >> already, but would like somebody from Build team confirm they are OK with >> such solution. >> Best regards, >> Vladimir Ivanov On Jan 18, 2019, at 3:33 PM, Vladimir Ivanov wrote: http://cr.openjdk.java.net/~vlivanov/8217404/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8217404 --with-jvm-features doesn't work properly when multiple features are explicitly disabled: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... yes checking if graal module jdk.internal.vm.compiler should be built... yes checking if aot should be enabled... yes ... The problem in the following code: DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` if test "x$DISABLE_AOT" = "xaot"; then ENABLE_AOT="false" fi Since DISABLED_JVM_FEATURES ("aot jvmci graal") contains the list of explicitly disabled features, grep over it returns the whole list when there's a match. The subsequent check fails because there's no exact match, though DISABLE_AOT contains "aot" . Proposed fix is to check there's no match instead. After the fix it works as expected: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... no, forced checking if graal module jdk.internal.vm.compiler should be built... no, forced checking if aot should be enabled... no, forced ... (The fix doesn't address the case when one feature has a name which is a proper substring of another feature, but there are no such cases at the moment.) Best regards, Vladimir Ivanov >>>
Re: [13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
Updated webrev: http://cr.openjdk.java.net/~vlivanov/8217404/webrev.01 Verified that it works as expected on Linux, Windows, MacOS, and Solaris. Best regards, Vladimir Ivanov On 18/01/2019 16:39, Vladimir Ivanov wrote: Thanks, Igor. overall your fix looks reasonable, but w/ it we can get unintentionally disabled features (b/c grep doesn't do full word match). although this problem wasn't really introduced by your fix, I think it's be better to fix it as a part of your patch. I see two possible solutions: I was aware of such drawback, but decided to leave it as is, since it doesn't affect existing features. - add "-w" to grep, but I am not sure if "-w" is supported by all grep implementations - use $XARGS instead of $ECHO when we get DISABLE_X. in this case you will need to revert your changes in 'if test ...' lines I'm in favor of using "-w" and I see different grep flags being used already, but would like somebody from Build team confirm they are OK with such solution. Best regards, Vladimir Ivanov On Jan 18, 2019, at 3:33 PM, Vladimir Ivanov wrote: http://cr.openjdk.java.net/~vlivanov/8217404/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8217404 --with-jvm-features doesn't work properly when multiple features are explicitly disabled: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... yes checking if graal module jdk.internal.vm.compiler should be built... yes checking if aot should be enabled... yes ... The problem in the following code: DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` if test "x$DISABLE_AOT" = "xaot"; then ENABLE_AOT="false" fi Since DISABLED_JVM_FEATURES ("aot jvmci graal") contains the list of explicitly disabled features, grep over it returns the whole list when there's a match. The subsequent check fails because there's no exact match, though DISABLE_AOT contains "aot" . Proposed fix is to check there's no match instead. After the fix it works as expected: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... no, forced checking if graal module jdk.internal.vm.compiler should be built... no, forced checking if aot should be enabled... no, forced ... (The fix doesn't address the case when one feature has a name which is a proper substring of another feature, but there are no such cases at the moment.) Best regards, Vladimir Ivanov
Re: [13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
Thanks, Igor. overall your fix looks reasonable, but w/ it we can get unintentionally disabled features (b/c grep doesn't do full word match). although this problem wasn't really introduced by your fix, I think it's be better to fix it as a part of your patch. I see two possible solutions: I was aware of such drawback, but decided to leave it as is, since it doesn't affect existing features. - add "-w" to grep, but I am not sure if "-w" is supported by all grep implementations - use $XARGS instead of $ECHO when we get DISABLE_X. in this case you will need to revert your changes in 'if test ...' lines I'm in favor of using "-w" and I see different grep flags being used already, but would like somebody from Build team confirm they are OK with such solution. Best regards, Vladimir Ivanov On Jan 18, 2019, at 3:33 PM, Vladimir Ivanov wrote: http://cr.openjdk.java.net/~vlivanov/8217404/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8217404 --with-jvm-features doesn't work properly when multiple features are explicitly disabled: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... yes checking if graal module jdk.internal.vm.compiler should be built... yes checking if aot should be enabled... yes ... The problem in the following code: DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` if test "x$DISABLE_AOT" = "xaot"; then ENABLE_AOT="false" fi Since DISABLED_JVM_FEATURES ("aot jvmci graal") contains the list of explicitly disabled features, grep over it returns the whole list when there's a match. The subsequent check fails because there's no exact match, though DISABLE_AOT contains "aot" . Proposed fix is to check there's no match instead. After the fix it works as expected: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... no, forced checking if graal module jdk.internal.vm.compiler should be built... no, forced checking if aot should be enabled... no, forced ... (The fix doesn't address the case when one feature has a name which is a proper substring of another feature, but there are no such cases at the moment.) Best regards, Vladimir Ivanov
Re: [13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
Thanks, Vladimir. I usually used --with-jvm-features=-aot,-jvmci,-graal Did not work in this case too? I didn't know it supports comma-separated list, but it doesn't work as well: $ bash configure --with-jvm-features="-aot,-jvmci,-graal" checking if jvmci module jdk.internal.vm.ci should be built... yes checking if graal module jdk.internal.vm.compiler should be built... yes checking if aot should be enabled... yes Best regards, Vladimir Ivanov On 1/18/19 3:33 PM, Vladimir Ivanov wrote: http://cr.openjdk.java.net/~vlivanov/8217404/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8217404 --with-jvm-features doesn't work properly when multiple features are explicitly disabled: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... yes checking if graal module jdk.internal.vm.compiler should be built... yes checking if aot should be enabled... yes ... The problem in the following code: DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` if test "x$DISABLE_AOT" = "xaot"; then ENABLE_AOT="false" fi Since DISABLED_JVM_FEATURES ("aot jvmci graal") contains the list of explicitly disabled features, grep over it returns the whole list when there's a match. The subsequent check fails because there's no exact match, though DISABLE_AOT contains "aot" . Proposed fix is to check there's no match instead. After the fix it works as expected: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... no, forced checking if graal module jdk.internal.vm.compiler should be built... no, forced checking if aot should be enabled... no, forced ... (The fix doesn't address the case when one feature has a name which is a proper substring of another feature, but there are no such cases at the moment.) Best regards, Vladimir Ivanov
Re: [13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
Hi Vladimir, overall your fix looks reasonable, but w/ it we can get unintentionally disabled features (b/c grep doesn't do full word match). although this problem wasn't really introduced by your fix, I think it's be better to fix it as a part of your patch. I see two possible solutions: - add "-w" to grep, but I am not sure if "-w" is supported by all grep implementations - use $XARGS instead of $ECHO when we get DISABLE_X. in this case you will need to revert your changes in 'if test ...' lines Thanks, -- Igor > On Jan 18, 2019, at 3:33 PM, Vladimir Ivanov > wrote: > > http://cr.openjdk.java.net/~vlivanov/8217404/webrev.00/ > https://bugs.openjdk.java.net/browse/JDK-8217404 > > --with-jvm-features doesn't work properly when multiple features are > explicitly disabled: > > $ bash configure --with-jvm-features="-aot -jvmci -graal" > ... > checking if jvmci module jdk.internal.vm.ci should be built... yes > checking if graal module jdk.internal.vm.compiler should be built... yes > checking if aot should be enabled... yes > ... > > The problem in the following code: > > DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` > if test "x$DISABLE_AOT" = "xaot"; then >ENABLE_AOT="false" > fi > > Since DISABLED_JVM_FEATURES ("aot jvmci graal") contains the list of > explicitly disabled features, grep over it returns the whole list when > there's a match. The subsequent check fails because there's no exact match, > though DISABLE_AOT contains "aot" . > > Proposed fix is to check there's no match instead. > > After the fix it works as expected: > > $ bash configure --with-jvm-features="-aot -jvmci -graal" > ... > checking if jvmci module jdk.internal.vm.ci should be built... no, forced > checking if graal module jdk.internal.vm.compiler should be built... no, > forced > checking if aot should be enabled... no, forced > ... > > (The fix doesn't address the case when one feature has a name which is a > proper substring of another feature, but there are no such cases at the > moment.) > > Best regards, > Vladimir Ivanov
Re: [13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
I usually used --with-jvm-features=-aot,-jvmci,-graal Did not work in this case too? Anyway your fix is good. Thanks, Vladimir On 1/18/19 3:33 PM, Vladimir Ivanov wrote: http://cr.openjdk.java.net/~vlivanov/8217404/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8217404 --with-jvm-features doesn't work properly when multiple features are explicitly disabled: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... yes checking if graal module jdk.internal.vm.compiler should be built... yes checking if aot should be enabled... yes ... The problem in the following code: DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` if test "x$DISABLE_AOT" = "xaot"; then ENABLE_AOT="false" fi Since DISABLED_JVM_FEATURES ("aot jvmci graal") contains the list of explicitly disabled features, grep over it returns the whole list when there's a match. The subsequent check fails because there's no exact match, though DISABLE_AOT contains "aot" . Proposed fix is to check there's no match instead. After the fix it works as expected: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... no, forced checking if graal module jdk.internal.vm.compiler should be built... no, forced checking if aot should be enabled... no, forced ... (The fix doesn't address the case when one feature has a name which is a proper substring of another feature, but there are no such cases at the moment.) Best regards, Vladimir Ivanov
[13] RFR (S): 8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled
http://cr.openjdk.java.net/~vlivanov/8217404/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8217404 --with-jvm-features doesn't work properly when multiple features are explicitly disabled: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... yes checking if graal module jdk.internal.vm.compiler should be built... yes checking if aot should be enabled... yes ... The problem in the following code: DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` if test "x$DISABLE_AOT" = "xaot"; then ENABLE_AOT="false" fi Since DISABLED_JVM_FEATURES ("aot jvmci graal") contains the list of explicitly disabled features, grep over it returns the whole list when there's a match. The subsequent check fails because there's no exact match, though DISABLE_AOT contains "aot" . Proposed fix is to check there's no match instead. After the fix it works as expected: $ bash configure --with-jvm-features="-aot -jvmci -graal" ... checking if jvmci module jdk.internal.vm.ci should be built... no, forced checking if graal module jdk.internal.vm.compiler should be built... no, forced checking if aot should be enabled... no, forced ... (The fix doesn't address the case when one feature has a name which is a proper substring of another feature, but there are no such cases at the moment.) Best regards, Vladimir Ivanov