bugGNU Octave - Bugs: bug #45813, geometry-2.0.0 fails to install on...

 
 

bug #45813: geometry-2.0.0 fails to install on windows

Submitter:  None
Submitted:  Mon 24 Aug 2015 02:54:02 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Installation Failure
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 06 Oct 2015 05:50:41 PM UTC, comment #21: 

Sure enough, with the latest patches (make_absolute_filename, comment #10) geometry pkg installs fine on Win7 with Octave-3.9.0+ (where I checked that canonicalize_file_name had the old buggy behavior).

I think nothing is in the way of a new geometry pkg release, then?

Philip Nienhuis <philipnienhuis>
Group Member
Sun 27 Sep 2015 10:05:09 PM UTC, comment #20: 

OK OK, I'll give it another try. Can't say when, probably early next week.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 27 Sep 2015 08:58:59 PM UTC, comment #19: 

Hi,

Ok in dev version now I am using make_absolute_filename and not filesep("all") anymore.

Also fixed some of the typos.

Could anybody check everything works fine in Windoze?



Juan Pablo Carbajal <juanpi>
Group Member
Sun 27 Sep 2015 04:41:57 PM UTC, comment #18: 

@Mike:
Sure, simply replacing strsplit by ostrsplit fixes this:

>> dirname = 'C:/Programs/Octave/Octave-4.1.0+_w64/share/octave/packages/geometry2.0.0';
>> strsplit (dirname,filesep ("all"), true)
ans =
{
  [1,1] = C:/Programs/Octave/Octave-4.1.0+_w64/share/octave/packages/geometry-2.0.0
}
>> ostrsplit (dirname,filesep ("all"), true)
ans =
{
  [1,1] = C:
  [1,2] = Programs
  [1,3] = Octave
  [1,4] = Octave-4.1.0+_w64
  [1,5] = share
  [1,6] = octave
  [1,7] = packages
  [1,8] = geometry-2.0.0
}
>>


But the canonicalize_file_name fix (bug #45816) also fixes the original bug here.
Replacing canoicalize_file_name by make_absolute_filename would also do as geometry-2.0.0.tar.gz is guaranteed to exist once PKG_ADD is invoked.

So all in all the geometry package maintainer has a lot of options :-)

I retreat from here, I think I (like you) have done my share.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 26 Sep 2015 10:30:03 PM UTC, comment #17: 

Okay, I checked and the way the delimiter argument is handled is a difference between the old strsplit (now "ostrsplit") and the Matlab compatible strsplit.

I still think that PKG_ADD could be fixed so that it can work with a mix of slashes and backslashes, using filesep("all").


delim = cellstr (filesep ("all")(:));


should give a cell array of possible directory delimiters. This can be given to the strsplit calls.

Mike Miller <mtmiller>
Group Member
Sat 26 Sep 2015 11:26:27 AM UTC, comment #16: 

OK, tested without Mike's canonicalize_file_name patch and with dev version of geometry.

PKG_ADD:

#1
dirlist = {"geom2d","io","polygons2d","shape2d", "graphs",...
           "geom3d","meshes3d","polynomialCurves2d"};
## Get full path, with luck we can retireve the package name from here
dirname = fileparts (canonicalize_file_name (mfilename ("fullpath")));
pp = strsplit (dirname,filesep ("all"), true);
:
:


(never mind the spelling & style things)

and the results:

>> canonicalize_file_name ('geometry-2.0.0.tar.gz')
ans = F:\dev\of\geometry/geometry-2.0.0.tar.gz

## => unpatched canonicalize_file_name

>> pkg install -auto -verbose geometry-2.0.0.tar.gz
mkdir (C:\Users\philip\AppData\Local\Temp\oct-SaWoGK)
untar (geometry-2.0.0.tar.gz, C:\Users\philip\AppData\Local\Temp\oct-SaWoGK)
warning: addpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\geom2d: No such file or directory
warning: addpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\io: No such file or directory
warning: addpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\polygons2d: No such file or directory
warning: addpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\shape2d: No such file or directory
warning: addpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\graphs: No such file or directory
warning: addpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\geom3d: Nosuch file or directory
warning: addpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\meshes3d: No such file or directory
warning: addpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\polynomialCurves2d: No such file or directory
warning: rmpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packagesC:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\geom2d: not found
warning: rmpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packagesC:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\io: not found

warning: rmpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packagesC:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\polygons2d: not found
warning: rmpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packagesC:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\shape2d: not found
warning: rmpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packagesC:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\graphs: not found
warning: rmpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packagesC:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\geom3d: not found
warning: rmpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packagesC:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\meshes3d: not found
warning: rmpath: C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packagesC:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\polynomialCurves2d: not found
For information about changes from previous versions of the geometry package, run 'news geometry'.
>>


FYI, a little debug session after inserting "keyboard" statement at l.6 of PKG_ADD (right before the 'strsplit ...filesep("all")...' line:

>> pkg install -auto -verbose geometry-2.0.0.tar.gz
mkdir (C:\Users\philip\AppData\Local\Temp\oct-a2SOwN)
untar (geometry-2.0.0.tar.gz, C:\Users\philip\AppData\Local\Temp\oct-a2SOwN)
stopped in C:\Programs\Octave\Octave-4.1.0+_w64\share\octave\packages\geometry-2.0.0\PKG_ADD at line 6
6: keyboard
debug> dirname
dirname = C:/Programs/Octave/Octave-4.1.0+_w64/share/octave/packages/geometry-2.0.0
debug> strsplit (dirname,filesep ("all"), true)
ans =
{
  [1,1] = C:/Programs/Octave/Octave-4.1.0+_w64/share/octave/packages/geometry-2.0.0
}
debug> strsplit (dirname,filesep, true)
ans =
{
  [1,1] = C:/Programs/Octave/Octave-4.1.0+_w64/share/octave/packages/geometry-2.0.0
}
debug> strsplit (dirname, '/', true)
ans =
{
  [1,1] = C:
  [1,2] = Programs
  [1,3] = Octave
  [1,4] = Octave-4.1.0+_w64
  [1,5] = share
  [1,6] = octave
  [1,7] = packages
  [1,8] = geometry-2.0.0
}
debug>


My conclusions so far:
- invoking filesep ("all") doesn't make any difference, could maybe even work out adversely;
- it is the fix to canonicalize_file_name that makes the difference.

Philip Nienhuis <philipnienhuis>
Group Member
Mon 14 Sep 2015 06:19:40 PM UTC, comment #15: 

I've already tested with the canonicalize_file_name patch from bug #45816 (i.e., w/o 'filesep("all")'. All error messages from PKG_ADD during installation were gone then, so 'filesep ("all")' doesn't seem to be required anymore; but might not hurt.

NOTE: before and after the patch, after installation of geometry pkg, when loading it I never saw error messages like the OP reported.
To repeat myself: for me this bug never seemed to affect functioning of the geometry package on Windows, see my comment #4.
IOW, I still wonder if the bug title ("fails to install") really matches the actual situation and the OP just got alarmed by the long list of autoload error messages during installation. Those messages are real (I saw them too) but they may be due to pkg.m issues relating to installation sensu stricto

I'll try the new PKG_ADD/PKG_DEL asap (merely to be sure that 'filesep ("all")' doesn't work adversely) but depending on other priorities it may be only next weekend that I have an opportunity.

Philip Nienhuis <philipnienhuis>
Group Member
Mon 14 Sep 2015 05:13:12 PM UTC, comment #14: 

Set status to ready for test, maybe Philip or someone else can test installation from hg if you want to wait for feedback before tagging a new release.

Mike Miller <mtmiller>
Group Member
Mon 14 Sep 2015 05:02:04 PM UTC, comment #13: 

Ok, it has been pushed to the development version. I guess this bug can be fixed. Although I cannot try it in Windows.

Juan Pablo Carbajal <juanpi>
Group Member
Mon 14 Sep 2015 02:40:16 PM UTC, comment #12: 

Yes, the calls to filesep() with strsplit() in PKG_ADD and PKG_DEL should be replaced with filesep("all") to accomodate Windows environments where either file separator is valid, see "help filesep". This should allow this bug to be fixed regardless of whether canonicalize_file_name returns forward or backward slashes.

Mike Miller <mtmiller>
Group Member
Mon 14 Sep 2015 02:19:37 PM UTC, comment #11: 

Any development on this?

Juan Pablo Carbajal <juanpi>
Group Member
Thu 03 Sep 2015 08:33:18 PM UTC, comment #10: 

Another tidbit of information for this bug: the filesep function takes an option string "all" that returns all valid file separators for the operating system. This should probably be used, in the spirit of the robustness principle.

See the function file fileparts.m for an example using filesep("all") as the delimiter to parse a path string.

Mike Miller <mtmiller>
Group Member
Mon 31 Aug 2015 06:50:29 PM UTC, comment #9: 

I made this bug depend on bug #45816.

Please please follow up comments there. Do not simultaneously discuss in two bug reports + a maintainers ML thread.

Fact remains that I can't reproduce this on Windows=7 64-bit with Octave-4.1.0+ (just tried again).

Philip Nienhuis <philipnienhuis>
Group Member
Mon 31 Aug 2015 02:01:14 PM UTC, comment #8: 

Due to communication with gnulib devs, could you try if windows can use "\" and "/" interchangeably?

e.g. whether


​ans = D:\folderA/folderB/file_a.txt


is a correct PATH in your windows.

Juan Pablo Carbajal <juanpi>
Group Member
Mon 24 Aug 2015 07:10:27 PM UTC, comment #7: 

(OP)
See bug #45816.

Anonymous
Mon 24 Aug 2015 06:10:36 PM UTC, comment #6: 

(OP here)
So as canonicalize_file_name gets passed to and from gnulib, maybe they changed something? I can double check this or gather more information if you wish. I downloaded the official 4.0 windows installer today. The change to full gnulib handling was done several months ago, this can't be the culprit. Anyway, this should be in a new ticket which targets canonicalize_file_name. I will check again and open it.

Anonymous
Mon 24 Aug 2015 06:03:59 PM UTC, comment #5: 

So, is it correct to open a new bug for canonicalize_* or to fix the script in geometry?

There is nothing in the help of canonicalize_* that indicates that it is a Linux only function.

Juan Pablo Carbajal <juanpi>
Group Member
Mon 24 Aug 2015 05:49:17 PM UTC, comment #4: 

BTW I'm surprised this bug happens at all as I've installed geometry-2.0.0 tens of times on Windows systems w/o any issues - but then again, with the development version, not 4.0.0  (I make & install new dev Octave releases for Windows about twice a week.)

So I tend to assign status "Works for me".....

Philip Nienhuis <philipnienhuis>
Group Member
Mon 24 Aug 2015 05:45:46 PM UTC, comment #3: 

I think it is rather canonicalize_file_name() that screws up file separators than filesep() itself: it stubbornly morphs native file seps ("\"on Windows) into forward slashes.

I rather use make_absolute_filename() in my scripts as that leaves Windows file seps intact.

Philip Nienhuis <philipnienhuis>
Group Member
Mon 24 Aug 2015 05:25:46 PM UTC, comment #2: 

No. filesep() returns a backslash which is the correct separator on Windows. But all backslashes have been converted to slashes by canonicalize_file_name(). So the splitting fails, because there are no backslashes in the canonicalized filename. To me this seems like an error in the installation script. I don't know how other packages handle that, though.

Anonymous
Mon 24 Aug 2015 04:21:07 PM UTC, comment #1: 

Thanks for the report.
If I understood correctly, it seems this is a bug in filesep() which should return the correct path separator in each system.

Juan Pablo Carbajal <juanpi>
Group Member
Mon 24 Aug 2015 02:54:02 PM UTC, original submission:  

geometry-2.0.0 fails to install on windows because the package path is first canonicalized, then the PKG_ADD and PGK_DEL scripts try to split the dirname with windows file separator which fails and returns the full path.

lines causing the error:

dirname = fileparts (canonicalize_file_name (mfilename ("fullpath")));
pp = strsplit (dirname,filesep (), true);

pp then holds an invalid path consisting of a concatenation of the filepath with itself.

Circumvention: change filesep () in both files to '/'.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by juanpi (Posted a comment)
  • -email is unavailable- added by None (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-12-22 mtmiller StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2015-09-14 mtmiller StatusPostponed Ready For Test
    2015-08-31 philipnienhuis StatusNone Postponed
        Dependencies- Depends on bugs #45816

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code