Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/abi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This workflow checks ABI compatibility of the shared libraries built from
# this repository on every PR:
#
# - librclcpp.so (rclcpp)
# - librclcpp_action.so (rclcpp_action)
# - libcomponent_manager.so (rclcpp_components)
# - librclcpp_lifecycle.so (rclcpp_lifecycle)
#
# It uses the reusable ros2-abi-action workflow, which:
# 1. resolves the ROS 2 distro from the PR's target branch (rolling/lyrical/kilted/jazzy/humble),
# 2. builds all listed packages twice (once against the target branch, once
# against the PR head) with -g -Og so DWARF debug info is present; a single
# colcon invocation builds the union of the dependency closures exactly once,
# 3. with build-mode: source, imports the distro's ros2.repos and builds
# against today's source tree instead of the released binaries; this is
# required for core repositories like rclcpp, whose dependencies (rcl,
# rmw, ...) are usually ahead of the released Debian packages. The
# incremental strategy starts from the nightly source-built underlay
# image (ros-abi:<distro>-source) and recompiles only what moved since,
# 4. expands the soname glob and delegates the binary ABI diff to
# fujitatomoya/libabigail-action (abidiff), one job per library,
# 5. applies REP-0009 policy automatically: released distros (humble/jazzy/kilted/lyrical)
# fail on an incompatible ABI break, rolling is advisory only,
# 6. surfaces the verdict as a pass/fail check and uploads one report bundle
# (abidiff report + verdict.json) per library.
#
# The sticky PR comment, the "ABI compatible" / "ABI break" labels and the
# "backport-<distro>" candidate labels are NOT posted from here
# (publish: workflow-run). Most rclcpp pull requests come from forks, and on
# pull_request events from a fork GitHub gives this workflow a read-only token
# regardless of the permissions requested below, so any write to the PR would
# fail. abi-report.yaml runs on workflow_run once this workflow completes and
# publishes the comment and labels with a token that may write.
#
# Paired changes in other repositories (e.g. an rcl PR this PR depends on) are
# declared by the PR author in the PR description and applied to the PR side
# of the build:
#
# Depends-On: ros2/rcl#1234
#
# See https://github.com/fujitatomoya/ros2-abi-action for details.
name: abi

on:
pull_request:
branches: [ "rolling", "lyrical", "kilted", "jazzy", "humble" ]

# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:

jobs:
abi:
# Nothing is written to the pull request from this workflow; the report
# workflow holds the write permissions.
permissions:
contents: read
uses: fujitatomoya/ros2-abi-action/.github/workflows/check.yml@v1
with:
# Colcon package names to build (whitespace-separated); no single package
# depends on all the others, so list every package in this repository.
package: rclcpp rclcpp_action rclcpp_components rclcpp_lifecycle
# Shared libraries produced by the packages above. The glob matches all
# libraries in the install tree; tests are not built (BUILD_TESTING=OFF),
# so no test-only libraries are picked up.
soname: "lib*.so"
# rclcpp is a ROS 2 core repository: its dependencies are developed on
# source branches ahead of the released binaries, so build against the
# distro's ros2.repos source tree (nightly-cached, incremental) instead
# of the binary underlay.
build-mode: source
# auto -> distro derived from the PR target branch.
distro: auto
# auto -> REP-0009: strict on released distros, advisory on rolling.
policy: auto
# Leave the PR comment and labels to abi-report.yaml (workflow_run), so
# pull requests from forks get them too.
publish: workflow-run
3 changes: 2 additions & 1 deletion rclcpp/include/rclcpp/expand_topic_or_service_name.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ expand_topic_or_service_name(
const std::string & name,
const std::string & node_name,
const std::string & namespace_,
bool is_service = false);
bool is_service = false,
bool abi_test = false);

} // namespace rclcpp

Expand Down
4 changes: 3 additions & 1 deletion rclcpp/src/rclcpp/expand_topic_or_service_name.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ rclcpp::expand_topic_or_service_name(
const std::string & name,
const std::string & node_name,
const std::string & namespace_,
bool is_service)
bool is_service,
bool abi_test)
{
(void)abi_test;
char * expanded_topic = nullptr;
rcl_allocator_t allocator = rcl_get_default_allocator();
rcutils_allocator_t rcutils_allocator = rcutils_get_default_allocator();
Expand Down
Loading