Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMU generation susceptible to max path errors #472

Open
benplay2 opened this issue Apr 9, 2024 · 0 comments
Open

FMU generation susceptible to max path errors #472

benplay2 opened this issue Apr 9, 2024 · 0 comments

Comments

@benplay2
Copy link

benplay2 commented Apr 9, 2024

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:

  • Windows 10
  • MATLAB 2022b
  • Compiler: Visual Studio 2017
  • FMIKit version 3.1

Further details:

  • Model path: C:\Users\USERID1\AppData\Local\Temp\tpdeb91cc8_6d09_4157_9226_606a8095eb0d\zzzzz_to_be_fmu_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz_fmu.slx
  • Simulation target: rtwsfcnfmi.tlc, CoSimulation, Fixed-step

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant