MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030761Community[OCCT] OCCT:Application Frameworkpublic2019-06-02 18:392019-06-16 11:39
ReporterVico Liang 
Assigned Tobugmaster 
PrioritynormalSeverityblock 
StatusverifiedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 7.1.0 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0030761: Application Framework - HOMEDRIVE and TEMP are undefined on UWP
DescriptionIt's impossible to save or open any document of OCAF. There are exception in below function, HOMEDRIVE and TEMP environment are undefined on UWP.

TCollection_ExtendedString CDF_FWOSDriver::DefaultFolder()
{
  TCollection_ExtendedString theDefaultFolder;
  if (theDefaultFolder.Length() == 0) {
    
#ifdef _WIN32
    TCollection_ExtendedString hd=UTL::xgetenv("HOMEDRIVE");
    if(hd.Length() != 0) {
      theDefaultFolder=hd;
      theDefaultFolder+=UTL::xgetenv("HOMEPATH");
    }
    else {
      theDefaultFolder=UTL::xgetenv("TEMP");
      if(theDefaultFolder.Length()==0)
        throw Standard_Failure("cannot determine default folder; HOMEDRIVE and TEMP are undefined");
    }
#else
    TCollection_ExtendedString home=UTL::xgetenv("HOME");
    if(home.Length() !=0)
      theDefaultFolder = home;
    else
      theDefaultFolder= TCollection_ExtendedString("/tmp");
#endif
  }
  return theDefaultFolder;
}
Steps To ReproduceNot required
TagsNo tags attached.
Test case numberNot required
Attached Files

- Relationships
related to 0030769closedbugmaster Community OSD_FileNode::Exists () doesn't work properly on uwp 

-  Notes
(0084770)
git (administrator)
2019-06-03 16:06

Branch CR30761 has been created by mpv.

SHA-1: a89a076d90d7be0e67fda0977476562c57dcf5ea


Detailed log of new commits:

Author: mpv
Date: Mon Jun 3 16:05:25 2019 +0300

    30761: HOMEDRIVE and TEMP are undefined on UWP
    
    Avoid CDF_Stroe to find default folder since there is no case where this folder does not reset to exact value given by the user.
    Also, remove the exception raising for the case this method is called from outside.
(0084772)
Vico Liang (developer)
2019-06-03 17:55
edited on: 2019-06-03 17:57

Dear mpv,
I got your patch and build it for UWP. though the exception is gone away, it still can't save and load any ocaf document on UWP. There are error PCDM_RS_UnknownDocument when call
PCDM_ReaderStatus TDocStd_Application::Open (const TCollection_ExtendedString& path, Handle(TDocStd_Document)& aDoc).
The same code works on windows 10, but not working on uwp.

Could you please take a look at it? thanks.

(0084789)
Vico Liang (developer)
2019-06-04 08:15

There is no environment variables on UWP since it run in a sandbox. So occt should process all environment variables specially on uwp.
(0084802)
mpv (developer)
2019-06-04 12:17

Dear Vico,

OCCT already has a mechanism to open/save documents wihtout usage of resource files and special variables referencing to that files and drivers libraries:
https://www.opencascade.com/doc/occt-7.3.0/overview/html/occt_user_guides__ocaf.html#occt_ocaf_4_3_format [^]

You may just link (for an example, binary) drivers directly to your application by call:
BinDrivers::DefineFormat (app);

Where "app" is your TDocStd_Application instance. It may be done on creation of the application or just before save/open of the document.
(0084825)
Vico Liang (developer)
2019-06-04 18:56

Actually I do it without resource files. It doesn't work. I can't debug the code in vs2017, don't know why, otherwise more details can be provided.
(0084842)
mpv (developer)
2019-06-05 09:47

So, the original problem is fixed. SZY, please review the fix. No regressions are detected:
http://vm-jenkins-test-12.nnov.opencascade.com:8080/job/CR30761-master-MPV-Products-Windows-64-VC14-opt-test-compare/1/ [^]
at http://vm-jenkins-test-12.nnov.opencascade.com:8080/job/CR30761-master-MPV-Products-Debian80-64-opt-test-compare/1/ [^]
(0084897)
Vico Liang (developer)
2019-06-05 17:53

I have reported another bug 0030769 about the file open/save.
(0085028)
szy (administrator)
2019-06-13 12:03

Reviewed.
(0085033)
bugmaster (administrator)
2019-06-13 16:11

Fix has been tested on combination master/master
(0085042)
bugmaster (administrator)
2019-06-13 19:49

Now all are right

Combination -
OCCT branch : CR30761
master SHA - a89a076d90d7be0e67fda0977476562c57dcf5ea
d67d4b811012eef8913d3c535c29654d0acf3c4c
Products branch : master SHA - 77ee1bd5095e6eb90974be94ecc6b503a187125a
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16288.120000000074 / 16197.160000000013 [+0.56%]
Products
Total CPU difference: 771.9299999999893 / 771.9399999999893 [-0.00%]
Windows-64-VC14:
OCCT
Total CPU difference: 17747.203125 / 17603.203125 [+0.82%]
Products
Total CPU difference: 12117.703125 / 12092.375 [+0.21%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0085070)
git (administrator)
2019-06-16 11:39

Branch CR30761 has been deleted by inv.

SHA-1: a89a076d90d7be0e67fda0977476562c57dcf5ea

- Related Changesets
occt: master 7f662bf4
Timestamp: 2019-06-03 13:05:25
Author: mpv
Committer: bugmaster
Details ] Diff ]
0030761: Application Framework - HOMEDRIVE and TEMP are undefined on UWP

Avoid CDF_Stroe to find default folder since there is no case where this folder does not reset to exact value given by the user.
Also, remove the exception raising for the case this method is called from outside.
mod - src/CDF/CDF_FWOSDriver.cxx Diff ] File ]
mod - src/CDF/CDF_Store.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2019-06-02 18:39 Vico Liang New Issue
2019-06-02 18:39 Vico Liang Assigned To => mpv
2019-06-03 04:31 Vico Liang Severity minor => block
2019-06-03 16:06 git Note Added: 0084770
2019-06-03 16:27 kgv Relationship added child of 0027350
2019-06-03 16:28 kgv Product Version 7.4.0* => 7.1.0
2019-06-03 16:28 kgv Summary HOMEDRIVE and TEMP are undefined on UWP => Application Framework - HOMEDRIVE and TEMP are undefined on UWP
2019-06-03 17:55 Vico Liang Note Added: 0084772
2019-06-03 17:57 Vico Liang Note Edited: 0084772 View Revisions
2019-06-04 08:15 Vico Liang Note Added: 0084789
2019-06-04 12:17 mpv Note Added: 0084802
2019-06-04 18:56 Vico Liang Note Added: 0084825
2019-06-05 09:47 mpv Note Added: 0084842
2019-06-05 09:47 mpv Assigned To mpv => szy
2019-06-05 09:47 mpv Status new => resolved
2019-06-05 09:47 mpv Steps to Reproduce Updated View Revisions
2019-06-05 17:53 Vico Liang Note Added: 0084897
2019-06-05 17:53 Vico Liang Relationship added related to 0030769
2019-06-13 12:03 szy Note Added: 0085028
2019-06-13 12:03 szy Assigned To szy => bugmaster
2019-06-13 12:03 szy Status resolved => reviewed
2019-06-13 16:11 bugmaster Note Added: 0085033
2019-06-13 16:12 bugmaster Assigned To bugmaster => mpv
2019-06-13 16:12 bugmaster Status reviewed => assigned
2019-06-13 19:49 bugmaster Note Added: 0085042
2019-06-13 19:50 bugmaster Status assigned => resolved
2019-06-13 19:50 bugmaster Assigned To mpv => bugmaster
2019-06-13 19:50 bugmaster Status resolved => reviewed
2019-06-13 19:51 bugmaster Status reviewed => tested
2019-06-13 19:51 bugmaster Test case number => Not required
2019-06-15 16:04 bugmaster Changeset attached => occt master 7f662bf4
2019-06-15 16:04 bugmaster Status tested => verified
2019-06-15 16:04 bugmaster Resolution open => fixed
2019-06-16 11:39 git Note Added: 0085070


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker