ros2_documentation icon indicating copy to clipboard operation
ros2_documentation copied to clipboard

Build Humble on Win10 fails due to file path limit.

Open genevanmeter opened this issue 2 years ago • 2 comments

Clean Windows 10 install. Attempting to follow the documentation verbatim.
rosidl_typesupport_introspection_tests fails to build due to Windows file path limit. Resolved by setting LongFilePaths registry key (https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd).

Suggesting to adding a note linking to https://docs.ros.org/en/humble/How-To-Guides/Installation-Troubleshooting.html#character-path-limit in the Windows build (source) documentation.

genevanmeter avatar May 20 '22 12:05 genevanmeter

Attempting to follow the documentation verbatim.

Just to make sure, this means you're using --merge-install with colcon build? From here: https://docs.ros.org/en/humble/Installation/Alternatives/Windows-Development-Setup.html#build-the-ros-2-code

christophebedard avatar May 20 '22 13:05 christophebedard

Yes.

To narrow it down, this is the output when LongFilePaths has not been set:

C:\dev\ros2_humble>colcon build --merge-install --packages-select rosidl_typesupport_introspection_tests --event-handlers console_direct+
Starting >>> rosidl_typesupport_introspection_tests
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- Found ament_cmake: 1.3.2 (C:/dev/ros2_humble/install/share/ament_cmake/cmake)
-- Found ament_lint_auto: 0.12.4 (C:/dev/ros2_humble/install/share/ament_lint_auto/cmake)
-- Found rosidl_adapter: 3.1.3 (C:/dev/ros2_humble/install/share/rosidl_adapter/cmake)
-- Found gtest sources under 'C:/dev/ros2_humble/install/src/gtest_vendor': C++ tests using 'Google Test' will be built
-- Added test 'copyright' to check source files copyright and LICENSE
-- Added test 'cppcheck' to perform static code analysis on C / C++ code
-- Configured cppcheck include dirs: C:/dev/ros2_humble/src/ros2/rosidl/rosidl_typesupport_introspection_tests/include/;C:/dev/ros2_humble/src/ros2/rosidl/rosidl_typesupport_introspection_tests/test
-- Configured cppcheck exclude dirs and/or files:
-- Added test 'cpplint' to check C / C++ code against the Google style
-- Configured cpplint exclude dirs and/or files:
-- Added test 'lint_cmake' to check CMake code style
-- Added test 'uncrustify' to check C / C++ code style
-- Configured uncrustify additional arguments:
-- Added test 'xmllint' to check XML markup files
-- Configuring done
-- Generating done
-- Build files have been written to: C:/dev/ros2_humble/build/rosidl_typesupport_introspection_tests
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  rosidl_typesupport_introspection_tests__rosidl_generator_c.vcxproj -> C:\dev\ros2_humble\build\rosidl_typesupport_introspection_tests\Release\rosidl_typesupport_introspection_tests__rosidl_generator_c.dll
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(382,5): error MSB3491: Could not write lines to file "rosidl_typesupport_introspection_tests__rosidl_typesupport_introspection_c.dir\Release\rosidl_t.62982093.tlog\rosidl_typesupport_introspection_tests__rosidl_typesupport_introspection_c.lastbuildstate". Path: rosidl_typesupport_introspection_tests__rosidl_typesupport_introspection_c.dir\Release\rosidl_t.62982093.tlog\rosidl_typesupport_introspection_tests__rosidl_typesupport_introspection_c.lastbuildstate exceeds the OS max path limit. The fully qualified file name must be less than 260 characters. [C:\dev\ros2_humble\build\rosidl_typesupport_introspection_tests\rosidl_typesupport_introspection_tests__rosidl_typesupport_introspection_c.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(382,5): error MSB3491: Could not write lines to file "rosidl_typesupport_introspection_tests__rosidl_typesupport_introspection_cpp.dir\Release\rosidl_t.00D4EF3C.tlog\rosidl_typesupport_introspection_tests__rosidl_typesupport_introspection_cpp.lastbuildstate". Path: rosidl_typesupport_introspection_tests__rosidl_typesupport_introspection_cpp.dir\Release\rosidl_t.00D4EF3C.tlog\rosidl_typesupport_introspection_tests__rosidl_typesupport_introspection_cpp.lastbuildstate exceeds the OS max path limit. The fully qualified file name must be less than 260 characters. [C:\dev\ros2_humble\build\rosidl_typesupport_introspection_tests\rosidl_typesupport_introspection_tests__rosidl_typesupport_introspection_cpp.vcxproj]
Failed   <<< rosidl_typesupport_introspection_tests [10.1s, exited with code 1]

Summary: 0 packages finished [12.1s]
  1 package failed: rosidl_typesupport_introspection_tests

genevanmeter avatar May 20 '22 15:05 genevanmeter

See #3130, which both shortens the path and provides a link to the instructions on how to increase the path limit.

clalancette avatar Oct 25 '22 21:10 clalancette