You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A package not integrating any artifacts, makes the build system think there's a bug and it throws out a warning. It's usually ignored for packages not intended to be ever distributed.
"Could not run installation step for package '{pkg.name}' "
"because it has no 'install' target".format_map(locals()))
But in some cases, like for a package whose entire purpose is to run tests and is only integrated when -DBUILD_TESTING=ON, the above assumption doesn't hold true.
If the warning is bothersome, brute force fixes (just for reference):
Have the test package install some innocuous empty hello_world.txt file.
Set "cmake-target": "all" in colcon.pkg will ensure when a specific target is specified, the install target is no longer added implicitly.
The short-term clean fix is to include the required artifacts will added when BUILD_TESTING is true and allowing the ament_package() call to happen even when its false, resulting in the package.xml getting installed. See test_rclcpp example.
if(BUILD_TESTING)
### code block
endif()
# TODO should not install anything
ament_package()
A more elegant but time consuming fix might be to add support for a field in colcon.pkg "ignore-no-install-target": true which does nothing but suppresses that message when there is no install target. Then give these packages a colcon.pkg file that's simply
{
"ignore-no-install-target": true
}
This is an under-serviced scenario for both ament and colcon. The "no install target" warning message should not be disabled entirely. Possibly a new package type for test-only CMake projects could be introduced, but needs further discussion.
The text was updated successfully, but these errors were encountered:
A package not integrating any artifacts, makes the build system think there's a bug and it throws out a warning. It's usually ignored for packages not intended to be ever distributed.
colcon-cmake/colcon_cmake/task/cmake/build.py
Lines 115 to 117 in 20972f1
But in some cases, like for a package whose entire purpose is to run tests and is only integrated when
-DBUILD_TESTING=ON
, the above assumption doesn't hold true.If the warning is bothersome, brute force fixes (just for reference):
hello_world.txt
file."cmake-target": "all"
incolcon.pkg
will ensure when a specific target is specified, the install target is no longer added implicitly.The short-term clean fix is to include the required artifacts will added when
BUILD_TESTING
is true and allowing theament_package()
call to happen even when its false, resulting in the package.xml getting installed. See test_rclcpp example.A more elegant but time consuming fix might be to add support for a field in colcon.pkg "ignore-no-install-target": true which does nothing but suppresses that message when there is no install target. Then give these packages a
colcon.pkg
file that's simplyThis is an under-serviced scenario for both ament and colcon. The "no install target" warning message should not be disabled entirely. Possibly a new package type for test-only CMake projects could be introduced, but needs further discussion.
The text was updated successfully, but these errors were encountered: