bugGNU Octave - Bugs: bug #45872, default site octaverc file still...

 
 

bug #45872: default site octaverc file still executed even if OCTAVE_SITE_INITFILE is defined

Submitter:  John W. Eaton <jwe>
Submitted:  Thu 03 Sep 2015 11:25:56 PM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  jwe Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 04 Sep 2015 07:28:59 PM UTC, comment #4: 

Works great, including the --verbose option.  Closing report.

Rik <rik5>
Group administrator
Fri 04 Sep 2015 05:47:13 PM UTC, comment #3: 

I checked in this change:

http://hg.savannah.gnu.org/hgweb/octave/rev/ac0f7acdc3fd

Also, Octave will tell you which startup files it is executing if you use the --verbose option, though I suppose if there were a bug in that code, inserting the printf statements would help.  :-)

John W. Eaton <jwe>
Group administrator
Fri 04 Sep 2015 04:35:38 PM UTC, comment #2: 

Thanks.  I agree with renaming the files so the correspondence to the environment variables is clear.

Probably all we need to do to fix the problem I was seeing is also define OCTAVE_VERSION_INITFILE in the run-octave script.

I'll make these changes.

John W. Eaton <jwe>
Group administrator
Fri 04 Sep 2015 12:32:37 PM UTC, comment #1: 

Confirmed.

I instrumented all the rc files including scripts/startup/main-rcfile, scripts/startup/local-rcfile, <OCTAVE_INSTALL_DIR>/share/octave/4.1.0+/m/startup/octaverc, <OCTAVE_INSTALL_DIR>/share/site/m/startup/octaverc, ~/.octaverc, ./.octaverc with the following code:


printf ("Executing %s\n", mfilename ("fullpathext"));


If I now use the run-octave script I get the following:


Executing /home/rik/wip/Projects_Mine/octave-dev/scripts/startup/main-rcfile
Executing /home/rik/downloads/local/share/octave/4.1.0+/m/startup/octaverc
Executing /home/rik/.octaverc
Executing /home/rik/wip/Projects_Mine/octave-dev/.octaverc


This seems to be expected behavior, although not necessarily correct.  The run-octave script overrides OCTAVE_SITE_INITFILE which is startup/main-rcfile.  But 'make install' places main-rcfile into the versioned site file octave/4.1.0+/m/startup/octaverc.  To eliminate running main-rcfile twice the variable OCTAVE_VERSION_INITFILE needs to be pointing somewhere else.

Or, we have had this wrong for several years and the local-rcfile should be placed into the versioned directory and the main-rcfile should be placed in the startup directory.

For clarity, I think it would be a good idea to rename the files from [main|local]-rcfile to [site|version]-rcfile.  At least then it will be clear what we are doing with these files.

Rik <rik5>
Group administrator
Thu 03 Sep 2015 11:25:56 PM UTC, original submission:  

If OCTAVE_SITE_INITFILE is defined in the environment, Octave uses that as the site startup file but will also execute the default site init file.  I see this problem when using the run-octave script in my build tree when I also have the same development version installed.

I first noticed this when working on bug #45869 because finish.m was being executed twice.  I traced that to having _finish_ added twice to the list of atexit functions, once from the octaverc file in the build tree and once from the directory where I had previously installed a copy of Octave from the same sources.

John W. Eaton <jwe>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-09-04 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2015-09-04 jwe StatusConfirmed Ready For Test
    2015-09-04 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code