Skip to content

Commit

Permalink
Add support for node v18 & v19 (#884)
Browse files Browse the repository at this point in the history
Enables rclnodejs to run on Node v18 and v19.

Updated:

package.json -
binding.gyp - upgrade to use c++17
updated README and BUILD docs to reference Node 18 & 19
gihub actions updated to include Node 18 & 19 in compatibility tests for linux and windows

Fix #382 #383
  • Loading branch information
wayneparrott authored and minggangw committed Nov 18, 2022
1 parent 48142d1 commit dbafc3a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/linux-build-and-test-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Setup ROS2
uses: ros-tooling/setup-ros@v0.3
uses: ros-tooling/setup-ros@v0.4
with:
required-ros-distributions: ${{ matrix.ros_distribution }}

Expand All @@ -41,14 +41,14 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.X, 12.x, 14.X, 16.X, 17.X]
node-version: [10.X, 12.x, 14.X, 16.X, 17.X, 18.X, 19.X]
ros_distribution:
- foxy
- galactic

steps:
- name: Setup ROS2
uses: ros-tooling/setup-ros@v0.3
uses: ros-tooling/setup-ros@v0.4
with:
required-ros-distributions: ${{ matrix.ros_distribution }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linux-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X]
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X, 18.X, 19.X]
steps:
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Setup ROS2
uses: ros-tooling/setup-ros@v0.3
uses: ros-tooling/setup-ros@v0.4
with:
required-ros-distributions: ${{ needs.identify-ros-distro.outputs.distro }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-build-and-test-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X]
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X, 18.X, 19.X]
ros_distribution:
# - foxy
- galactic
Expand All @@ -23,7 +23,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Setup ROS2
uses: ros-tooling/setup-ros@v0.3
uses: ros-tooling/setup-ros@v0.4
with:
required-ros-distributions: ${{ matrix.ros_distribution }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X]
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X, 18.X, 19.X]
steps:
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Setup ROS2
uses: ros-tooling/setup-ros@v0.3
uses: ros-tooling/setup-ros@v0.4
with:
required-ros-distributions: ${{ needs.identify-ros-distro.outputs.distro }}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ rclnodejs.init().then(() => {

Before installing `rclnodejs` please ensure the following software is installed and configured on your system:

- [Nodejs](https://nodejs.org/en/) version between 10.23.1 - 17.x.
- [Nodejs](https://nodejs.org/en/) version between 10.23.1 - 19.x.

- [ROS 2 SDK](https://index.ros.org/doc/ros2/Installation/) for details.
**DON'T FORGET TO [SOURCE THE ROS 2 SETUP FILE](https://index.ros.org/doc/ros2/Tutorials/Configuring-ROS2-Environment/#source-the-setup-files)**
Expand Down
6 changes: 3 additions & 3 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
'OS_LINUX'
],
'cflags_cc': [
'-std=c++14'
'-std=c++17'
],
'include_dirs':
[
Expand Down Expand Up @@ -100,7 +100,7 @@
'OS_WINDOWS'
],
'cflags_cc': [
'-std=c++14'
'-std=c++17'
],
'include_dirs': [
'./src/third_party/dlfcn-win32/',
Expand Down Expand Up @@ -156,7 +156,7 @@
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOS_DEPLOYMENT_TARGET': '10.12',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++14'
'CLANG_CXX_LANGUAGE_STANDARD': 'c++17'
}
}
],
Expand Down
8 changes: 4 additions & 4 deletions docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Alternatively, you can build ROS 2 from scratch. Please select the platform you
### Install `Node.js`

**Notice:**
`rclnodejs` should only be used with node versions between 8.12 - 17.x. The lowest LTS Node.js we used to verify the unit tests is `8.12.0`. And there is a known issue installing rclnodejs with versions of node >= 18.0.
`rclnodejs` should only be used with node versions between 10.23.1 - 19.x. The lowest LTS Node.js we used to verify the unit tests is `10.23.1`.

The `Node.js` version we selected is the LTS [`Gallium`](https://nodejs.org/download/release/latest-gallium/) (16.x). You can install it:
I install Nodejs from either:

- Download from Node.js offical [website](https://nodejs.org/en/), and install it.
- Use the Node Version Manager ([nvm](https://github.com/creationix/nvm)) to install it.
- Node.js offical [website](https://nodejs.org/en/)
- Node Version Manager ([nvm](https://github.com/creationix/nvm))

### Get Code

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@
]
},
"engines": {
"node": ">= 10.23.1 <18.0.0"
"node": ">= 10.23.1 <20.0.0"
}
}

0 comments on commit dbafc3a

Please sign in to comment.