Skip to content
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

build(deps): fix npm (grpc) build on NodeJS v20.4.0 #2562

Closed
petermetz opened this issue Jul 21, 2023 · 0 comments · Fixed by #2563
Closed

build(deps): fix npm (grpc) build on NodeJS v20.4.0 #2562

petermetz opened this issue Jul 21, 2023 · 0 comments · Fixed by #2563
Assignees
Labels
bug Something isn't working dependencies Pull requests that update a dependency file good-first-issue Good for newcomers good-first-issue-400-expert P2 Priority 2: High Weaver Tasks related to the future of Cactus & Weaver together.

Comments

@petermetz
Copy link
Contributor

petermetz commented Jul 21, 2023

Summary

Currently the configure script fails if you are trying to execute it on
NodeJS v20 because the very outdated grpc dependency that we use in some of the
packages has C++ code that it wants to compile but that is breaking aganist the
new V8 headers that NodeJS v20 ships with.

Related Other Issue

This one is also talking about upgradnig gRPC which is the proposed solution to fix this issue as well:
https://github.com/hyperledger/cacti/issues/1507

Proposed solution

Upgrade the grpc dependencies.

Reproduction

To reproduce:

  1. Install NodeJS v20
  2. Run yarn install or yarn configure and then watch it produces errors

Logs

build.log

  CC(target) Release/obj.target/ares/deps/grpc/third_party/cares/cares/windows_port.o
rm -f Release/obj.target/libares.a Release/obj.target/libares.a.ar-file-list; mkdir -p `dirname Release/obj.target/libares.a`
ar crs Release/obj.target/libares.a @Release/obj.target/libares.a.ar-file-list
  COPY Release/libares.a
  CC(target) Release/obj.target/address_sorting/deps/grpc/third_party/address_sorting/address_sorting.o
  CC(target) Release/obj.target/address_sorting/deps/grpc/third_party/address_sorting/address_sorting_posix.o
  CC(target) Release/obj.target/address_sorting/deps/grpc/third_party/address_sorting/address_sorting_windows.o
rm -f Release/obj.target/libaddress_sorting.a Release/obj.target/libaddress_sorting.a.ar-file-list; mkdir -p `dirname Release/obj.target/libaddress_sorting.a`
ar crs Release/obj.target/libaddress_sorting.a @Release/obj.target/libaddress_sorting.a.ar-file-list
  COPY Release/libaddress_sorting.a
  CXX(target) Release/obj.target/grpc_node/ext/byte_buffer.o
In file included from ../../nan/nan.h:178,
                 from ../ext/byte_buffer.cc:21:
../../nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                       ^~~~~~~~~~~~~~~~~
../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                                        ^
In file included from ../ext/byte_buffer.cc:21:
../../nan/nan.h: In function ‘bool Nan::IdleNotification(int)’:
../../nan/nan.h:684:63: warning: ‘bool v8::Isolate::IdleNotificationDeadline(double)’ is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
  684 |     return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  685 |         idle_time_in_ms * 0.001);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~                               
In file included from /****/.cache/node-gyp/20.4.0/include/node/v8-initialization.h:13,
                 from /****/.cache/node-gyp/20.4.0/include/node/v8.h:34,
                 from /****/.cache/node-gyp/20.4.0/include/node/node.h:73,
                 from ../../nan/nan.h:58,
                 from ../ext/byte_buffer.cc:21:
/****/.cache/node-gyp/20.4.0/include/node/v8-isolate.h:1293:8: note: declared here
 1293 |   bool IdleNotificationDeadline(double deadline_in_seconds);
      |        ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../ext/byte_buffer.cc:21:
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../../nan/nan.h:2544:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&, Nan::imp::Sig&)’
 2544 |   tpl->SetAccessor(
      |   ~~~~~~~~~~~~~~~~^
 2545 |       name
      |       ~~~~         
 2546 |     , getter_
      |     ~~~~~~~~~      
 2547 |     , setter_
      |     ~~~~~~~~~      
 2548 |     , obj
      |     ~~~~~          
 2549 |     , settings
      |     ~~~~~~~~~~     
 2550 |     , attribute
      |     ~~~~~~~~~~~    
 2551 |     , signature);
      |     ~~~~~~~~~~~~   
In file included from /****/.cache/node-gyp/20.4.0/include/node/v8-function.h:15,
                 from /****/.cache/node-gyp/20.4.0/include/node/v8.h:33,
                 from /****/.cache/node-gyp/20.4.0/include/node/node.h:73,
                 from ../../nan/nan.h:58,
                 from ../ext/byte_buffer.cc:21:
/****/.cache/node-gyp/20.4.0/include/node/v8-template.h:809:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
  809 |   void SetAccessor(
      |        ^~~~~~~~~~~
/****/.cache/node-gyp/20.4.0/include/node/v8-template.h:814:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  814 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/****/.cache/node-gyp/20.4.0/include/node/v8-template.h:816:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
  816 |   void SetAccessor(
      |        ^~~~~~~~~~~
/****/.cache/node-gyp/20.4.0/include/node/v8-template.h:821:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  821 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [grpc_node.target.mk:194: Release/obj.target/grpc_node/ext/byte_buffer.o] Error 1
make: Leaving directory '/****/a/cacti-1/packages/cactus-plugin-ledger-connector-fabric-socketio/node_modules/grpc/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
@petermetz petermetz added the P2 Priority 2: High label Jul 21, 2023
@petermetz petermetz self-assigned this Jul 21, 2023
@petermetz petermetz added bug Something isn't working good-first-issue Good for newcomers ConnectionChain dependencies Pull requests that update a dependency file good-first-issue-400-expert Weaver Tasks related to the future of Cactus & Weaver together. labels Jul 21, 2023
petermetz referenced this issue in petermetz/cacti Jul 21, 2023
WORK IN PROGRESS
--------------

1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.18 at the time.
1.2. Also outrighted swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Peter Somogyvari <[email protected]>
petermetz referenced this issue in petermetz/cacti Jul 22, 2023
WORK IN PROGRESS
--------------

1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.18 at the time.
1.2. Also outrighted swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Peter Somogyvari <[email protected]>
petermetz referenced this issue in petermetz/cacti Jul 22, 2023
WORK IN PROGRESS
--------------

1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.18 at the time.
1.2. Also outrighted swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Peter Somogyvari <[email protected]>
sandeepnRES referenced this issue in petermetz/cacti Aug 9, 2023
WORK IN PROGRESS
--------------

1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.18 at the time.
1.2. Also outrighted swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Peter Somogyvari <[email protected]>
Signed-off-by: Sandeep Nishad <[email protected]>
@petermetz petermetz added this to the v2.0.0-alpha.2 milestone Aug 18, 2023
petermetz referenced this issue in petermetz/cacti Sep 10, 2023
WORK IN PROGRESS
--------------

1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.18 at the time.
1.2. Also outright swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Peter Somogyvari <[email protected]>
Signed-off-by: Sandeep Nishad <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
petermetz referenced this issue in petermetz/cacti Sep 11, 2023
WORK IN PROGRESS
--------------

1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.18 at the time.
1.2. Also outright swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Sandeep Nishad <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
petermetz added a commit to petermetz/cacti that referenced this issue Sep 11, 2023
Depends on hyperledger-cacti#2562 - build(deps): fix npm (grpc) build on NodeJS v20.4.0

Fixes hyperledger-cacti#2684

Signed-off-by: Peter Somogyvari <[email protected]>
sandeepnRES pushed a commit to petermetz/cacti that referenced this issue Sep 20, 2023
Depends on hyperledger-cacti#2562 - build(deps): fix npm (grpc) build on NodeJS v20.4.0

Fixes hyperledger-cacti#2684

Signed-off-by: Peter Somogyvari <[email protected]>
petermetz referenced this issue in petermetz/cacti Oct 5, 2023
1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.18 at the time.
1.2. Also outright swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Sandeep Nishad <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
petermetz referenced this issue in petermetz/cacti Oct 5, 2023
1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.18 at the time.
1.2. Also outright swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Sandeep Nishad <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
petermetz referenced this issue in petermetz/cacti Oct 12, 2023
1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.18 at the time.
1.2. Also outright swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Sandeep Nishad <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
petermetz added a commit to petermetz/cacti that referenced this issue Oct 16, 2023
Depends on hyperledger-cacti#2562 - build(deps): fix npm (grpc) build on NodeJS v20.4.0

Fixes hyperledger-cacti#2684

[skip ci]

Signed-off-by: Peter Somogyvari <[email protected]>
petermetz referenced this issue in petermetz/cacti Oct 17, 2023
1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.19 at the time.
1.2. Also outright swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Sandeep Nishad <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
petermetz referenced this issue Oct 17, 2023
1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.19 at the time.
1.2. Also outright swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Sandeep Nishad <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
sandeepnRES referenced this issue in sandeepnRES/cacti Dec 21, 2023
1. Eliminates all uses of the old `grpc` dependency from the codebase.
1.1. Upgraded all outdated fabirc-network, fabric-client and fabric-ca-client
dependencies to the latest stable 2.2.x version which is 2.2.19 at the time.
1.2. Also outright swapped `grpc` declarations with `@grpc/grpc-js`.
The rest of the diff is due to the incompatibility of the two mentioned.

Fixes https://github.com/hyperledger/cacti/issues/2562
Fixes https://github.com/hyperledger/cacti/issues/1507

Signed-off-by: Sandeep Nishad <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file good-first-issue Good for newcomers good-first-issue-400-expert P2 Priority 2: High Weaver Tasks related to the future of Cactus & Weaver together.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant