conan icon indicating copy to clipboard operation
conan copied to clipboard

[bug] .\site-packages\conan\tools\microsoft\msbuilddeps.py

Open Dogm opened this issue 3 years ago • 1 comments
trafficstars

conanfile.py (curaengine/None): ERROR: Traceback (most recent call last): File "c:\program files\python38\lib\site-packages\conans\client\generators_init_.py", line 181, in write_generators generator.generate() File "c:\program files\python38\lib\site-packages\conan\tools\microsoft\msbuilddeps.py", line 110, in generate generator_files = self._content() File "c:\program files\python38\lib\site-packages\conan\tools\microsoft\msbuilddeps.py", line 338, in _content result.update(self._package_props_files(dep, build=False)) File "c:\program files\python38\lib\site-packages\conan\tools\microsoft\msbuilddeps.py", line 308, in _package_props_files result[comp_filename] = self._dep_props_file(full_comp_name, comp_filename, File "c:\program files\python38\lib\site-packages\conan\tools\microsoft\msbuilddeps.py", line 229, in _dep_props_file dom = minidom.parseString(content_multi) File "c:\program files\python38\lib\xml\dom\minidom.py", line 1969, in parseString return expatbuilder.parseString(string) File "c:\program files\python38\lib\xml\dom\expatbuilder.py", line 927, in parseString return builder.parseString(string) File "c:\program files\python38\lib\xml\dom\expatbuilder.py", line 225, in parseString parser.Parse(string, True) xml.parsers.expat.ExpatError: not well-formed (invalid token): line 6, column 33

ERROR: Error in generator 'MSBuildDeps': not well-formed (invalid token): line 6, column 33


problem in generated xml node used (libmpdecimal++) symbols ++ wrong with xml; format nodenames

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets">
  </ImportGroup>
  <PropertyGroup>
    <conan_mpdecimal_libmpdecimal++_props_imported>True</conan_mpdecimal_libmpdecimal++_props_imported>
  </PropertyGroup>
</Project>

temporary solution (.\site-packages\conan\tools\microsoft\msbuilddeps.py) line: 285+


        for comp_name, comp_info in dep.cpp_info.components.items():
            if comp_name is None:
                continue

            # <SOLUTION>
            comp_name = comp_name.replace("+", "_")
            # </SOLUTION>
                
            full_comp_name = "{}_{}".format(dep_name, comp_name)
            vars_filename = "conan_%s_vars%s.props" % (full_comp_name, conf_name)
            activate_filename = "conan_%s%s.props" % (full_comp_name, conf_name)

Dogm avatar Aug 09 '22 11:08 Dogm

Quick observation: while packages with + in the name are allowed, it was probably something that slipped from the regex for versions that need to allow +, but it was not really intended that package names had special characters in the name, I'd recommend not using them if not strictly necessary (I see packages in ConanCenter named cxx instead c++)

memsharded avatar Aug 09 '22 23:08 memsharded