Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

FMU generation susceptible to max path errors #472

@benplay2

Description

@benplay2

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions