-
Notifications
You must be signed in to change notification settings - Fork 85
Gate C++ Standard By ROS Distro #1477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,15 @@ I install Nodejs from either: | |||||||||||||||||||||||||||||
| - Node.js official [website](https://nodejs.org/en/) | ||||||||||||||||||||||||||||||
| - Node Version Manager ([nvm](https://github.com/creationix/nvm)) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### C++ Toolchain Requirements | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| The native addon follows the ROS 2 distro toolchain requirement: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - Humble, Jazzy, and Kilted build with C++17. | ||||||||||||||||||||||||||||||
| - Post-Kilted distros, including Lyrical and newer Rolling snapshots, build with C++20. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| If no prebuilt binary is available for your target, make sure your local compiler matches the required C++ standard before running `npm install`. | ||||||||||||||||||||||||||||||
|
Comment on lines
+28
to
+30
|
||||||||||||||||||||||||||||||
| - Post-Kilted distros, including Lyrical and newer Rolling snapshots, build with C++20. | |
| If no prebuilt binary is available for your target, make sure your local compiler matches the required C++ standard before running `npm install`. | |
| - Rolling may require C++20 depending on the snapshot and ROS 2 toolchain in use. | |
| If no prebuilt binary is available for your target, make sure your local compiler matches the required C++ standard before running `npm install`. For distros or snapshots newer than the ones explicitly listed above, verify the toolchain requirement in the corresponding ROS 2 documentation first. |
Copilot
AI
Apr 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section states the addon "follows the ROS 2 distro toolchain requirement" in general, but the build config only gates the C++ standard for Linux and Windows; macOS is still hard-coded to c++17 in binding.gyp regardless of ros_version. To avoid misleading source-builders, clarify that the C++17/C++20 split applies to the Linux/Windows build paths (or update the macOS build settings to match).
| The native addon follows the ROS 2 distro toolchain requirement: | |
| - Humble, Jazzy, and Kilted build with C++17. | |
| - Post-Kilted distros, including Lyrical and newer Rolling snapshots, build with C++20. | |
| If no prebuilt binary is available for your target, make sure your local compiler matches the required C++ standard before running `npm install`. | |
| The native addon follows the ROS 2 distro toolchain requirement on Linux and Windows source-build paths: | |
| - Humble, Jazzy, and Kilted build with C++17. | |
| - Post-Kilted distros, including Lyrical and newer Rolling snapshots, build with C++20. | |
| On macOS, the current source-build configuration is fixed to C++17. | |
| If no prebuilt binary is available for your target, make sure your local compiler matches the required C++ standard for your platform before running `npm install`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This C++ standard gate relies on
ros_versioncoming fromnode scripts/ros_distro.js, which will exit with an error for unknown ROS_DISTRO values. Sincelib/distro.jsdoes not currently include a Lyrical ID, builds on Lyrical will fail (even though the PR description/docs call it out). Consider adding a Lyrical entry (likely 2605) to the distro mapping alongside this change so theros_version > 2505condition can actually be reached on that distro.