﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5796	Models with long path names cause a code generation failure under Windows	Francesco Casella	Lennart Ochel	"When compiling model {{{A.B.C.D}}}, the current code generation module generates lots of intermediate files, such as {{{A.B.C.D.c}}} or {{{A.B.C.D_12jac.c}}}, etc., which OMEdit places in a directory named again as the full Modelica pathname. So you get filenames such as
{{{
C:\Users\John Doe\AppData\Local\Temp\OpenModelica\OMEdit\A.B.C.D\A.B.C.D_12jac.c
}}}

In case of libraries with long class names (which are encouraged in Modelica) and many nested packages, the full pathname can become very long and exceed the Windows limit of 256 characters on path names. This causes some models (e.g. in the {{{ScalableTestSuite}}} or {{{PowerGrids}}} library to fail without any apparent reason during code generation, which is very annoying.

Although it may makes sense to use the full pathname for the temp directory, to avoid aliasing, I understand there is really no need to use the full Modelica pathname as a prefix for all the intermediate filenames, since it is the same for all of them; I guess just using the last identifier ({{{D}}} in this case) would do, and would help mitigating the problem.

Using only {{{D}}} as prefix for the filenames looks like a very quick fix, that we should implent ASAP."	defect	closed	blocker	1.18.0	Code Generation		fixed		
