Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
87 changes: 87 additions & 0 deletions .github/workflows/prebuild-linux-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Prebuild Linux ARM64

on:
workflow_dispatch:
pull_request:
branches:
- develop
push:
tags:
- '*'

jobs:
prebuild:
runs-on: ubuntu-24.04-arm
container:
image: ${{ matrix.docker_image }}
strategy:
fail-fast: false
matrix:
node-version: [22.X]
architecture: [arm64]
ros_distribution:
- humble
- jazzy
- kilted
include:
# Humble Hawksbill (May 2022 - May 2027)
- docker_image: ubuntu:jammy
ros_distribution: humble
ubuntu_codename: jammy
# Jazzy Jalisco (May 2024 - May 2029)
- docker_image: ubuntu:noble
ros_distribution: jazzy
ubuntu_codename: noble
# Kilted Kaiju (May 2025 - Dec 2026)
- docker_image: ubuntu:noble
ros_distribution: kilted
ubuntu_codename: noble

steps:
- name: Setup Node.js ${{ matrix.node-version }} on ${{ matrix.architecture }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
architecture: ${{ matrix.architecture }}

- name: Setup ROS2
uses: ros-tooling/[email protected]
with:
required-ros-distributions: ${{ matrix.ros_distribution }}

- name: Install test-msgs on Linux
shell: bash
run: |
sudo apt install ros-${{ matrix.ros_distribution }}-test-msgs

- uses: actions/checkout@v5

- name: Install dependencies
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
npm i

- name: Generate prebuilt binary
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
npm run prebuild

- name: Upload prebuilt binary
uses: actions/upload-artifact@v4
with:
name: prebuilt-linux-arm64-node${{ matrix.node-version }}-${{ matrix.ubuntu_codename }}-${{ matrix.ros_distribution }}
path: prebuilds/linux-arm64/*.node
if-no-files-found: error

- name: Test loading prebuilt
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
node -e "
const rclnodejs = require('./index.js');
console.log('Successfully loaded rclnodejs with prebuilt binary');
console.log('Platform:', process.platform, 'Arch:', process.arch);
console.log('ROS_DISTRO:', process.env.ROS_DISTRO);
"
87 changes: 87 additions & 0 deletions .github/workflows/prebuild-linux-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Prebuild Linux x64

on:
workflow_dispatch:
pull_request:
branches:
- develop
push:
tags:
- '*'

jobs:
prebuild:
runs-on: ubuntu-latest
container:
image: ${{ matrix.docker_image }}
strategy:
fail-fast: false
matrix:
node-version: [22.X]
architecture: [x64]
ros_distribution:
- humble
- jazzy
- kilted
include:
# Humble Hawksbill (May 2022 - May 2027)
- docker_image: ubuntu:jammy
ros_distribution: humble
ubuntu_codename: jammy
# Jazzy Jalisco (May 2024 - May 2029)
- docker_image: ubuntu:noble
ros_distribution: jazzy
ubuntu_codename: noble
# Kilted Kaiju (May 2025 - Dec 2026)
- docker_image: ubuntu:noble
ros_distribution: kilted
ubuntu_codename: noble

steps:
- name: Setup Node.js ${{ matrix.node-version }} on ${{ matrix.architecture }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
architecture: ${{ matrix.architecture }}

- name: Setup ROS2
uses: ros-tooling/[email protected]
with:
required-ros-distributions: ${{ matrix.ros_distribution }}

- name: Install test-msgs on Linux
shell: bash
run: |
sudo apt install ros-${{ matrix.ros_distribution }}-test-msgs

- uses: actions/checkout@v5

- name: Install dependencies
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
npm i

- name: Generate prebuilt binary
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
npm run prebuild

- name: Upload prebuilt binary
uses: actions/upload-artifact@v4
with:
name: prebuilt-linux-x64-node${{ matrix.node-version }}-${{ matrix.ubuntu_codename }}-${{ matrix.ros_distribution }}
path: prebuilds/linux-x64/*.node
if-no-files-found: error

- name: Test loading prebuilt
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
node -e "
const rclnodejs = require('./index.js');
console.log('Successfully loaded rclnodejs with prebuilt binary');
console.log('Platform:', process.platform, 'Arch:', process.arch);
console.log('ROS_DISTRO:', process.env.ROS_DISTRO);
"
19 changes: 2 additions & 17 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,6 @@
'defines': [
'OS_WINDOWS'
],
'conditions': [
[
'node_major_version >= 23', {
'cflags_cc': [
'-std=c++20'
]
}
],
[
'node_major_version < 23', {
'cflags_cc': [
'-std=c++17'
]
}
]
],
'include_dirs': [
'./src/third_party/dlfcn-win32/',
],
Expand All @@ -129,6 +113,7 @@
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': '2', # /EHsc
'AdditionalOptions': ['/std:c++20']
},
'VCLinkerTool': {
'AdditionalDependencies': ['psapi.lib'],
Expand All @@ -147,7 +132,7 @@
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOS_DEPLOYMENT_TARGET': '10.12',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++17'
'CLANG_CXX_LANGUAGE_STANDARD': 'c++20'
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const {
} = require('./lib/parameter.js');
const path = require('path');
const QoS = require('./lib/qos.js');
const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./lib/native_loader.js');
const tsdGenerator = require('./rostsd_gen/index.js');
const validator = require('./lib/validator.js');
const Time = require('./lib/time.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/action/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('../native_loader.js');
const ActionInterfaces = require('./interfaces.js');
const ActionUuid = require('./uuid.js');
const ClientGoalHandle = require('./client_goal_handle.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/action/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('../native_loader.js');

/**
* Get a list of action names and types for action clients associated with a node.
Expand Down
2 changes: 1 addition & 1 deletion lib/action/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('../native_loader.js');
const ActionInterfaces = require('./interfaces.js');
const ActionUuid = require('./uuid.js');
const DistroUtils = require('../distro.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/action/server_goal_handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('../native_loader.js');
const ActionInterfaces = require('./interfaces.js');
const Deferred = require('./deferred.js');
const { GoalEvent } = require('./response.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const DistroUtils = require('./distro.js');
const Entity = require('./entity.js');
const debug = require('debug')('rclnodejs:client');
Expand Down
2 changes: 1 addition & 1 deletion lib/clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const Time = require('./time.js');
const ClockType = require('./clock_type.js');

Expand Down
2 changes: 1 addition & 1 deletion lib/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');

let defaultContext = null;

Expand Down
2 changes: 1 addition & 1 deletion lib/duration.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const S_TO_NS = 10n ** 9n;

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/event_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const DistroUtils = require('./distro.js');
const Entity = require('./entity.js');

Expand Down
2 changes: 1 addition & 1 deletion lib/guard_condition.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const Entity = require('./entity.js');
const Context = require('./context.js');

Expand Down
2 changes: 1 addition & 1 deletion lib/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const LifecyclePublisher = require('./lifecycle_publisher.js');
const loader = require('./interface_loader.js');
const Context = require('./context.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/lifecycle_publisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const Logging = require('./logging.js');
const Publisher = require('./publisher.js');

Expand Down
2 changes: 1 addition & 1 deletion lib/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

const path = require('path');
const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');

/**
* Enum for LoggingSeverity
Expand Down
Loading
Loading