bugGNU Octave - Bugs: bug #57826, pkg: install extracts docstrings...


bug #57826: pkg: install extracts docstrings from all m-files files recursively

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Sat 15 Feb 2020 09:22:02 PM UTC  
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
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.


Mon 04 May 2020 09:32:31 PM UTC, comment #1: 

Also affected by this, 'pkg install' may find incompatible oct files under the or any arbitrary other files that contain something that looks like it should be an Octave file, which could cause a docstring extraction error.

Found when trying to install the same package for use by multiple versions of Octave at the same time. Octave errors when it finds oct files that were compiled for a different API version, even though they are in a correctly labeled API directory.

Mike Miller <mtmiller>
Project Administrator
Sat 15 Feb 2020 09:22:02 PM UTC, original submission:  

When installing a package, the local function 'generate_lookfor_cache' uses 'genpath' to find all subdirectories of a package when extracting docstrings.

A package may contain an 'inst' directory with subdirectories that aren't added to the load path when the package is actually used, and they should not be included in the docstring cache.

So ideally, the 'generate_lookfor_cache' will call 'addpath' to determine which subdirectories are actually going to be added to the path (e.g. with PKG_ADD).


  • A package may have an 'inst/contrib', 'inst/examples', or 'inst/legacy' subdirectory with m-files that the maintainer doesn't want added to the load path by default.
  • A package may have an 'inst/octave-7' subdirectory with m-files copied from a newer version of Octave that should only be loaded conditionally.

See https://github.com/apjanke/octave-testify/issues/95

Mike Miller <mtmiller>
Project Administrator


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


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.




Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2020-02-15 mtmiller Carbon-CopyRemoved 80942 => -

Back to the top

Powered by Savane 3.5