pavelliavonau/cmakeconverter

Crash on absent settings key. Wrong settings mapping. Premake bug?

JSH32 opened this issue · 5 comments

JSH32 commented
0.000000 processes count = 8
0.000997 warnings level = 2
0.286235 2> Conversion started: Project GLFW
0.286235 1> Conversion started: Project Dash
0.291221 3> Conversion started: Project Game
0.293216 3> WARN : file or path "D:\Stuff\Projects\DASH - Copy\Game/Game.vcxproj.filters" not found.0.293216 4>
Conversion started: Project Glad
0.298202 5> Conversion started: Project ImGui
0.301194 5> WARN : file or path "D:\Stuff\Projects\DASH - Copy\Dash/deps/imgui/ImGui.vcxproj.filters" not found.
0.306181 2> WARN : glfw_config.h file is absent at filesystem. Ignoring but check it!!
0.306181 2> WARN : Adding absent glfw_config.h file into project files
0.311167 2> WARN : file or path "D:\Stuff\Projects\DASH - Copy\Dash\deps\GLFW\src\glfw_config.h" not found.
0.311167 2> WARN : getting actual filesystem name failed : "D:\Stuff\Projects\DASH - Copy\Dash\deps\GLFW\src\glfw_config.h"
0.318149 4> Conversion done   : Project Glad
0.321141 3> Conversion done   : Project Game (1 warnings)
0.336101 5> Conversion done   : Project ImGui (1 warnings)
0.362031 2> Conversion done   : Project GLFW (4 warnings)
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "d:\anaconda\lib\multiprocessing\pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "d:\anaconda\lib\multiprocessing\pool.py", line 44, in mapstar
    return list(map(*args))
  File "d:\anaconda\lib\site-packages\cmake_converter\data_converter.py", line 278, in run_conversion
    project_data['subdirectory'],
  File "d:\anaconda\lib\site-packages\cmake_converter\data_converter.py", line 245, in convert_project
    self.collect_data(context)
  File "d:\anaconda\lib\site-packages\cmake_converter\data_converter.py", line 54, in collect_data
    context.parser.parse(context)
  File "d:\anaconda\lib\site-packages\cmake_converter\visual_studio\vcxproj\parser.py", line 140, in parse
    self._parse_nodes(context, root)
  File "d:\anaconda\lib\site-packages\cmake_converter\parser.py", line 86, in _parse_nodes
    node_handlers[child_node_tag](context, child_node)
  File "d:\anaconda\lib\site-packages\cmake_converter\visual_studio\vcxproj\parser.py", line 148, in __parse_item_group
    self._parse_nodes(context, node)
  File "d:\anaconda\lib\site-packages\cmake_converter\parser.py", line 80, in _parse_nodes
    self._parse_attributes(context, child_node)
  File "d:\anaconda\lib\site-packages\cmake_converter\parser.py", line 100, in _parse_attributes
    attributes_handlers[node_key](context, node_key, node.get(attr), node)
  File "d:\anaconda\lib\site-packages\cmake_converter\visual_studio\vcxproj\parser.py", line 206, in __parse_cl_compile_include_attr
    self.__parse_file_nodes(context, context.sources, cl_node, 'Sources')
  File "d:\anaconda\lib\site-packages\cmake_converter\visual_studio\vcxproj\parser.py", line 233, in __parse_file_nodes
    self._parse_nodes(file_context, file_node)
  File "d:\anaconda\lib\site-packages\cmake_converter\parser.py", line 86, in _parse_nodes
    node_handlers[child_node_tag](context, child_node)
  File "d:\anaconda\lib\site-packages\cmake_converter\visual_studio\vcxproj\flags.py", line 289, in set_flag
    self.flags[context.current_setting][flag_name] = {}  # reset default values
KeyError: ('Dist', 'x64')
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "d:\anaconda\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\anaconda\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\Anaconda\Scripts\cmake-converter.exe\__main__.py", line 9, in <module>
  File "d:\anaconda\lib\site-packages\cmake_converter\main.py", line 126, in main
    converter.convert_solution(root_context, os.path.abspath(args.solution))
  File "d:\anaconda\lib\site-packages\cmake_converter\visual_studio\solution.py", line 281, in convert_solution
    results = self.do_conversion(root_context, input_data_for_converter)
  File "d:\anaconda\lib\site-packages\cmake_converter\data_converter.py", line 307, in do_conversion
    results = pool.map(self.run_conversion, input_converter_data_list)
  File "d:\anaconda\lib\multiprocessing\pool.py", line 268, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "d:\anaconda\lib\multiprocessing\pool.py", line 657, in get
    raise self._value
KeyError: ('Dist', 'x64')

Investigate and provide minimal example of solution that leads to this error, please. I cannot understand why does it happen. Something wrong with config-mapping of solution.

JSH32 commented

I am using a build system called premake5 to convert everything to 2019 visual studio files, then I am using this tool to convert to cmake. It works perfectly in VS2019 but I dont know why this error happens. Would you like me to link the repo?

Looks like premake makes invalid solutions. Similar issue was already submitted. Check #101

@Riku32 , check last develop.

No responce