grpc-perl icon indicating copy to clipboard operation
grpc-perl copied to clipboard

Build fails when i try to compile the module with the new version of libgrpc

Open elishaROBINSON opened this issue 1 year ago • 1 comments

Got these errors when i tried to compile the module with ubuntu22.04 libgrpc

$ make 
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- XS.bs blib/arch/auto/Grpc/XS/XS.bs 644
x86_64-linux-gnu-gcc -c  -I. -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"0.38\" -DXS_VERSION=\"0.38\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.34/CORE"  -DGRPC_VERSION_1_1 -DGRPC_VERSION_1_7 -DGRPC_RECV_STATUS_ON_CLIENT_HAS_ERROR_STRING -DGRPC_SSL_CREDENTIALS_HAS_4_ARGS -DGRPC_METADATA_CREDENTIALS_CRATE_FROM_PLUGIN_HAS_3_ARGS Grpc.c
./ext/call.xs: In function ‘XS_Grpc__XS__Call_new’:
./ext/call.xs:44:15: error: incompatible type for argument 5 of ‘grpc_channel_create_call’
   44 |               method, host_override, deadline->wrapped, NULL);
      |               ^~~~~~
      |               |
      |               const char *
In file included from util.h:9,
                 from Grpc.xs:7:
/usr/include/grpc/grpc.h:219:57: note: expected ‘grpc_slice’ but argument is of type ‘const char *’
  219 |     grpc_completion_queue* completion_queue, grpc_slice method,
      |                                              ~~~~~~~~~~~^~~~~~
./ext/call.xs:44:23: warning: passing argument 6 of ‘grpc_channel_create_call’ from incompatible pointer type [-Wincompatible-pointer-types]
   44 |               method, host_override, deadline->wrapped, NULL);
      |                       ^~~~~~~~~~~~~
      |                       |
      |                       const char *
In file included from util.h:9,
                 from Grpc.xs:7:
/usr/include/grpc/grpc.h:220:23: note: expected ‘const grpc_slice *’ but argument is of type ‘const char *’
  220 |     const grpc_slice* host, gpr_timespec deadline, void* reserved);
      |     ~~~~~~~~~~~~~~~~~~^~~~
./ext/call.xs: In function ‘XS_Grpc__XS__Call_startBatch’:
./ext/call.xs:204:69: warning: assignment to ‘grpc_slice *’ from incompatible pointer type ‘char *’ [-Wincompatible-pointer-types]
  204 |             ops[op_num].data.send_status_from_server.status_details =
      |                                                                     ^
./ext/call.xs:239:65: warning: assignment to ‘grpc_slice *’ from incompatible pointer type ‘char **’ [-Wincompatible-pointer-types]
  239 |           ops[op_num].data.recv_status_on_client.status_details =
      |                                                                 ^
./ext/call.xs:241:49: error: ‘struct grpc_op_recv_status_on_client’ has no member named ‘status_details_capacity’
  241 |           ops[op_num].data.recv_status_on_client.status_details_capacity =
      |                                                 ^
./ext/call.xs: In function ‘XS_Grpc__XS__Call_DESTROY’:
./ext/call.xs:373:7: warning: implicit declaration of function ‘grpc_call_destroy’; did you mean ‘grpc_perl_destroy’? [-Wimplicit-function-declaration]
  373 |       grpc_call_destroy(self->wrapped);
      |       ^~~~~~~~~~~~~~~~~
      |       grpc_perl_destroy
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:5744,
                 from Grpc.xs:3:
./ext/server.xs: In function ‘XS_Grpc__XS__Server_requestCall’:
./ext/server.xs:75:65: error: incompatible type for argument 1 of ‘strlen’
   75 |     hv_stores(result,"method",grpc_slice_or_string_to_sv(details.method));
      |                                                          ~~~~~~~^~~~~~~
      |                                                                 |
      |                                                                 grpc_slice
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/embed.h:244:78: note: in definition of macro ‘hv_common_key_len’
  244 | #define hv_common_key_len(a,b,c,d,e,f)  Perl_hv_common_key_len(aTHX_ a,b,c,d,e,f)
      |                                                                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:520:5: note: in expansion of macro ‘hv_store’
  520 |     hv_store((hv), ("" key ""), (sizeof(key)-1), (val), 0)
      |     ^~~~~~~~
./ext/server.xs:75:5: note: in expansion of macro ‘hv_stores’
   75 |     hv_stores(result,"method",grpc_slice_or_string_to_sv(details.method));
      |     ^~~~~~~~~
util.h:60:44: note: in expansion of macro ‘newSVpvn’
   60 | #define grpc_slice_or_string_to_sv(string) newSVpvn((string), strlen(string))
      |                                            ^~~~~~~~
./ext/server.xs:75:31: note: in expansion of macro ‘grpc_slice_or_string_to_sv’
   75 |     hv_stores(result,"method",grpc_slice_or_string_to_sv(details.method));
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:1342,
                 from Grpc.xs:3:
/usr/include/string.h:407:35: note: expected ‘const char *’ but argument is of type ‘grpc_slice’
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:5744,
                 from Grpc.xs:3:
./ext/server.xs:75:65: error: incompatible type for argument 2 of ‘Perl_newSVpvn’
   75 |     hv_stores(result,"method",grpc_slice_or_string_to_sv(details.method));
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/embed.h:244:78: note: in definition of macro ‘hv_common_key_len’
  244 | #define hv_common_key_len(a,b,c,d,e,f)  Perl_hv_common_key_len(aTHX_ a,b,c,d,e,f)
      |                                                                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:520:5: note: in expansion of macro ‘hv_store’
  520 |     hv_store((hv), ("" key ""), (sizeof(key)-1), (val), 0)
      |     ^~~~~~~~
./ext/server.xs:75:5: note: in expansion of macro ‘hv_stores’
   75 |     hv_stores(result,"method",grpc_slice_or_string_to_sv(details.method));
      |     ^~~~~~~~~
util.h:60:44: note: in expansion of macro ‘newSVpvn’
   60 | #define grpc_slice_or_string_to_sv(string) newSVpvn((string), strlen(string))
      |                                            ^~~~~~~~
./ext/server.xs:75:31: note: in expansion of macro ‘grpc_slice_or_string_to_sv’
   75 |     hv_stores(result,"method",grpc_slice_or_string_to_sv(details.method));
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:5705,
                 from Grpc.xs:3:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/proto.h:2458:63: note: expected ‘const char * const’ but argument is of type ‘grpc_slice’
 2458 | PERL_CALLCONV SV*       Perl_newSVpvn(pTHX_ const char *const buffer, const STRLEN len)
      |                                             ~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:5744,
                 from Grpc.xs:3:
./ext/server.xs:76:63: error: incompatible type for argument 1 of ‘strlen’
   76 |     hv_stores(result,"host",grpc_slice_or_string_to_sv(details.host));
      |                                                        ~~~~~~~^~~~~
      |                                                               |
      |                                                               grpc_slice
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/embed.h:244:78: note: in definition of macro ‘hv_common_key_len’
  244 | #define hv_common_key_len(a,b,c,d,e,f)  Perl_hv_common_key_len(aTHX_ a,b,c,d,e,f)
      |                                                                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:520:5: note: in expansion of macro ‘hv_store’
  520 |     hv_store((hv), ("" key ""), (sizeof(key)-1), (val), 0)
      |     ^~~~~~~~
./ext/server.xs:76:5: note: in expansion of macro ‘hv_stores’
   76 |     hv_stores(result,"host",grpc_slice_or_string_to_sv(details.host));
      |     ^~~~~~~~~
util.h:60:44: note: in expansion of macro ‘newSVpvn’
   60 | #define grpc_slice_or_string_to_sv(string) newSVpvn((string), strlen(string))
      |                                            ^~~~~~~~
./ext/server.xs:76:29: note: in expansion of macro ‘grpc_slice_or_string_to_sv’
   76 |     hv_stores(result,"host",grpc_slice_or_string_to_sv(details.host));
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:1342,
                 from Grpc.xs:3:
/usr/include/string.h:407:35: note: expected ‘const char *’ but argument is of type ‘grpc_slice’
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:5744,
                 from Grpc.xs:3:
./ext/server.xs:76:63: error: incompatible type for argument 2 of ‘Perl_newSVpvn’
   76 |     hv_stores(result,"host",grpc_slice_or_string_to_sv(details.host));
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/embed.h:244:78: note: in definition of macro ‘hv_common_key_len’
  244 | #define hv_common_key_len(a,b,c,d,e,f)  Perl_hv_common_key_len(aTHX_ a,b,c,d,e,f)
      |                                                                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:520:5: note: in expansion of macro ‘hv_store’
  520 |     hv_store((hv), ("" key ""), (sizeof(key)-1), (val), 0)
      |     ^~~~~~~~
./ext/server.xs:76:5: note: in expansion of macro ‘hv_stores’
   76 |     hv_stores(result,"host",grpc_slice_or_string_to_sv(details.host));
      |     ^~~~~~~~~
util.h:60:44: note: in expansion of macro ‘newSVpvn’
   60 | #define grpc_slice_or_string_to_sv(string) newSVpvn((string), strlen(string))
      |                                            ^~~~~~~~
./ext/server.xs:76:29: note: in expansion of macro ‘grpc_slice_or_string_to_sv’
   76 |     hv_stores(result,"host",grpc_slice_or_string_to_sv(details.host));
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:5705,
                 from Grpc.xs:3:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/proto.h:2458:63: note: expected ‘const char * const’ but argument is of type ‘grpc_slice’
 2458 | PERL_CALLCONV SV*       Perl_newSVpvn(pTHX_ const char *const buffer, const STRLEN len)
      |                                             ~~~~~~~~~~~~~~~~~~^~~~~~
make: *** [Makefile:361: Grpc.o] Error 1

elishaROBINSON avatar May 29 '24 19:05 elishaROBINSON