Skip to content

Windows CI: VINCA_CUSTOM_CMAKE_BUILD_DIR stripped by rattler-build env isolation, causing MAX_PATH failures #76

Closed

Description

@mini-1235

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

The Windows build of ros2-rosbag2-performance-benchmarking-msgs fails in CI with an MSVC long-path error:

%SRC_DIR%\build\rosidl_generator_py\rosbag2_performance_benchmarking_msgs\_rosbag2_performance_benchmarking_msgs_s.ep.rosidl_typesupport_introspection_c.c(1,1):
error C1083: Cannot open compiler generated file: '': Invalid argument

The full path is C:\bld\bld\rattler-build_ros2-rosbag2-performance-benchmarking-msgs_1791414638\work\build\.... Combined with rosidl's generated file and folder names, it goes over MAX_PATH. The 3 jobs that follow in the run were skipped because of this failure.

Root cause: the C:\x short-build-dir workaround is not reaching the build script.

The generated win.yml sets VINCA_CUSTOM_CMAKE_BUILD_DIR: C:\x\, and vinca's bld_ament_cmake.bat is supposed to cd there before building. In the log, that variable expands to an empty value inside the build script:

%SRC_DIR%>if defined VINCA_CUSTOM_CMAKE_BUILD_DIR (
 if not exist "\" (mkdir "" )
  cd /d ""
 )
%SRC_DIR%>rd /s /q build

As a result, CMake builds in %SRC_DIR%\build instead of C:\x\build. CI uses rattler-build 0.76.1, which runs build scripts with --env-isolation strict by default. That mode starts from a clean environment, which likely strips variables such as VINCA_CUSTOM_CMAKE_BUILD_DIR. This means the workaround is currently disabled for every Windows build, not only this package.

Proposed fixes:

  1. Short-term (ros-lyrical): add --no-build-id to .scripts/build_win.bat, matching what testpr.yml already does. This removes the timestamp suffix from the build directory.
  2. Proper fix (vinca): forward VINCA_CUSTOM_CMAKE_BUILD_DIR explicitly through the generated recipes, for example via build.script.env with ${{ env.get("VINCA_CUSTOM_CMAKE_BUILD_DIR", default="") }}, so that it works under strict env isolation. The alternative is passing --env-isolation conda-build/none in CI, but that lets the whole CI environment into every build.

Installed packages

N/A — CI build failure (rattler-build 0.76.1, windows-2022 runner)

Environment info

N/A — CI build failure on GitHub Actions win-64 (build_win workflow, buildbranch_win)

This issue description was AI-generated using Claude Opus 5.5.

Activity

  1. mini-1235 commented on Oct 8, 2026

    @mini-1235
    ContributorAuthor
  2. mini-1235 commented on Oct 8, 2026

    @mini-1235
    ContributorAuthor

    I don't have a Windows machine to verify the cause or test a fix, so I haven't opened a PR

  3. Tobias-Fischer commented on Oct 18, 2026

    @Tobias-Fischer
    Contributor

    Likely fixed in the RoboStack monorepo, RoboStack/robostack, where all ROS 2 distributions are now built: its PR builds use a short Windows build path (C:\bld\), and rosbag2_performance_benchmarking_msgs built on win-64 in the lyrical rosdistro sync there (RoboStack/robostack#60). Worth a check of the post-merge build branches once that sync is merged.

    🤖 Claude (AI assistant), on behalf of @Tobias-Fischer

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