Open chfritz opened 2 years ago
I've discovered that npm install rclnodejs@0.21.1
works, so it seems that the issue was introduced recently.
Thanks for reporting the issue, through the error log, it seems that it happens when compiling the nan, do you try with Humble Hawksbill?
I haven't -- I'm on ubuntu 20 -- but the nan.h
file is not from the OS but part of the npm nan package: https://github.com/nodejs/nan/blob/main/nan.h. So I don't think changing the ROS2 release would make a difference.
Yes, the header comes from nan package, theoretically, the behavior should be the same on different rclnodejs versions. I also checked the code change between these 2 versions, and it seems nothing special (we don't upgrade the nan version number). I will try to build it on my dev machine, but I believe it's caused by some toolchain env problem.
I'm also having a similar issue Ubuntu 22.04 LTS Humble Hawkesbill
Would you try to upgrade your GCC to 11 and see if the failure is still there? I verified with the following configuration and it works fine:
Meanwhile, looking through the latest build on actions, no failures were found.
I noticed your env includes:
Platform / OS: Ubuntu 20.04.5
My understanding as of the Humble release, includes latest Rolling release, that Ubuntu 22 (jammy) is required. As a quick test I set up a new dev env with Ubuntu 22.04.01 (lts), Node 16 (lts) and rclnodejs from npm. No issues observed with rclnodejs installation and running simple node was successful. I repeated the process with the Humble release with success.
Hope this helps.
g++-11 is not available on 20.04 so I can't try that. I've also noticed that there is no build status for galactic right now (see Readme), so I assume that combination is not currently being tested? Another question: is there a reason why the repo doesn't include a package-lock.json
? Without that, it's not deterministic which version of the dependencies was used in current and past npm releases. We could find out, of course, by inspecting the npm bundle, but wouldn't be able to reproduce it from the
tag commit alone.
I've also noticed that there is no build status for galactic right now (see Readme), so I assume that combination is not currently being tested?
Opps! Thx for calling this out. Will get the status indicator fixed asap. The os/ros compatibility matrix are completing successfully for linux. https://github.com/RobotWebTools/rclnodejs/actions/runs/3009191104
Looks like a dependent action for setting up ros distros on windows is failing (again). Will give it a look asap. https://github.com/RobotWebTools/rclnodejs/runs/8232819051?check_suite_focus=true
@chfritz @meropis finally, I hit this issue on 20.04 with g++9.4, and I have a workaround to mitigate this weird issue (it cannot be reproduced with 22.04...), please remove the following section from your binding.gyp
I will submit a PR to fix it and prepare a hotfix release, thanks!
Sorry for the delay in testing this.
Removing the lines in binding.gyp
indeed get me past the ::memchr
error. But I'm getting:
> npm i
> rclnodejs@0.22.2 install
> npm run rebuild
> rclnodejs@0.22.2 rebuild
> npm run clean && node-gyp -j 16 rebuild
> rclnodejs@0.22.2 clean
> node-gyp clean && rimraf ./generated
make: Entering directory '/tmp/k/rclnodejs/build'
CXX(target) Release/obj.target/rclnodejs/src/addon.o
CXX(target) Release/obj.target/rclnodejs/src/executor.o
CXX(target) Release/obj.target/rclnodejs/src/handle_manager.o
CXX(target) Release/obj.target/rclnodejs/src/rcl_action_bindings.o
CXX(target) Release/obj.target/rclnodejs/src/rcl_bindings.o
CXX(target) Release/obj.target/rclnodejs/src/rcl_handle.o
CXX(target) Release/obj.target/rclnodejs/src/rcl_lifecycle_bindings.o
CXX(target) Release/obj.target/rclnodejs/src/rcl_utilities.o
CXX(target) Release/obj.target/rclnodejs/src/shadow_node.o
../src/rcl_bindings.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE rclnodejs::CreateSubscription(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/rcl_bindings.cpp:715:23: error: ‘rcl_subscription_options_set_content_filter_options’ was not declared in this scope
715 | rcl_ret_t ret = rcl_subscription_options_set_content_filter_options(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
More details: when I use v0.21.2 then removing the lines from binding.gyp works on Ubuntu 20 (w/ rolling) but fails on Ubuntu 22. However, of course, 0.21.2 builds fine on Ubuntu 22 (w/ humble) unmodified.
Ok, so I've tested a whole matrix of combinations and finally realized that rolling on Ubuntu 20 is a different version from rolling on Ubuntu 22 (see here) and the condition in bindings.gyp isn't able to distinguish them . I'll try to come up with a better condition.
PS: If I can. Seems like there are other issues with compiling against rolling on u20 as well:
../src/rcl_bindings.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE rclnodejs::CreateSubscription(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/rcl_bindings.cpp:715:23: error: ‘rcl_subscription_options_set_content_filter_options’ was not declared in this scope
715 | rcl_ret_t ret = rcl_subscription_options_set_content_filter_options(
Description
When I try to install using
npm install rclnodejs
, it fails with:(full log below).
Steps To Reproduce
npm install rclnodejs
Expected Behavior
For it to install as described in the readme.
Actual Behavior