Skip to content

[pixi-build-ros] Windows: cmake_install.cmake fails with "Invalid character escape" for any ament_cmake package with rosidl-generated Python bindings #6955

Description

@pjensfelt

pixi version: 0.78.0
Platform: win-64 (Windows 11), MSVC 2022 (14.44.35207) via the vs2022 compiler variant
Backend: pixi-build-ros (formerly prefix-dev/pixi-build-backends, now part of this repo)

Summary

Building any ROS2 package that generates rosidl Python message bindings (i.e. any
ament_cmake package with .msg/.srv files) fails on Windows during the install
step with a CMake parse error in the generated cmake_install.cmake:

CMake Error at cmake_install.cmake:152 (execute_process):
  Syntax error in cmake code at
    .../build/cmake_install.cmake:154
  when parsing string
    C:\<...>\host\python.exe
  Invalid character escape '\w'.

Root cause (as far as I can tell)

The generated cmake_install.cmake contains this block:

execute_process(
      COMMAND
      "C:\wsbuild\.pixi\bld\ros-jazzy-wasp-as-interfaces\8WF_D-nh4o0\host\python.exe" "-m" "compileall"
      "C:/wsbuild/.pixi/bld/ros-jazzy-wasp-as-interfaces/8WF_D-nh4o0/host/Library/../Lib/site-packages/wasp_as_interfaces"
    )

Note the inconsistency: the compileall target path uses forward slashes
(C:/wsbuild/..., valid CMake string cont

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions