Why do I receive: Error using ros.intern​al.ROSProj​ectBuilder​/buildPack​age (line 534) Error building package: build log.

Identifying message files in folder 'D:/Documents/MATLAB/Examples/R2021a/ros/ROS2CustomMessagesExample/custom'.Done.
Validating message files in folder 'D:/Documents/MATLAB/Examples/R2021a/ros/ROS2CustomMessagesExample/custom'.Done.
[3/3] Generating MATLAB interfaces for custom message packages... Done.
Running colcon build in folder 'D:/Documents/MATLAB/Examples/R2021a/ros/ROS2CustomMessagesExample/custom/matlab_msg_gen/win64'.
Build in progress. This may take several minutes...
Error building package: build log.
Error in ros2genmsg (line 241)
buildPackage(builder, [], ' --merge-install', colconMakeArgs); %other messages might need to be present in the same directory

5 Comments

Hello Manuel,
A lot of the issues that can come up during a ROS 2 package build is tracked internally by colcon (the build tool). If you open up the build log that is linked in the error message, you should be able to get more specific information about the actual build error. If you need help interpreting it, please post the relevant parts too.
-Cam
Cannot open buildlog, Apparently erros comes from line 534 in rosproject builder. I'm just trying to run the example
That doesn't really help to narrow it down. Try to look for the build log file in the generated folder -> <architecture> -> log folder. Do this right after attempting to run the code and the error message appears. If the folder/file gets deleted later, you won't be able to open it.
Where exactly in the events or all logger text files should I look up. I cannot attach these text files, but, it seems that error are shown in those txt files.
You can see an example of where the log files are in the comments for this question (for anyone else who sees this). The stderr log should show just the issues, while the stdout_stderr log shows everything in context.

Sign in to comment.

 Accepted Answer

The key part of the error message in the log file is right here:
Path: <...> exceeds the OS max path limit. The fully qualified file name must be less than 260 characters.
The issue is that colcon creates a rather large folder and file heirarchy when doing any kind of package build. If the path to the initial folder is any kind of reasonable length, it may run ito the Windows limitation of 260 characters. Linux and Mac don't have that issue.
I'd suggest either creating a new folder with a shorter path (like D:/ros2) and copying the example files into there for testing, or mapping a network drive to the examples folder and changing directory so that you use that mapped network drive.
-Cam

More Answers (1)

Hi. I check that thread. I have this error coming out from the stdout.log, I am not sure what does it mean. I already reinstalled matlab and python.
" error MSB3491: Could not write lines to file example_b_msgs__rosidl_typesupport_fastrtps_cpp.dir\Release\example_.51"
Checking Build System
Building Custom Rule D:/Documents/MATLAB/Examples/R2021a/ros/ROS2CustomMessagesExample/custom/matlabmsg_gen/win64/src/example_b_msgs/CMakeLists.txt
Building Custom Rule D:/Documents/MATLAB/Examples/R2021a/ros/ROS2CustomMessagesExample/custom/matlab_msg_gen/win64/src/example_b_msgs/CMakeLists.txt
example_b_msgs__rosidl_generator_c.vcxproj -> D:\Documents\MATLAB\Examples\R2021a\ros\ROS2CustomMessagesExample\custom\matlab_msg_gen\win64\build\example_b_msgs\Release\example_b_msgs__rosidl_generator_c.dll
Building Custom Rule D:/Documents/MATLAB/Examples/R2021a/ros/ROS2CustomMessagesExample/custom/matlab_msg_gen/win64/src/example_b_msgs/CMakeLists.txt
example_b_msgs__rosidl_typesupport_c.vcxproj -> D:\Documents\MATLAB\Examples\R2021a\ros\ROS2CustomMessagesExample\custom\matlab_msg_gen\win64\build\example_b_msgs\Release\example_b_msgs__rosidl_typesupport_c.dll
Building Custom Rule D:/Documents/MATLAB/Examples/R2021a/ros/ROS2CustomMessagesExample/custom/matlab_msg_gen/win64/src/example_b_msgs/CMakeLists.txt
example_b_msgs__rosidl_typesupport_cpp.vcxproj -> D:\Documents\MATLAB\Examples\R2021a\ros\ROS2CustomMessagesExample\custom\matlab_msg_gen\win64\build\example_b_msgs\Release\example_b_msgs__rosidl_typesupport_cpp.dll
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(382,5): error MSB3491: Could not write lines to file "example_b_msgs__rosidl_typesupport_fastrtps_cpp.dir\Release\example_.51EA7ED9.tlog\example_b_msgs__rosidl_typesupport_fastrtps_cpp.lastbuildstate". Path: example_b_msgs__rosidl_typesupport_fastrtps_cpp.dir\Release\example_.51EA7ED9.tlog\example_b_msgs__rosidl_typesupport_fastrtps_cpp.lastbuildstate exceeds the OS max path limit. The fully qualified file name must be less than 260 characters. [D:\Documents\MATLAB\Examples\R2021a\ros\ROS2CustomMessagesExample\custom\matlab_msg_gen\win64\build\example_b_msgs\example_b_msgs__rosidl_typesupport_fastrtps_cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(382,5): error MSB3491: Could not write lines to file "example_b_msgs__rosidl_typesupport_introspection_c.dir\Release\example_.32F85CB5.tlog\example_b_msgs__rosidl_typesupport_introspection_c.lastbuildstate". Path: example_b_msgs__rosidl_typesupport_introspection_c.dir\Release\example_.32F85CB5.tlog\example_b_msgs__rosidl_typesupport_introspection_c.lastbuildstate exceeds the OS max path limit. The fully qualified file name must be less than 260 characters. [D:\Documents\MATLAB\Examples\R2021a\ros\ROS2CustomMessagesExample\custom\matlab_msg_gen\win64\build\example_b_msgs\example_b_msgs__rosidl_typesupport_introspection_c.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(382,5): error MSB3491: Could not write lines to file "example_b_msgs__rosidl_typesupport_introspection_cpp.dir\Release\example_.F3DFBDA4.tlog\example_b_msgs__rosidl_typesupport_introspection_cpp.lastbuildstate". Path: example_b_msgs__rosidl_typesupport_introspection_cpp.dir\Release\example_.F3DFBDA4.tlog\example_b_msgs__rosidl_typesupport_introspection_cpp.lastbuildstate exceeds the OS max path limit. The fully qualified file name must be less than 260 characters. [D:\Documents\MATLAB\Examples\R2021a\ros\ROS2CustomMessagesExample\custom\matlab_msg_gen\win64\build\example_b_msgs\example_b_msgs__rosidl_typesupport_introspection_cpp.vcxproj]

Categories

Products

Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!