Archived issue #0028673
getsourcefile Draw command return different output on Linux and Windows platforms
Description
Windows :
> getsourcefile pload
src/Draw/Draw_PloadCommands.cxx
Linux :
> getsourcefile pload
/src/Draw/Draw_PloadCommands.cxx
> getsourcefile pload
src/Draw/Draw_PloadCommands.cxx
Linux :
> getsourcefile pload
/src/Draw/Draw_PloadCommands.cxx
Steps to reproduce
test :
demo draw getsource
demo draw getsource
Public activity
15 archived notes
Participants are labeled by their role within this record.
The cause of different path computation is the way how compiler computes the path of the current compilation unit (when the macro __FILE__ is used).
For example, under VC10 it returns the file path starting with "../../../src", while under VC12 it returns the full path starting with "D:\".
For example, under VC10 it returns the file path starting with "../../../src", while under VC12 it returns the full path starting with "D:\".
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: msv
Date: Fri Apr 21 17:18:14 2017 +0300
0028673: getsourcefile Draw command return different output on Linux and Windows platforms
The method OSD_Path::RemoveATrek has been modified, so that to remove leading track separator if the first component has been removed.
Now the command getsourcefile returns the relative path starting with "src" without leading "/" on all platforms.
[revision removed]
Detailed log of new commits:
Author: msv
Date: Fri Apr 21 17:18:14 2017 +0300
0028673: getsourcefile Draw command return different output on Linux and Windows platforms
The method OSD_Path::RemoveATrek has been modified, so that to remove leading track separator if the first component has been removed.
Now the command getsourcefile returns the relative path starting with "src" without leading "/" on all platforms.
Dear Kirill, please review.
I believe that making punctual changes in OSD_Path without clear understanding how it should behave is not worth doing: it can easily cause regressions in existing client's code but does not solve the issue completely, as its reason is lack of clear behavior. This is to be done together with other related issues.
I can propose another, more safe way. It is to add a new method in OSD_Path with name RemoveLeadingTrekSeparator(). It will remove the leading separator if any from the track. Then call this method from Draw_Interpretor::add().
What is your opinion?
What is your opinion?
At last, the most safe way we found is to make needed correction in the method Draw_Interpretor::add().
I prefer not to add new methods until we get clear idea how this class should work in all cases and define reasonable interface
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: msv
Date: Fri Apr 21 17:18:14 2017 +0300
0028673: getsourcefile Draw command return different output on Linux and Windows platforms
The method Draw_Interpretor::add() has been corrected so that the command getsourcefile returned the relative path starting with "src" without leading "/" on all platforms.
[revision removed]
Detailed log of new commits:
Author: msv
Date: Fri Apr 21 17:18:14 2017 +0300
0028673: getsourcefile Draw command return different output on Linux and Windows platforms
The method Draw_Interpretor::add() has been corrected so that the command getsourcefile returned the relative path starting with "src" without leading "/" on all platforms.
Please review the new version.
No remarks, please test (only test demo draw getsource needs to be checked, on both Linux and Windows).
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Dear Author,
Branch CR28673_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]
Testing cases:
http://occt-tests/CR28673_1-master-OCCT/Debian70-64/demo/draw/getsource.html
http://occt-tests/CR28673_1-master-OCCT/Windows-64-VC10/demo/draw/getsource.html
demo draw getsource: OK
Branch CR28673_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]
Testing cases:
http://occt-tests/CR28673_1-master-OCCT/Debian70-64/demo/draw/getsource.html
http://occt-tests/CR28673_1-master-OCCT/Windows-64-VC10/demo/draw/getsource.html
demo draw getsource: OK
Dear Author,
Branch CR28673_1 is TESTED.
Branch CR28673_1 is TESTED.
Branch [archived branch] has been deleted by Commenter 2.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Commenter 2.
[revision removed]
[revision removed]