Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] onetbb/2021.3.0: Invalid character escape '\l' #19168

Closed
p-groarke opened this issue Aug 12, 2023 · 2 comments · Fixed by #19174
Closed

[package] onetbb/2021.3.0: Invalid character escape '\l' #19168

p-groarke opened this issue Aug 12, 2023 · 2 comments · Fixed by #19174
Labels
bug Something isn't working

Comments

@p-groarke
Copy link

Description

For details on this, see : conan-io/conan#10539

conan_toolchain.cmake is broken due to unescaped backslashes on windows. See log.

Package and Environment Details

  • Package Name/Version: onetbb/2021.3.0#e447f12564bd0a5df3f2bd5781cf5cc7
  • Operating System+version: Windows 11
  • Compiler+version: MSVC 2022
  • Docker image: ?
  • Conan version: conan 2.0.9
  • Python version: Python 3.7.9

Conan profile

======== Input profiles ========
Profile host:
[settings]
arch=x86
build_type=Debug
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Debug
compiler.version=193
os=Windows

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows

Steps to reproduce

Install (build) onetbb/2021.3.0#e447f12564bd0a5df3f2bd5781cf5cc7 with cmakedeps / cmaketoolchain generator.

Logs

Click to expand log
CMake Error at C:/Users/pgroarke/.conan2/p/b/onetb3e83bbcb22a9a/b/build/generators/conan_toolchain.cmake:117 (set):
  Syntax error in cmake code at

    C:/Users/pgroarke/.conan2/p/b/onetb3e83bbcb22a9a/b/build/generators/conan_toolchain.cmake:117

  when parsing string

    C:/Users/pgroarke/.conan2/p/b/hwloc93107a9ec9dfe/p\lib\hwloc.lib

  Invalid character escape '\l'.
@p-groarke p-groarke added the bug Something isn't working label Aug 12, 2023
@SpaceIm
Copy link
Contributor

SpaceIm commented Aug 13, 2023

Yep, #17939 is broken on Windows. You can submit a PR to fix these paths by adding .replace("\\", "/") when there are passed to toolchain variables.

Basically instead of:

        if self._tbbbind_explicit_hwloc:
            hwloc_package_folder = self.dependencies["hwloc"].package_folder.replace("\\", "/")
            hwloc_lib_name = "hwloc.lib" if self.settings.os == "Windows" else "libhwloc.so"
            toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_LIBRARY_PATH"] = os.path.join(hwloc_package_folder, "lib", hwloc_lib_name)
            toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_INCLUDE_PATH"] = os.path.join(hwloc_package_folder, "include")
            if self.settings.os == "Windows":
                toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_DLL_PATH"] = os.path.join(hwloc_package_folder, "bin", "hwloc.dll")

it should be:

        if self._tbbbind_explicit_hwloc:
            hwloc_package_folder = self.dependencies["hwloc"].package_folder
            hwloc_lib_name = "hwloc.lib" if self.settings.os == "Windows" else "libhwloc.so"
            toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_LIBRARY_PATH"] = os.path.join(hwloc_package_folder, "lib", hwloc_lib_name).replace("\\", "/")
            toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_INCLUDE_PATH"] = os.path.join(hwloc_package_folder, "include").replace("\\", "/")
            if self.settings.os == "Windows":
                toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_DLL_PATH"] = os.path.join(hwloc_package_folder, "bin", "hwloc.dll").replace("\\", "/")

@p-groarke
Copy link
Author

The toolchain generator should be fixed to escape paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants