diff --git a/.github/workflows/abi.yaml b/.github/workflows/abi.yaml new file mode 100644 index 0000000000..fece42a7e9 --- /dev/null +++ b/.github/workflows/abi.yaml @@ -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:-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-" 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 diff --git a/rclcpp/include/rclcpp/node.hpp b/rclcpp/include/rclcpp/node.hpp index 35863abba4..86780b4b6c 100644 --- a/rclcpp/include/rclcpp/node.hpp +++ b/rclcpp/include/rclcpp/node.hpp @@ -76,6 +76,7 @@ namespace rclcpp { /// Node is the single point of entry for creating publishers and subscribers. +/// ABI test: this comment line has no effect on the compiled library. class Node : public std::enable_shared_from_this { public: