Skip to content

Doesn't compile on Debian Sid (unstable) and Ubuntu 24.10 #252

@waterkip

Description

@waterkip

I'm having trouble compiling Net::AMQP::RabbitMQ on Debian unstable with perl 5.38.2 (which is shipped by default with Debian).
It does install with Debian Bookworm (the current stable release).

# Save the following in a file and
ARG IMG=sid

FROM debian:${IMG}

RUN <<OEF
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get install --no-install-recommends -y libterm-readline-gnu-perl
apt-get install --no-install-recommends -y build-essential perl cpanminus
apt-get install --no-install-recommends -y libssl-dev
OEF

RUN cpanm -n Net::AMQP::RabbitMQ || ( cat /root/.cpanm/work/*/build.log && exit 1 )

If you execute docker build -f Dockerfile . you will see the following errors:

#6 3.957 mv RabbitMQ.xsc RabbitMQ.c
#6 3.957 x86_64-linux-gnu-gcc -c  -I. -Irabbitmq-include -Irabbitmq-c/include -Irabbitmq-include/unix -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"2.40012\" -DXS_VERSION=\"2.40012\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.38/CORE"  -DHAVE_SOCKET -DHAVE_POLL -DAMQ_PLATFORM='"Perl_linux_v5.38.2"' -DNAR_HAVE_OPENSSL RabbitMQ.c
#6 3.957 In file included from /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/perl.h:6227,
#6 3.957                  from RabbitMQ.xs:2:
#6 3.957 RabbitMQ.xs: In function 'XS_Net__AMQP__RabbitMQ_get_rpc_timeout':
#6 3.957 RabbitMQ.xs:1962:29: error: passing argument 2 of 'Perl_newRV_noinc' from incompatible pointertype [-Wincompatible-pointer-types]
#6 3.957  1962 |       RETVAL = newRV_noinc( output );
#6 3.957       |                             ^~~~~~
#6 3.957       |                             |
#6 3.957       |                             HV * {aka struct hv *}
#6 3.957 /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/embed.h:422:72: note: in definition of macro 'newRV_noinc'
#6 3.957   422 | # define newRV_noinc(a)                         Perl_newRV_noinc(aTHX_ a)
#6 3.957       |                                                                        ^
#6 3.957 In file included from /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/perl.h:7812:
#6 3.957 /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/sv_inline.h:970:34: note: expected 'SV *' {aka 'struct sv *'} but argument is of type 'HV *' {aka 'struct hv *'}
#6 3.957   970 | Perl_newRV_noinc(pTHX_ SV *const tmpRef)
#6 3.957       |                        ~~~~~~~~~~^~~~~~
#6 3.957 RabbitMQ.xs: In function 'XS_Net__AMQP__RabbitMQ__set_rpc_timeout':
#6 3.957 /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/sv.h:1438:33: error: passing argument 2 of 'Perl_hv_common_key_len' from incompatible pointer type [-Wincompatible-pointer-types]
#6 3.957  1438 | #    define SvRV(sv) ((sv)->sv_u.svu_rv)
#6 3.957 /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/embed.h:293:78: note: in definition of macro 'hv_common_key_len'
#6 3.957   293 | # define hv_common_key_len(a,b,c,d,e,f)         Perl_hv_common_key_len(aTHX_ a,b,c,d,e,f)
#6 3.957       |                                                                              ^
#6 3.957 /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/hv.h:556:5: note: in expansion of macro 'hv_fetch'
#6 3.957   556 |     hv_fetch((hv), ASSERT_IS_LITERAL(key), (sizeof(key)-1), (lval))
#6 3.957       |     ^~~~~~~~
#6 3.957 RabbitMQ.xs:98:31: note: in expansion of macro 'hv_fetchs'
#6 3.957    98 |  do { SV **v; if(NULL != (v = hv_fetchs(hv, #name, 0))) name = SvIV(*v); } while(0)
#6 3.957       |                               ^~~~~~~~~
#6 3.957 RabbitMQ.xs:1991:7: note: in expansion of macro 'int_from_hv'
#6 3.957  1991 |       int_from_hv(SvRV(args), tv_sec);
#6 3.957       |       ^~~~~~~~~~~
#6 3.957 RabbitMQ.xs:1991:19: note: in expansion of macro 'SvRV'
#6 3.957  1991 |       int_from_hv(SvRV(args), tv_sec);
#6 3.957       |                   ^~~~
#6 3.957 In file included from /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/perl.h:6188:
#6 3.957 /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/proto.h:1574:34: note: expected 'HV *' {aka 'struct hv *'} but argument is of type 'SV *' {aka 'struct sv *'}
#6 3.957  1574 | Perl_hv_common_key_len(pTHX_ HV *hv, const char *key, I32 klen_i32, const int action, SV *val, const U32 hash);
#6 3.957       |                              ~~~~^~
#6 3.957 /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/sv.h:1438:33: error: passing argument 2 of 'Perl_hv_common_key_len' from incompatible pointer type [-Wincompatible-pointer-types]
#6 3.957  1438 | #    define SvRV(sv) ((sv)->sv_u.svu_rv)
#6 3.957 /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/embed.h:293:78: note: in definition of macro 'hv_common_key_len'
#6 3.957   293 | # define hv_common_key_len(a,b,c,d,e,f)         Perl_hv_common_key_len(aTHX_ a,b,c,d,e,f)
#6 3.957       |                                                                              ^
#6 3.957 /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/hv.h:556:5: note: in expansion of macro 'hv_fetch'
#6 3.957   556 |     hv_fetch((hv), ASSERT_IS_LITERAL(key), (sizeof(key)-1), (lval))
#6 3.957       |     ^~~~~~~~
#6 3.957 RabbitMQ.xs:98:31: note: in expansion of macro 'hv_fetchs'
#6 3.957    98 |  do { SV **v; if(NULL != (v = hv_fetchs(hv, #name, 0))) name = SvIV(*v); } while(0)
#6 3.957       |                               ^~~~~~~~~
#6 3.957 RabbitMQ.xs:1992:7: note: in expansion of macro 'int_from_hv'
#6 3.957  1992 |       int_from_hv(SvRV(args), tv_usec);
#6 3.957       |       ^~~~~~~~~~~
#6 3.957 RabbitMQ.xs:1992:19: note: in expansion of macro 'SvRV'
#6 3.957  1992 |       int_from_hv(SvRV(args), tv_usec);
#6 3.957       |                   ^~~~
#6 3.957 /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/proto.h:1574:34: note: expected 'HV *' {aka 'struct hv *'} but argument is of type 'SV *' {aka 'struct sv *'}
#6 3.957  1574 | Perl_hv_common_key_len(pTHX_ HV *hv, const char *key, I32 klen_i32, const int action, SV *val, const U32 hash);
#6 3.957       |                              ~~~~^~
#6 3.957 make: *** [Makefile:374: RabbitMQ.o] Error 1
#6 3.957 -> FAIL Installing Net::AMQP::RabbitMQ failed. See /root/.cpanm/work/1727116399.7/build.log for details. Retry with --force to force install it.
#6 3.957 1 distribution installed
#6 ERROR: process "/bin/sh -c cpanm -n Net::AMQP::RabbitMQ || ( cat /root/.cpanm/work/*/build.log && exit 1 )" did not complete successfully: exit code: 1
------
 > [3/3] RUN cpanm -n Net::AMQP::RabbitMQ || ( cat /root/.cpanm/work/*/build.log && exit 1 ):
3.957       |       ^~~~~~~~~~~
3.957 RabbitMQ.xs:1992:19: note: in expansion of macro 'SvRV'
3.957  1992 |       int_from_hv(SvRV(args), tv_usec);
3.957       |                   ^~~~
3.957 /usr/lib/x86_64-linux-gnu/perl/5.38/CORE/proto.h:1574:34: note: expected 'HV *' {aka 'struct hv *'} but argument is of type 'SV *' {aka 'struct sv *'}
3.957  1574 | Perl_hv_common_key_len(pTHX_ HV *hv, const char *key, I32 klen_i32, const int action, SV *val, const U32 hash);
3.957       |                              ~~~~^~
3.957 make: *** [Makefile:374: RabbitMQ.o] Error 1
3.957 -> FAIL Installing Net::AMQP::RabbitMQ failed. See /root/.cpanm/work/1727116399.7/build.log for details. Retry with --force to force install it.

When you supply the build-arg and select debian latest:
docker build -f p5.dockerfile . --build-arg IMG=latest

Everything is installed as expected.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions