bugGNU Octave - Bugs: bug #54287, [octave forge] (miscellaneous)...

 
 

bug #54287: [octave forge] (miscellaneous) error occurs when running 'units' function

Submitted by:  Andrei Bobrov <abobroff>
Submitted on:  Wed 11 Jul 2018 05:40:50 AM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error
Status:  Fixed Assigned to:  John Donoghue <lostbard>
Originator Name:  Andrei Bobrov Open/Closed:  Closed
Release:  dev Operating System:  Microsoft Windows

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)

Thu 12 Jul 2018 01:50:15 PM UTC, comment #11:

closing as fixed

John Donoghue <lostbard>
Project MemberIn charge of this item.
Thu 12 Jul 2018 12:04:06 AM UTC, comment #10:

the actual hg repo for miscellaneous has already been changed back in august, just hasnt had a release since 2014.

John Donoghue <lostbard>
Project MemberIn charge of this item.
Wed 11 Jul 2018 11:58:39 PM UTC, comment #9:

Actually was already pushed up within minutes of the other patch.

http://hg.octave.org/mxe-octave/rev/a08799ef1197

John Donoghue <lostbard>
Project MemberIn charge of this item.
Wed 11 Jul 2018 08:38:01 PM UTC, comment #8:

Good job, works fine now.

Will you close the report after the octave_config_info patch? I suppose that could be an mxe-octave patch for now as only 5.0.0 needs it.

Philip Nienhuis <philipnienhuis>
Project Member
Wed 11 Jul 2018 05:36:46 PM UTC, comment #7:

Pushed http://hg.octave.org/mxe-octave/rev/46bf69e11b71

John Donoghue <lostbard>
Project MemberIn charge of this item.
Wed 11 Jul 2018 04:51:07 PM UTC, comment #6:

I'll add a patch for octave_config_info as well

John Donoghue <lostbard>
Project MemberIn charge of this item.
Wed 11 Jul 2018 04:25:23 PM UTC, comment #5:

The newer code appears to support lookup in windows based on location of the execuble, so I am hoping to get that working in this case.

John Donoghue <lostbard>
Project MemberIn charge of this item.
Wed 11 Jul 2018 02:43:58 PM UTC, comment #4:

Yeah, hard-coding dependency locations into an application looks unwise and fragile to me. I am curious how you're going to deal with it.

As to he units.m function, I think it is wise to replace the call to octave_config_info() into __octave_config_info__() anyway as the former was deprecated in 4.2 and will be removed after 4.4, and the latter seems to stay.

Philip Nienhuis <philipnienhuis>
Project Member
Wed 11 Jul 2018 01:32:28 PM UTC, comment #3:

It looks like it broke over a year ago!

I'm working on a fix to units that will get it back to working

In the mean time as per comment #2, overriding the the env vars will work

John Donoghue <lostbard>
Project MemberIn charge of this item.
Wed 11 Jul 2018 12:05:54 PM UTC, comment #2:

Confirmed with Octave-5.0.0 on Win 7.
The lack of octave_config_info is a showstopper on 5.0.0, but that can be worked around, the actual problem lies deeper and I'm unsure whether it is an octave-forge or an mxe-octave cross-build issue.

Firstly, the octave-config_info() call in subfunc check_units (L.115-122) can be replaced by _octave_config_info_().
With that out of the way, I get similar errors:

... where Octave-5.0.0's units files on my Windows 7 box live in
C:\Programs\Octave\Octave-5.0.0_20180711\share\units

Clearly the install directories for the cross-build on the linux side (before zipping it up into the installer) get to be hard-coded in the units.exe program, see attached pic.

Next, specifying the units files on the command line gets me this:

.. and asking for program info gives a few clues:

Setting the environment variables UNITSFILE and UNITSLOCALEMAP makes the units program and the units function work:

A workaround could be to automatically set these environment variables when the miscellaneous package gets loaded. Quite an involved operation.

I tried adding the actual location of the definitions.units file using units.exe's -f command line option to the template command in L.121 and L.130, to no avail.
Same for the locale.

Adding the setenv() calls to the start of units.m gives:

..so that does work to some extent.

I'm running out of time, hopefully my experiments may help someone to get further.

(file #44539)

Philip Nienhuis <philipnienhuis>
Project Member
Wed 11 Jul 2018 11:59:40 AM UTC, comment #1:

Confirmed

'miscellaneous' runs the units program to to do the conversions and is looking for the units definition file in the cross built path rather than the windows path.

I'll take a look at what changed

John Donoghue <lostbard>
Project MemberIn charge of this item.
Wed 11 Jul 2018 05:40:50 AM UTC, original submission:

>> units('bar','Pa')

warning: octave_config_info is obsolete and will be removed from a future
version of Octave, please use _have_feature_ or _octave_config_info_
instead.
warning: called from
octave_config_info at line 43 column 5
units>check_units at line 110 column 9
units at line 50 column 3
units: cannot open units data file
'/scratch/build/mxe-octave-w64-32-stable/usr/x86_64-w64-mingw32/share/units/definitions.units'.
No such file or directory
units: cannot open units data file
'/scratch/build/mxe-octave-w64-32-stable/usr/x86_64-w64-mingw32/share/units/definitions.units'.
No such file or directory
units: cannot open units data file
'/scratch/build/mxe-octave-w64-32-stable/usr/x86_64-w64-mingw32/share/units/definitions.units'.
No such file or directory
error: units:
error: called from
units at line 59 column 5

>>

Andrei Bobrov <abobroff>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #44539:  units_binary.PNG added by philipnienhuis (117KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by abobroff (Submitted 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 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-12 lostbard StatusReady For Test => Fixed
        Assigned toNone => lostbard
        Open/ClosedOpen => Closed
        Summaryerror when running function 'units' from 'miscellaneous' toolbox => [octave forge] (miscellaneous) error occurs when running 'units' function
    2018-07-11 lostbard StatusConfirmed => Ready For Test
    2018-07-11 philipnienhuis Attached File- => Added units_binary.PNG, #44539
        Item GroupMissed Error or Warning => Unexpected Error
        Assigned tolostbard => None
        Release4.4.0 => dev
    2018-07-11 lostbard StatusNone => Confirmed
        Assigned toNone => lostbard

    Back to the top


    Powered by Savane 3.3