CATIA-Systems / FMIKit-Simulink

Import and export Functional Mock-up Units with Simulink
Other
157 stars 51 forks source link

FMU generation susceptible to max path errors #472

Open benplay2 opened 5 months ago

benplay2 commented 5 months ago

I attempted to create an FMU from a simple Simulink model that includes an sFunction. After some trial and error, I discovered that I was receiving errors due to the exceeding the maximum path length.

System details:


Further details:

The error:

C:\Program Files (x86)\Microsoft Visual Studio\2017\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(359,25): error MSB4184: 
The expression "[MSBuild]::NormalizePath(C:\Users\ZZZZZZ\AppData\Local\Temp\tpdeb91cc8_6d09_4157_9226_606a8095eb0d\zzzzz_to_be_fmu_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz_fmu_sfcn_rtw_fmi, zzzzz_to_be_fmu_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz_fmu.dir\Release\, zzzzz_to_be_fmu_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz_fmu.vcxproj.CopyComplete)"
 cannot be evaluated. Path: 
C:\Users\USERID1\AppData\Local\Temp\tpb0a66500_9cb7_4714_8ffb_9e0f2fe88fce\zzzzz_to_be_fmu_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz_fmu_sfcn_rtw_fmi\zzzzz_to_be_fmu_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz_fmu.dir\Release\zzzzz_to_be_fmu_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz_fmu.vcxproj.CopyComplete 
exceeds the OS max path limit. The fully qualified file name must be less than 260 characters. 
[C:\Users\USERID1\AppData\Local\Temp\tpb0a66500_9cb7_4714_8ffb_9e0f2fe88fce\zzzzz_to_be_fmu_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz_fmu_sfcn_rtw_fmi\zzzzz_to_be_fmu_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz_fmu.vcxproj]

Summary:

The intermediate artifact creation process appears to be creating nested folders with the same name of the Simulink model with even more characters appended. This causes the 59 character long Simulink model name living in a 74 character temporary directory to grow far past the OS path limit of 260 characters!!

I was able to resolve the issue by changing the temporary directory used, but I would like for this to be a temporary fix and hope this can be improved in the future! Could standard & shorter folder names be used instead of repeating the model's name?

I also tried to update the group policy to enable long paths, but that did not seem to resolve the issue.

Thank you, Ben