Skip to content

turn the FATAL_ERROR for ROS distro check into a WARNING - #3550

Merged
Nir-Az merged 4 commits into
realsenseai:ros2-developmentfrom
christian-rauch:skip_fatal_distro_check
Aug 28, 2026
Merged

Nir-Az merged 4 commits into
realsenseai:ros2-developmentfrom
christian-rauch:skip_fatal_distro_check

Conversation

@christian-rauch

@christian-rauch christian-rauch commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

I would like to suggest replacing the FATAL_ERROR for the distro check with a WARNING, so this can continue to built if there are no API breakages etc.

Fixes #3549 .

Copilot AI lite review requested due to automatic review settings August 17, 2026 12:58
@sysrsbuild-gh

Copy link
Copy Markdown

Can one of the admins verify this patch?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the ROS 2 distribution gating logic in realsense2_camera so that an unrecognized $ENV{ROS_DISTRO} no longer hard-stops CMake configuration, aiming to allow best-effort builds on newer/unsupported distros.

Changes:

  • Replaced message(FATAL_ERROR ...) with message(WARNING ...) when $ENV{ROS_DISTRO} is not one of the explicitly supported distros.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread realsense2_camera/CMakeLists.txt Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

realsense2_camera/CMakeLists.txt:217

  • Switching the unsupported-distro case from FATAL_ERROR to WARNING lets CMake configure continue, but it also means no distro macro is defined for unknown distros. The codebase already has distro-gated compilation for Lyrical (e.g., src/image_publisher.cpp uses #if defined( LYRICAL ) || defined( ROLLING )), so a ROS_DISTRO like lyrical will now proceed without -DLYRICAL and likely compile against the wrong image_transport API.

Consider adding an explicit lyrical branch (since it’s referenced in code) and/or a safe fallback macro (e.g., ROLLING) when continuing after the warning, so the build uses the intended compatibility path.

else()
  message(WARNING "Unsupported ROS Distribution: " "$ENV{ROS_DISTRO}")
endif()

@christian-rauch

Copy link
Copy Markdown
Contributor Author

@Nir-Az Can you have a look at this?

@Nir-Az

Nir-Az commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Hi @christian-rauch
Sorry for the delay response as I am OOO.
ros2-development branch already support Lyrical.
Release to ROS build farm is targeting in the next 1-2 weeks.

@christian-rauch

Copy link
Copy Markdown
Contributor Author

ros2-development branch already support Lyrical.

This PR is not only about the lyrical release. I propose softening the FATAL_ERROR so this will also build on newer distros that do not require API updated.

@Nir-Az

Nir-Az commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

ros2-development branch already support Lyrical.

This PR is not only about the lyrical release. I propose softening the FATAL_ERROR so this will also build on newer distros that do not require API updated.

NP, we can do that.
If you can please base and target this PR to ros2-development we can merge it.

@christian-rauch
christian-rauch changed the base branch from ros2-master to ros2-development August 20, 2026 20:41
@christian-rauch
christian-rauch force-pushed the skip_fatal_distro_check branch from 3871f50 to 15ac083 Compare August 21, 2026 08:29
@christian-rauch

Copy link
Copy Markdown
Contributor Author

If you can please base and target this PR to ros2-development we can merge it.

I rebased and force-pushed.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

realsense2_camera/CMakeLists.txt:220

  • Changing the unsupported-distro branch from FATAL_ERROR to WARNING means CMake will continue without defining any of the distro-specific compile macros (FOXY/HUMBLE/…/LYRICAL). Several sources rely on these macros to select the correct API variant (e.g., realsense2_camera/src/image_publisher.cpp uses #if defined(LYRICAL) || defined(ROLLING) to choose the image_transport::create_publisher overload). For a new/unknown distro, this can turn a clear configuration-time failure into harder-to-diagnose compile errors or subtly wrong API selection.

Consider either: (1) keeping a hard error and explicitly adding new distros as they’re validated, or (2) in the unknown-distro branch, defining a deliberate fallback macro (e.g., treat as latest) / switching those codepaths to version-based checks so behavior is deterministic.

  message(WARNING "Unsupported ROS Distribution: " "$ENV{ROS_DISTRO}")
endif()

@Nir-Az
Nir-Az self-requested a review August 23, 2026 21:02

@Nir-Az Nir-Az left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, retrigger CI to see why it failes

@christian-rauch

Copy link
Copy Markdown
Contributor Author

@Nir-Az Can you check again?

@Nir-Az
Nir-Az merged commit bdf4aac into realsenseai:ros2-development Aug 28, 2026
11 of 12 checks passed
@christian-rauch
christian-rauch deleted the skip_fatal_distro_check branch August 28, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support lyrical

4 participants