Invalid libtool archive when trying to build memcached PHP extension


We’re trying to build the memcached PHP extension, which we need…

Using pecl bundle,we can get the source code, and then run phpize and ./configure with:

# ./configure --with-zlib-dir=/hab/pkgs/core/zlib/1.2.11/20180608050617/ --with-libmemcached-dir=/hab/pkgs/jw/libmemcached/1.0.18/20170228222731 --disable-memcached-sasl

However, when we run make we see the following:

[75][default:/src/memcached:0]# make
/bin/sh /src/memcached/libtool --mode=link cc -DPHP_ATOM_INC -I/src/memcached/include -I/src/memcached/main -I/src/memcached -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php/main -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php/TSRM -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php/Zend -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php/ext -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php/ext/date/lib -I/hab/pkgs/core/zlib/1.2.11/20180608050617//include -I/hab/pkgs/jw/libmemcached/1.0.18/20170228222731/include  -DHAVE_CONFIG_H  -g -O2 -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php/main -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php/TSRM -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php/Zend -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php/ext -I/hab/pkgs/core/php/7.1.4/20180717232729/include/php/ext/date/lib -I/hab/pkgs/core/zlib/1.2.11/20180608050617//include -I/hab/pkgs/jw/libmemcached/1.0.18/20170228222731/include   -o -export-dynamic -avoid-version -prefer-pic -module -rpath /src/memcached/modules  php_memcached.lo php_libmemcached_compat.lo g_fmt.lo fastlz/fastlz.lo php_memcached_session.lo -Wl,-rpath,/hab/pkgs/jw/libmemcached/1.0.18/20170228222731/lib -L/hab/pkgs/jw/libmemcached/1.0.18/20170228222731/lib -Wl,-rpath,/hab/pkgs/core/zlib/1.2.11/20180608050617//lib -L/hab/pkgs/core/zlib/1.2.11/20180608050617//lib -lz -lmemcached -lmemcachedutil
grep: /hab/pkgs/core/gcc/5.2.0/20161208212815/lib/../lib/ No such file or directory
/hab/pkgs/core/sed/4.2.2/20170513213123/bin/sed: can't read /hab/pkgs/core/gcc/5.2.0/20161208212815/lib/../lib/ No such file or directory
libtool: link: `/hab/pkgs/core/gcc/5.2.0/20161208212815/lib/../lib/' is not a valid libtool archive
make: *** [Makefile:207:] Error 1

Has anyone seen anything like this before, or can give us some pointers for further troubleshooting?


I’m mobile, but that version of gcc looks old. Do you have a deep pinned to something before the rebuild of the world?


I agree with @elliott-davis… it looks like there’s an old version sneaking in.

One thing you might try is enabling a toggle for a new feature we’re working on.

When you run your build, set HAB_FEAT_IGNORE_LOCAL=true inside the Studio. Due to, if you’re doing something like hab pkg build <my-package> you’ll need to set HAB_STUDIO_SECRET_HAB_FEAT_IGNORE_LOCAL=true to allow it into the Studio.

This was introduced recently in, but we haven’t widely publicized it yet, as we’re still sorting out what the final UX should be.



This may be a red-herring. In the context of a plan, this builds ok.

We were poking about in the studio, on the command line, trying to work out how pecl operates, and how to integrate it with Hab paths. We make have missed a dependency, or some thing.

We’ve been able to build our extensions now… for reference, a handy formula is:

pecl bundle something
cd something
./configure --with-some-hab-libs

This can be marked as solved.