Unable to compile for Alpine 3.12 - SDK 3.0.4

running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
building in /tmp/pear/temp/pear-build-defaultuserMdgkEm/couchbase-3.0.4
running: /tmp/pear/temp/couchbase/configure --with-php-config=/usr/local/bin/php-config
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for a sed that does not truncate output… /bin/sed
checking for pkg-config… /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0… yes
checking for cc… cc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether cc accepts -g… yes
checking for cc option to accept ISO C89… none needed
checking how to run the C preprocessor… cc -E
checking for icc… no
checking for suncc… no
checking for system library directory… lib
checking if compiler supports -R… no
checking if compiler supports -Wl,-rpath,… yes
checking build system type… x86_64-pc-linux-musl
checking host system type… x86_64-pc-linux-musl
checking target system type… x86_64-pc-linux-musl
checking for PHP prefix… /usr/local
checking for PHP includes… -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory… /usr/local/lib/php/extensions/no-debug-non-zts-20190902
checking for PHP installed headers prefix… /usr/local/include/php
checking if debug is enabled… no
checking if zts is enabled… no
checking for gawk… no
checking for nawk… no
checking for awk… awk
checking if awk is broken… no
checking whether to enable Couchbase support… yes, shared
checking wheter to use system FastLZ library… no
checking for libcouchbase in default path and yes… found in /usr
checking for libcouchbase version >= 2.9.5… 0x021006
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking zlib.h usability… yes
checking zlib.h presence… yes
checking for zlib.h… yes
checking for compress in -lz… yes
checking for a sed that does not truncate output… /bin/sed
checking for ld used by cc… /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld… yes
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files… -r
checking for BSD-compatible nm… /usr/bin/nm -B
checking whether ln -s works… yes
checking how to recognize dependent libraries… pass_all
checking dlfcn.h usability… yes
checking dlfcn.h presence… yes
checking for dlfcn.h… yes
checking the maximum length of command line arguments… 98304
checking command to parse /usr/bin/nm -B output from cc object… ok
checking for objdir… .libs
checking for ar… ar
checking for ranlib… ranlib
checking for strip… strip
checking if cc supports -fno-rtti -fno-exceptions… no
checking for cc option to produce PIC… -fPIC
checking if cc PIC flag -fPIC works… yes
checking if cc static flag -static works… yes
checking if cc supports -c -o file.o… yes
checking whether the cc linker (/usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64) supports shared libraries… yes
checking whether -lc should be explicitly linked in… no
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… no

creating libtool
appending configuration tag “CXX” to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/temp/pear-build-defaultuserMdgkEm/couchbase-3.0.4/libtool --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/pear/temp/couchbase -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserMdgkEm/couchbase-3.0.4/include -I/tmp/pear/temp/pear-build-defaultuserMdgkEm/couchbase-3.0.4/main -I/tmp/pear/temp/couchbase -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/couchbase/couchbase.c -o couchbase.lo
mkdir .libs
cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/pear/temp/couchbase -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserMdgkEm/couchbase-3.0.4/include -I/tmp/pear/temp/pear-build-defaultuserMdgkEm/couchbase-3.0.4/main -I/tmp/pear/temp/couchbase -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/couchbase/couchbase.c -fPIC -DPIC -o .libs/couchbase.o
In file included from /tmp/pear/temp/couchbase/couchbase.h:40,
from /tmp/pear/temp/couchbase/couchbase.c:17:
/tmp/pear/temp/couchbase/log.h:24:5: error: unknown type name ‘lcb_LOGGER_CALLBACK’
24 | lcb_LOGGER_CALLBACK callback;
| ^~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/couchbase/log.h:29:29: error: unknown type name ‘lcb_INSTANCE’; did you mean ‘lcb_PINGSTATUS’?
29 | void pcbc_log(int severity, lcb_INSTANCE *instance, const char *subsys, const char *srcfile, int srcline, const char *fmt, …);
| ^~~~~~~~~~~~
| lcb_PINGSTATUS
In file included from /tmp/pear/temp/couchbase/couchbase.c:17:
/tmp/pear/temp/couchbase/couchbase.h:58:5: error: unknown type name ‘lcb_INSTANCE_TYPE’
58 | lcb_INSTANCE_TYPE type;
| ^~~~~~~~~~~~~~~~~
/tmp/pear/temp/couchbase/couchbase.h:62:5: error: unknown type name ‘lcb_INSTANCE’
62 | lcb_INSTANCE *lcb;
| ^~~~~~~~~~~~
/tmp/pear/temp/couchbase/couchbase.h:67:1: error: unknown type name ‘lcb_STATUS’; did you mean ‘lcb_PINGSTATUS’?
67 | lcb_STATUS pcbc_connection_get(pcbc_connection_t **result, lcb_INSTANCE_TYPE type, const char *connstr,
| ^~~~~~~~~~
| lcb_PINGSTATUS
/tmp/pear/temp/couchbase/couchbase.h:67:60: error: unknown type name ‘lcb_INSTANCE_TYPE’
67 | lcb_STATUS pcbc_connection_get(pcbc_connection_t **result, lcb_INSTANCE_TYPE type, const char *connstr,
| ^~~~~~~~~~~~~~~~~
/tmp/pear/temp/couchbase/couchbase.h:284:5: error: unknown type name ‘lcb_STATUS’
284 | lcb_STATUS err;
| ^~~~~~~~~~
/tmp/pear/temp/couchbase/couchbase.h:296:44: error: unknown type name ‘lcb_INSTANCE’; did you mean ‘lcb_PINGSTATUS’?
296 | void pcbc_http_request(zval *return_value, lcb_INSTANCE *conn, lcb_CMDHTTP *cmd, int json_response, void *cbctx,
| ^~~~~~~~~~~~
| lcb_PINGSTATUS
/tmp/pear/temp/couchbase/couchbase.h:331:5: error: unknown type name ‘lcb_STATUS’
331 | lcb_STATUS first_error;
| ^~~~~~~~~~
/tmp/pear/temp/couchbase/couchbase.h:341:1: error: unknown type name ‘lcb_STATUS’; did you mean ‘lcb_PINGSTATUS’?
341 | lcb_STATUS opcookie_get_first_error(opcookie *cookie);
| ^~~~~~~~~~
| lcb_PINGSTATUS
/tmp/pear/temp/couchbase/couchbase.c: In function ‘zm_startup_couchbase’:
/tmp/pear/temp/couchbase/couchbase.c:262:13: warning: implicit declaration of function ‘pcbc_log’ [-Wimplicit-function-declaration]
262 | pcbc_log(LOGARGS(FATAL),
| ^~~~~~~~
/tmp/pear/temp/couchbase/couchbase.c:368:9: warning: implicit declaration of function ‘LCB_XERROR’; did you mean ‘LCB_XERR’? [-Wimplicit-function-declaration]
368 | LCB_XERROR(X)
| ^~~~~~~~~~
| LCB_XERR
/tmp/pear/temp/couchbase/couchbase.c:368:20: error: ‘X’ undeclared (first use in this function)
368 | LCB_XERROR(X)
| ^
/tmp/pear/temp/couchbase/couchbase.c:368:20: note: each undeclared identifier is reported only once for each function it appears in
/tmp/pear/temp/couchbase/couchbase.c:368:22: error: expected ‘;’ before ‘}’ token
368 | LCB_XERROR(X)
| ^
| ;

371 | }
| ~
In file included from /usr/local/include/php/main/php.h:440,
from /tmp/pear/temp/couchbase/couchbase.h:25,
from /tmp/pear/temp/couchbase/couchbase.c:17:
/tmp/pear/temp/couchbase/couchbase.c:374:35: error: ‘LCB_ERR_TEMPORARY_FAILURE’ undeclared (first use in this function)
374 | PCBC_LONG_CONSTANT(“TMPFAIL”, LCB_ERR_TEMPORARY_FAILURE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/php/Zend/zend_constants.h:53:105: note: in definition of macro ‘REGISTER_LONG_CONSTANT’
53 | #define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)
| ^~~~
/tmp/pear/temp/couchbase/couchbase.c:374:5: note: in expansion of macro ‘PCBC_LONG_CONSTANT’
374 | PCBC_LONG_CONSTANT(“TMPFAIL”, LCB_ERR_TEMPORARY_FAILURE);
| ^~~~~~~~~~~~~~~~~~
/tmp/pear/temp/couchbase/couchbase.c:375:44: error: ‘LCB_ERR_DOCUMENT_EXISTS’ undeclared (first use in this function)
375 | PCBC_LONG_CONSTANT(“KEYALREADYEXISTS”, LCB_ERR_DOCUMENT_EXISTS);
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/php/Zend/zend_constants.h:53:105: note: in definition of macro ‘REGISTER_LONG_CONSTANT’
53 | #define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)
| ^~~~
/tmp/pear/temp/couchbase/couchbase.c:375:5: note: in expansion of macro ‘PCBC_LONG_CONSTANT’
375 | PCBC_LONG_CONSTANT(“KEYALREADYEXISTS”, LCB_ERR_DOCUMENT_EXISTS);
| ^~~~~~~~~~~~~~~~~~
/tmp/pear/temp/couchbase/couchbase.c:376:39: error: ‘LCB_ERR_DOCUMENT_NOT_FOUND’ undeclared (first use in this function)
376 | PCBC_LONG_CONSTANT(“KEYNOTFOUND”, LCB_ERR_DOCUMENT_NOT_FOUND);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/php/Zend/zend_constants.h:53:105: note: in definition of macro ‘REGISTER_LONG_CONSTANT’
53 | #define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)
| ^~~~
/tmp/pear/temp/couchbase/couchbase.c:376:5: note: in expansion of macro ‘PCBC_LONG_CONSTANT’
376 | PCBC_LONG_CONSTANT(“KEYNOTFOUND”, LCB_ERR_DOCUMENT_NOT_FOUND);
| ^~~~~~~~~~~~~~~~~~
/tmp/pear/temp/couchbase/couchbase.c: In function ‘zm_info_couchbase’:
/tmp/pear/temp/couchbase/couchbase.c:1016:5: error: unknown type name ‘lcb_STATUS’; did you mean ‘lcb_PINGSTATUS’?
1016 | lcb_STATUS err;
| ^~~~~~~~~~
| lcb_PINGSTATUS

Hello @LucasH currently Alpine OS is not supported, you can see the compatibility matrix here

@LucasH it looks like you don’t have current libcouchbase installed. Current version is 3.0.6

You can find more info here: https://docs.couchbase.com/c-sdk/current/project-docs/sdk-release-notes.html

Yeah I figured when I realized in fact we still were on the vers 2.6.2 all this time as the PECL package for 3.0.X was not marked as stable before Wednesday.

Any plan to support Alpine officially? There is already a working package available on the official repo: https://pkgs.alpinelinux.org/packages?name=libcouchbase*&branch=edge&maintainer=Nathan+Johnson
Is Nathan Johnson someone from Couchbase?
Any chance you could the new version to the official repo?