uperl / Alien-Librdkafka

alien wrapper to build and access librdkafka from perl
2 stars 2 forks source link

v1.1.0 - rebased #7

Closed GeorgeShagov closed 5 years ago

GeorgeShagov commented 5 years ago

v1.1.0

plicease commented 5 years ago

Looks like there is a change in librdkafak 1.1.0 which forces the use of static libs:

https://travis-ci.org/plicease/Alien-Librdkafka/jobs/560946657#L445

which causes a fail in the link step:

https://travis-ci.org/plicease/Alien-Librdkafka/jobs/560946657#L532

because at least one of the system libraries it is trying to link against is not compiled with -fPIC.

plicease commented 5 years ago

I think if you remove --enable-static from alien_build_commands it will work. The normal meaning of --enable-static is to build a static lib, not to link against static libs, but it looks like it builds a .a file without --enable-static.

GeorgeShagov commented 5 years ago

I understand, let me build locally, then I will get back

GeorgeShagov commented 5 years ago

It looks odd to me.

I have cloned my local repo with changed Build.PL:

alien_repository => { protocol => 'https', exact_filename => 'https://github.com/edenhill/librdkafka/archive/v1.1.0.tar.gz', exact_version => 'v1.1.0', }, I run:

perl ./Build.PL

and then:

./Build

And this worked fine:

install librdkafka++.so.1 $DESTDIR/home/george/prjs/george-alien-librdkafka-master/blib/lib/auto/share/dist/Alien-Librdkafka/lib && \
[ -f "rdkafka++.pc" ] && ( \
        install -d $DESTDIR/home/george/prjs/george-alien-librdkafka-master/blib/lib/auto/share/dist/Alien-Librdkafka/lib/pkgconfig && \
        install -m 0644 rdkafka++.pc $DESTDIR/home/george/prjs/george-alien-librdkafka-master/blib/lib/auto/share/dist/Alien-Librdkafka/lib/pkgconfig \
) && \
[ -f "rdkafka++-static.pc" ] && ( \
        install -d $DESTDIR/home/george/prjs/george-alien-librdkafka-master/blib/lib/auto/share/dist/Alien-Librdkafka/lib/pkgconfig && \
        install -m 0644 rdkafka++-static.pc $DESTDIR/home/george/prjs/george-alien-librdkafka-master/blib/lib/auto/share/dist/Alien-Librdkafka/lib/pkgconfig \
) && \
(cd $DESTDIR/home/george/prjs/george-alien-librdkafka-master/blib/lib/auto/share/dist/Alien-Librdkafka/lib && ln -sf librdkafka++.so.1 librdkafka++.so)
make[1]: Leaving directory '/home/george/prjs/george-alien-librdkafka-master/_alien/librdkafka-1.1.0/src-cpp'
Done
Isolating dynamic libraries ... Done

I checked the version of librdKafka, looks ok:

/**
 * @brief librdkafka version
 *
 * Interpreted as hex \c MM.mm.rr.xx:
 *  - MM = Major
 *  - mm = minor
 *  - rr = revision
 *  - xx = pre-release id (0xff is the final release)
 *
 * E.g.: \c 0x000801ff = 0.8.1
 *
 * @remark This value should only be used during compile time,
 *         for runtime checks of version use rd_kafka_version()
 */
#define RD_KAFKA_VERSION  0x010100ff

It works fine from forked repo

plicease commented 5 years ago

8 should address this