bugGNU Octave - Bugs: bug #45410, report a warning if a +package...

 
 

bug #45410: report a warning if a +package directory is added to the path

Submitted by:  Richard <crobar>
Submitted on:  Thu 25 Jun 2015 09:19:04 PM UTC  
 
Category: InterpreterSeverity: 2 - Minor
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Richard CrozierOpen/Closed: Closed
Release: 4.0.0Operating 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 Jump to the original submission)

Fri 01 Sep 2017 10:38:17 PM UTC, comment #11:

I added a warning to Octave when adding package directories to the path. See cset (http://hg.savannah.gnu.org/hgweb/octave/rev/8785b3717140). I created a new warning ID "Octave:addpath-pkg". If you want identical behavior to Matlab you can use

I didn't bother to set this option when Octave is invoked with --traditional, but someone could if they really feel bothered about it.

Rik <rik5>
Project Administrator
Tue 30 Jun 2015 05:52:22 PM UTC, comment #10:

Well, I guess TMW have decided that if they state that you should not add directories of a certain type to the path, they should prevent it from happening, and warn you that it's not been done.

It can be helpful when automatically adding a load of directories to a path (which is exactly what my initialisation script does, stripping version control directories).

Richard <crobar>
Tue 30 Jun 2015 04:20:14 PM UTC, comment #9:

If the user explicitly adds a directory to the path, then we should add it to the path. Maybe we can also print a warning but why prevent it if that's what the user wants to do?

Carnë Draug <carandraug>
Project Member
Tue 30 Jun 2015 02:15:28 PM UTC, comment #8:

I can confirm that adding a "+package" folder to the path issues a warning and does not add the folder as a result.

Perhaps they should have issued an error instead..

(Tested in latest R2015a)

Amro <amro_octave>
Tue 30 Jun 2015 02:06:53 PM UTC, comment #7:

@mtmiller
Done, see bug #45444

Feel free to delete my previous comment in this thread.

Amro <amro_octave>
Tue 30 Jun 2015 01:37:57 PM UTC, comment #6:

So the remaining bug here is that Matlab reports a warning if a +-directory is added to the path. Are you sure that the directory is not added to the path? To me a warning message means that something was done anyway.

Mike Miller <mtmiller>
Project Administrator
Tue 30 Jun 2015 01:34:56 PM UTC, comment #5:

Amro, please report that as a separate bug for private functions inside namespace and class directories.

Mike Miller <mtmiller>
Project Administrator
Fri 26 Jun 2015 01:48:02 PM UTC, comment #4:

I wasn't sure if I should create a new bug or just update the current one, but here is an actual issue related to path, packages and classes, and private functions:

where "bar.m" is a function that calls a private function "baz.m".

and

In Octave the following fails (while it works fine in MATLAB):

I had to explicitly add the private folder to the path for it to work:


Similarly, private functions inside @-class folders:

Trying to call "myfun.m" from class methods will generate a similar 'undefined function' error...

Amro <amro_octave>
Fri 26 Jun 2015 01:44:50 PM UTC, comment #3:

I wasn't sure if I should create a new bug or just update the current one, but here is an actual issue related to path, packages/classes, and private functions:

Amro <amro_octave>
Fri 26 Jun 2015 07:30:49 AM UTC, comment #2:

Actually you're right, sorry, I was seeing a bug in my own code. I should have investigated more carefully.

However, there is still a possible minor bug regarding matlab compatibility. In Matlab addpath prevents adding the +directory to the path, you get a warning and the path is not addded:

In octave nothing prevents you from adding it to the path. I've no idea if it's an issue.

Richard <crobar>
Fri 26 Jun 2015 12:29:26 AM UTC, comment #1:

Thanks for your bug report. I'm not sure what you mean by this. The directory containing the +package directory does need to be added to the path, but not the +package directory itself.

Are you seeing something different? Are you expecting something different?

Mike Miller <mtmiller>
Project Administrator
Thu 25 Jun 2015 09:19:04 PM UTC, original submission:

In Octave +package directories must be on the path.

However, in Matlab they must explicitly not be added to path, and addpath refuses to add them. They are more like private directories in this respect.

Richard <crobar>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by amro_octave (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by crobar (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 01 Sep 2017 10:38:17 PM UTCrik5StatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Tue 30 Jun 2015 01:37:57 PM UTCmtmillerSeverity3 - Normal=>2 - Minor
      Summaryin Octave +package directories must be on path, in ML they must not be added to path=>report a warning if a +package directory is added to the path
    Fri 26 Jun 2015 12:29:26 AM UTCmtmillerCategoryNone=>Interpreter
      StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1