bugGNU Octave - Bugs: bug #55429, javachk should be able to report...

 
 

bug #55429: javachk should be able to report whether HAVE_JAVA is enabled

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Wed 09 Jan 2019 06:14:13 PM UTC  
 
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Sat 12 Oct 2019 05:41:51 AM UTC, comment #8: 

Thanks. The buildbot seems to be happy with that change.
Closing as fixed again.

Markus Mützel <mmuetzel>
Project Member
Fri 11 Oct 2019 04:18:20 PM UTC, comment #7: 

@Markus: The behavior of javachk is correct, it is just the BIST tests that need to be updated to the new behavior.  I checked in a change for that here https://hg.savannah.gnu.org/hgweb/octave/rev/1dbe2d38673f.

Marking as "Ready for Test".

Rik <rik5>
Project Administrator
Fri 11 Oct 2019 03:16:48 PM UTC, comment #6: 

This change seems to have caused the "no-extras-debian" buildbot to fail. The error messages seem to have changed:

>>>>> processing /scratch/buildbot/workers/jwe-debian-x86_64-2/no-extras-debian/src/scripts/java/javachk.m
***** test
msg = javachk ("desktop");
assert (msg.message, "javachk: this function is not supported, Java feature \"desktop\" is not available");
assert (msg.identifier, "Octave:javachk:feature-not-available");
!!!!! test failed
ASSERT errors for:  assert (msg.message,"javachk: this function is not supported, Java feature \"desktop\" is not available")
  Location  |  Observed  |  Expected  |  Reason
     []      javachk: this function is not supported, Octave was not compiled with Java support javachk: this function is not supported, Java feature "desktop" is not available   Strings don't match
***** test
msg = javachk ("desktop", "Java DESKTOP");
assert (msg.message, "javachk: Java DESKTOP is not supported, Java feature \"desktop\" is not available");
assert (msg.identifier, "Octave:javachk:feature-not-available");
!!!!! test failed
ASSERT errors for:  assert (msg.message,"javachk: Java DESKTOP is not supported, Java feature \"desktop\" is not available")
  Location  |  Observed  |  Expected  |  Reason
     []      javachk: Java DESKTOP is not supported, Octave was not compiled with Java support javachk: Java DESKTOP is not supported, Java feature "desktop" is not available   Strings don't match
***** test
msg = javachk ("nosuchfeature");
assert (msg.message, "javachk: this function is not supported, Java feature \"nosuchfeature\" is not available");
assert (msg.identifier, "Octave:javachk:feature-not-available");
!!!!! test failed

Re-opening.

Markus Mützel <mmuetzel>
Project Member
Mon 23 Sep 2019 01:02:29 AM UTC, comment #5: 

Great.  I pushed the change here (https://hg.savannah.gnu.org/hgweb/octave/rev/ece17410605e).  Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Sun 22 Sep 2019 08:03:20 PM UTC, comment #4: 

This change looks good to me. It should be simple enough for packages and user code to just call 'error (javachk ("jvm"))' as an assertion to test for both Java support compiled in and available at run time.

Mike Miller <mtmiller>
Project Administrator
Fri 20 Sep 2019 11:40:04 PM UTC, comment #3: 

@Mike: I'm attaching a patch for review that adds a test for whether Octave was compiled with Java support and adjusts the error message to be informative about this.

(file #47556)

Rik <rik5>
Project Administrator
Tue 26 Feb 2019 08:42:31 PM UTC, comment #2: 

Octave 5 javachk returns the correct struct on success now.

The remaining issue is possibly adding more expressive error messages for different reasons of not finding Java. The error message is intended to be able to be passed directly to the 'error' function, so it should be a helpful message for the user.

Mike Miller <mtmiller>
Project Administrator
Wed 09 Jan 2019 08:00:20 PM UTC, comment #1: 

This is a Matlab compatible function so we have to stay within the interface dictated by Matlab. If this works with what is needed, good, otherwise maybe a new function is still needed to differentiate "Octave has support for possibly loading Java" from "Octave has loaded Java".

I still suspect we can integrate this into 'javachk', so that javachk('jvm') can return different informative error messages like "Octave was compiled without support for Java" versus "Octave is unable to find a Java Virtual Machine under JAVA_HOME", etc.

But the return value is definitely wrong, it should always return a struct. The dimensions of the struct should be 0×1 on success, so that 'isempty' is true.

Mike Miller <mtmiller>
Project Administrator
Wed 09 Jan 2019 06:14:13 PM UTC, original submission:  

In additional to detecting various run time features of Java, the function javachk should also be able to report whether HAVE_JAVA is enabled or disabled, i.e. whether the user can expect that fixing JAVA_HOME or javaclasspath will help or whether they need to install a different copy of Octave.

In addition it would be nice if the return value were a struct consistently, instead of being an empty string on success and a struct on failure.

Feel free to discuss other design ideas here. This function should be useful for user code and packages that use Java to detect and diagnose Java installation problems.

Mike Miller <mtmiller>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #47556:  bug55429.cset added by rik5 (3KiB - application/octet-stream)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-10-12 mmuetzel StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2019-10-11 rik5 StatusIn Progress => Ready For Test
    2019-10-11 mmuetzel StatusFixed => In Progress
        Open/ClosedClosed => Open
    2019-09-23 rik5 StatusPatch Reviewed => Fixed
        Open/ClosedOpen => Closed
    2019-09-22 mtmiller StatusPatch Submitted => Patch Reviewed
    2019-09-20 rik5 Attached File- => Added bug55429.cset, #47556
        StatusPostponed => Patch Submitted
    2019-02-26 mtmiller Priority5 - Normal => 3 - Low
    2019-01-09 mtmiller Carbon-CopyRemoved 80942 => -
    2019-01-09 mtmiller Dependencies- => bugs #47480 is dependent

    Back to the top


    Powered by Savane 3.5