bugGNU Octave - Bugs: bug #44548, pkg install defaults to global in...

 
 

bug #44548: pkg install defaults to global in Microsoft Windows

Submitted by:  Oliver Heimlich <oheim>
Submitted on:  Mon 16 Mar 2015 06:36:45 AM UTC  
 
Category: Octave FunctionSeverity: 1 - Wish
Priority: 5 - NormalItem Group: Feature Request
Status: ConfirmedAssigned to: None
Originator Name: Oliver HeimlichOpen/Closed: Open
Release: 4.0.0Operating 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 Jump to the original submission)

Fri 23 Dec 2016 09:58:19 PM UTC, comment #8:

This issue is probably still present in Octave 4.2.0.

There has been a PATCH proposed in comment #6.

Hartmut <hardy>
Tue 02 Jun 2015 04:33:45 PM UTC, comment #7:

Retagging release from 4.0.0-rc1 to 4.0.0.

John W. Eaton <jwe>
Project Administrator
Tue 17 Mar 2015 01:00:48 PM UTC, comment #6:

Please consider the revised patch, which also works with a fresh installation of GNU Octave that has not created package directories yet.

(file #33376)

Oliver Heimlich <oheim>
Tue 17 Mar 2015 08:13:29 AM UTC, comment #5:

I have developed and tested the attached patch (I created a new private dirwritable as a replacement for your iswritable). On Microsoft Windows it checks for required permissions and defaults to “-global” iff that is possible. Effectively you get the following behaviour (unless you completely mess with your file system permissions of course).

Run as administrator: Defaults to -global
GNU Octave was installed in the user's folder (or any other writable place): Defaults to -global
GNU Octave was installed in %ProgramFiles%: Defaults to -local

During testing I stumbled upon bug #43557 a lot, but that is a different topic.

(file #33374)

Oliver Heimlich <oheim>
Mon 16 Mar 2015 09:54:20 PM UTC, comment #4:

I haven't used or have access to windows in ages. Would be nice if you could provide a patch that does and test it. For now, it might be better to go for the simpler option. If the logic changes too much, then it might not be a good candidate for 4.0.

Carnë Draug <carandraug>
Project Member
Mon 16 Mar 2015 07:22:23 PM UTC, comment #3:

Checking “properly” for permissions is a hard thing to do, because you would have to implement the required system calls and consider different file systems and possibly network shares. The creation of a temporary file is a reliable method for testing permissions.

If the user does not provide -global or -local, the default should depend on the file permissions (in Microsoft Windows only!).

Then, the user may install GNU Octave into a public location (e. g. %ProgramFiles%), where pkg install would default to -local (unless run as administrator). And when installed in a writable place (e. g. %USERPROFILE%) it would default to -global and packages would be installed into the program folder.

Another solution would be to use -local as default in Microsoft Windows, because this would be simple and work in either case.

Oliver Heimlich <oheim>
Mon 16 Mar 2015 04:27:43 PM UTC, comment #2:

Defaulting to global on windows seems to be design

http://hg.savannah.gnu.org/hgweb/octave/file/fc6c87e254bf/scripts/pkg/pkg.m#l292

although it may be so because of not knowing how to check properly for permissions on that system.

I had a a fix for this some years ago which involved checking permissions by actually trying to create an empty file. I committed it to a development work for pkg https://bitbucket.org/carandraug/octave/commits/a240810c24d1 but I can't graft it now since it has a lot of other changes that are not really ready to be merged. The iswritable function used there seems to be missing as well :(

Carnë Draug <carandraug>
Project Member
Mon 16 Mar 2015 02:16:30 PM UTC, comment #1:

Thanks for your bug report. Yes, the default is to do a global install on Windows, or on unixy systems if you are the superuser. There is a FIXME comment in pkg.m about whether this could be done in a different way on Windows. And as you saw, the "-local" option is always available to override the default.

Btw, I think there has been some discussion to eliminate the distinction between global and local package installation in the larger plans for the pkg command, but I can't remember exactly.

Mike Miller <mtmiller>
Project Administrator
Mon 16 Mar 2015 06:36:45 AM UTC, original submission:

I have tested the 4.0.0-rc1 on Microsoft Windows 7 and ran into a problem installing packages (from Octave Forge). I have used “pkg install -forge packagename” and GNU Octave tried to install the package globally. However, the application has been run without administrator privileges and failed to write into the program folder. “pkg install -local” works perfectly.

I suggest to change the bevaiour of pkg as follows (in Microsoft Windows): If the application is run with administrator privileges (or better check for write permission on the program folder?!), pkg uses -global. Otherwise it uses -local.

This would be consistent with the behaviour on GNU/Linux, where GNU Octave installs packages globally with root privileges only.

Oliver Heimlich <oheim>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #33376:  bug-44548.diff added by oheim (4KiB - text/x-patch)
file #33374:  bug-44548.diff added by oheim (4KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by hardy (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by oheim (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 02 Jun 2015 04:33:45 PM UTCjweRelease4.0.0-rc1=>4.0.0
    Tue 17 Mar 2015 01:00:48 PM UTCoheimAttached File-=>Added bug-44548.diff, #33376
    Tue 17 Mar 2015 08:13:29 AM UTCoheimAttached File-=>Added bug-44548.diff, #33374
    Mon 16 Mar 2015 02:16:39 PM UTCmtmillerStatusNone=>Confirmed
    Mon 16 Mar 2015 02:16:30 PM UTCmtmillerSeverity3 - Normal=>1 - Wish
      Item GroupInstallation Failure=>Feature Request
      Summarypkg install fails in Microsoft Windows (file permission)=>pkg install defaults to global in Microsoft Windows

    Back to the top


    Powered by Savane 3.1-cleanup1