Hopsan / hopsan

Hopsan is a free multi-domain system simulation tool developed at the division of Fluid and mechatronic systems at Linköping university.
Apache License 2.0
157 stars 43 forks source link

Problem with FMI/FMU and external library due to Hopsan compiling on invalid folder #2205

Closed dhilding closed 4 months ago

dhilding commented 6 months ago

Description of the bug When importing an FMU, Hopsan will compile the FMU in a folder "hopsan" that Hopsan creates in the Documents folder. The issue is that the on the present computer (this is common at companies) users Documents folder is either on an UNC path or on a OneDrive. The OneDrive can have (as in the present case) a path like "C:\Users\nilsnilsson\OneDrive - BIG Company, Inc". The compiler cannot handle this path. The same situation occurs when there is an UNC path for the Documents folder, as the compiler cannot handle the UNC path.

To Reproduce

  1. Install Hopsan on a computer where the users Documents folder is on the OneDrive or other Path containing "," and "-".
  2. Start Hopsan and import an FMU (or other external library).
  3. The compilation of FMU during import fails.

Expected behavior Import of FMU or external library would be successful including the compilation.

Hopsan version (please complete the following information): -OS: Windows 10 -Hopsan: 2.19.1, but older and newer are also affected.

Additional information Many thanks for a great software! Suggestion: Would it be possible to add a check that the "hopsan" path does not contain "illegal" characters and if so is the case then ask the user to put the hopsan folder somewhere else? Alternatively also give the user control over where the "hopsan" folder is located through the GUI.

robbr48 commented 4 months ago

This should no longer be an issue since we now use the FMIWrapper component for importing FMUs.

Related to #2202.