zserio icon indicating copy to clipboard operation
zserio copied to clipboard

Generated file names can clash

Open mikir opened this issue 6 years ago • 4 comments

Some generators create special source files which are not generated from zserio types directly.

Example:

C++ generates InspectorZserioNames.cpp/h in root package directory. If user specifies zserio type InspectorZserioNames in root package, these two generated files will overwrite each other.

The solution could be to store all generated file names and check the naming clash. The implementation can even rename generated sources to avoid clashing if needed.

mikir avatar Nov 15 '18 12:11 mikir

Python on Windows can clash as well. This is because file names under Windows are case insensitive.

Example:

const int16 VALUE = 0xDEAD;

struct Value
{
    bool hasValue;
};

This problem can be solved by amalgamation for Python and C++. Java does not support multiple top level classes, so amalgamation does not work.

mikir avatar Mar 07 '19 12:03 mikir

We should at least eliminate generated file names which are not defined as the types in the sources. For example, SqlTableRow in Java.

This should be done within version 2.0.0 because this fix will change generated API.

mikir avatar Mar 19 '20 08:03 mikir

Python on Windows can clash as well. This is because file names under Windows are case insensitive.

Example:

const int16 VALUE = 0xDEAD;

struct Value
{
    bool hasValue;
};

This problem can be solved by amalgamation for Python and C++. Java does not support multiple top level classes, so amalgamation does not work.

This part will be solved by issue #87.

Mi-La avatar Apr 17 '20 07:04 Mi-La

Python generates api.py and when user creates structure Api.py, it will also clash on Windows!

Mi-La avatar Apr 17 '20 08:04 Mi-La