New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling from source on mac fails #85

Open
dseguy opened this Issue Dec 5, 2018 · 18 comments

Comments

Projects
None yet
3 participants
@dseguy

dseguy commented Dec 5, 2018

Following the README steps, I end up with this :

set -e; \
	DIR=$(readlink -f ./thirdparty); \
	if [[ -f "$DIR/lib/libuv.a" ]]; then exit 0; fi; \
	TMP=$(mktemp -d); \
	cp -r ./thirdparty/libuv $TMP/; \
	pushd $TMP/libuv; \
	./autogen.sh; \
	./configure --prefix=$TMP/build CFLAGS="$(CFLAGS) -fPIC -DPIC -g -O2"; \
	make install; \
	popd; \
	cp $TMP/build/lib/libuv.a $DIR/lib/; \
	rm -rf $TMP;
readlink: illegal option -- f
usage: readlink [-n] [file ...]
make: *** [thirdparty/lib/libuv.a] Error 1

autoconf works fine (ends with no error).
Also, there is no 'make' (may be normal, but suprising).

@martinschroeder martinschroeder added the bug label Dec 5, 2018

@martinschroeder

This comment has been minimized.

Member

martinschroeder commented Dec 5, 2018

Does it work if you replace readlink with greadlink? You may need to install it using Homebrew (brew install coreutils). You need to change this in the file Makefile.frag (line 12).

@martinschroeder

This comment has been minimized.

Member

martinschroeder commented Dec 5, 2018

The use of readlink could also be avoided if you replace the rule to build libuv.a in Makefile.frag with this one:

thirdparty/lib/libuv.a:
	set -e; \
	DIR="$$(pwd -P)/thirdparty"; \
	if [[ -f "$$DIR/lib/libuv.a" ]]; then exit 0; fi; \
	TMP=$$(mktemp -d); \
	cp -r $$DIR/libuv $$TMP/; \
	pushd $$TMP/libuv; \
	./autogen.sh; \
	./configure --prefix=$$TMP/build CFLAGS="$$(CFLAGS) -fPIC -DPIC -g -O2"; \
	make install; \
	popd; \
	cp $$TMP/build/lib/libuv.a $$DIR/lib/; \
	rm -rf $$TMP;

If this does the trick i will commit the changed build rule. I already verified that it works on linux.

@dseguy

This comment has been minimized.

dseguy commented Dec 5, 2018

Both changes do fix this bug : the make starts, and works hard : thanks for that!

Sadly, it get stuck later in the process, though. Here is the log for 'make'.

make
set -e; \
   DIR="$(pwd -P)/thirdparty"; \
   if [[ -f "$DIR/lib/libuv.a" ]]; then exit 0; fi; \
   TMP=$(mktemp -d); \
   cp -r $DIR/libuv $TMP/; \
   pushd $TMP/libuv; \
   ./autogen.sh; \
   ./configure --prefix=$TMP/build CFLAGS="$(CFLAGS) -fPIC -DPIC -g -O2"; \
   make install; \
   popd; \
   cp $TMP/build/lib/libuv.a $DIR/lib/; \
   rm -rf $TMP;
/var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/libuv /tmp/php-async
+ glibtoolize --copy
glibtoolize: putting auxiliary files in '.'.
glibtoolize: copying file './ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
+ aclocal -I m4
+ autoconf
+ automake --add-missing --copy
configure.ac:38: installing './ar-lib'
configure.ac:25: installing './compile'
configure.ac:22: installing './config.guess'
configure.ac:22: installing './config.sub'
configure.ac:21: installing './install-sh'
configure.ac:21: installing './missing'
Makefile.am: installing './depcomp'
/bin/sh: CFLAGS: command not found
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-apple-darwin18.2.0
checking host system type... x86_64-apple-darwin18.2.0
checking for gcc... gcc
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 gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... rm: conftest.dSYM: is a directory
yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking if gcc supports -pedantic flag... yes
checking for gcc way to treat warnings as errors... -Werror
checking if gcc supports -fvisibility=hidden... yes
checking if gcc supports -g flag... yes
checking if gcc supports -std=gnu89 flag... yes
checking if gcc supports -Wall flag... yes
checking if gcc supports -Wextra flag... yes
checking if gcc supports -Wno-unused-parameter flag... yes
checking if gcc supports -Wstrict-prototypes flag... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/local/bin/nm -B
checking the name lister (/usr/local/bin/nm -B) interface... rm: conftest.dSYM: is a directory
BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin18.2.0 file names to x86_64-apple-darwin18.2.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin18.2.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... rm: conftest.dSYM: is a directory
@
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/local/bin/nm -B output from gcc object... rm: conftest.dSYM: is a directory
ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... no
checking how to run the C preprocessor... gcc -E
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 for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin18.2.0 dyld
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... yes
checking whether make supports nested variables... (cached) yes
checking for dlopen in -ldl... yes
checking for kstat_lookup in -lkstat... no
checking for gethostbyname in -lnsl... no
checking for perfstat_cpu in -lperfstat... no
checking for pthread_mutex_init in -lpthread... yes
checking for clock_gettime in -lrt... no
checking for sendfile in -lsendfile... no
checking for socket in -lsocket... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking sys/ahafs_evProds.h usability... no
checking sys/ahafs_evProds.h presence... no
checking for sys/ahafs_evProds.h... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libuv.pc
config.status: executing depfiles commands
config.status: executing libtool commands
 CC       src/libuv_la-fs-poll.lo
 CC       src/libuv_la-inet.lo
 CC       src/libuv_la-threadpool.lo
 CC       src/libuv_la-timer.lo
 CC       src/libuv_la-uv-data-getter-setters.lo
 CC       src/libuv_la-uv-common.lo
 CC       src/libuv_la-version.lo
 CC       src/unix/libuv_la-async.lo
 CC       src/unix/libuv_la-core.lo
 CC       src/unix/libuv_la-dl.lo
 CC       src/unix/libuv_la-fs.lo
 CC       src/unix/libuv_la-getaddrinfo.lo
 CC       src/unix/libuv_la-getnameinfo.lo
 CC       src/unix/libuv_la-loop-watcher.lo
 CC       src/unix/libuv_la-loop.lo
 CC       src/unix/libuv_la-pipe.lo
 CC       src/unix/libuv_la-poll.lo
 CC       src/unix/libuv_la-process.lo
 CC       src/unix/libuv_la-signal.lo
 CC       src/unix/libuv_la-stream.lo
 CC       src/unix/libuv_la-tcp.lo
 CC       src/unix/libuv_la-thread.lo
 CC       src/unix/libuv_la-tty.lo
 CC       src/unix/libuv_la-udp.lo
 CC       src/unix/libuv_la-bsd-ifaddrs.lo
 CC       src/unix/libuv_la-darwin.lo
 CC       src/unix/libuv_la-darwin-proctitle.lo
 CC       src/unix/libuv_la-fsevents.lo
 CC       src/unix/libuv_la-kqueue.lo
 CC       src/unix/libuv_la-proctitle.lo
 CCLD     libuv.la
ar: `u' modifier ignored since `D' is the default (see `U')
/usr/local/bin/gmkdir -p '/var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/lib'
/bin/sh ./libtool   --mode=install /usr/local/bin/ginstall -c   libuv.la '/var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/lib'
libtool: install: /usr/local/bin/ginstall -c .libs/libuv.1.dylib /var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/lib/libuv.1.dylib
libtool: install: (cd /var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/lib && { ln -s -f libuv.1.dylib libuv.dylib || { rm -f libuv.dylib && ln -s libuv.1.dylib libuv.dylib; }; })
libtool: install: /usr/local/bin/ginstall -c .libs/libuv.lai /var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/lib/libuv.la
libtool: install: /usr/local/bin/ginstall -c .libs/libuv.a /var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/lib/libuv.a
libtool: install: chmod 644 /var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/lib/libuv.a
libtool: install: ranlib /var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/lib/libuv.a
/usr/local/bin/gmkdir -p '/var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/include'
/usr/local/bin/ginstall -c -m 644 include/uv.h '/var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/include'
/usr/local/bin/gmkdir -p '/var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/lib/pkgconfig'
/usr/local/bin/ginstall -c -m 644 libuv.pc '/var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/lib/pkgconfig'
/usr/local/bin/gmkdir -p '/var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/include/uv'
/usr/local/bin/ginstall -c -m 644 include/uv/errno.h include/uv/threadpool.h include/uv/version.h include/uv/unix.h include/uv/darwin.h '/var/folders/3j/pf24y7cx7j71yg0h59t16xqr0000gn/T/tmp.m96KHaYZ/build/include/uv'
/tmp/php-async
/bin/sh /tmp/php-async/libtool --mode=compile cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-async/php_async.c -o php_async.lo 
mkdir .libs
cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include -DHAVE_CONFIG_H -g -O2 -c /tmp/php-async/php_async.c  -fno-common -DPIC -o .libs/php_async.o
/bin/sh /tmp/php-async/libtool --mode=compile cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-async/src/awaitable.c -o src/awaitable.lo 
mkdir src/.libs
cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include -DHAVE_CONFIG_H -g -O2 -c /tmp/php-async/src/awaitable.c  -fno-common -DPIC -o src/.libs/awaitable.o
/tmp/php-async/src/awaitable.c:37:2: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
       ASYNC_ADDREF(&q->scheduler->std);
       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/awaitable.c:59:2: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
       ASYNC_ADDREF(&q->scheduler->std);
       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
2 warnings generated.
/bin/sh /tmp/php-async/libtool --mode=compile cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-async/src/context.c -o src/context.lo 
cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include -DHAVE_CONFIG_H -g -O2 -c /tmp/php-async/src/context.c  -fno-common -DPIC -o src/.libs/context.o
/tmp/php-async/src/context.c:88:2: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
       ASYNC_ADDREF(&prev->std);
       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/context.c:89:2: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
       ASYNC_ADDREF(&handler->std);
       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/context.c:152:3: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
               ASYNC_ADDREF(&var->std);
               ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/context.c:189:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/context.c:219:3: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
               ASYNC_ADDREF(&current->std);
               ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/context.c:269:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/context.c:277:2: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
       ASYNC_ADDREF(&prev->std);
       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/context.c:290:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/context.c:346:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/context.c:357:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/context.c:371:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/context.c:379:2: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
       ASYNC_ADDREF(&current->std);
       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/context.c:456:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/context.c:529:4: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
                       ASYNC_ADDREF(&handler->std);
                       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/context.c:593:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/context.c:633:3: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
               GC_ADDREF(Z_OBJ_P(err));
               ^
/tmp/php-async/src/context.c:674:2: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
       ASYNC_ADDREF(&context->std);
       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/context.c:692:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/context.c:701:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/context.c:712:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
20 warnings generated.
/bin/sh /tmp/php-async/libtool --mode=compile cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-async/src/deferred.c -o src/deferred.lo 
cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include -DHAVE_CONFIG_H -g -O2 -c /tmp/php-async/src/deferred.c  -fno-common -DPIC -o src/.libs/deferred.o
/tmp/php-async/src/deferred.c:60:2: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
       ASYNC_ADDREF(&defer->std);
       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/deferred.c:123:2: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
       ASYNC_ADDREF(&combined->defer->std);
       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/deferred.c:255:2: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
       ASYNC_ADDREF(&defer->std);
       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/deferred.c:273:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/deferred.c:284:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/deferred.c:329:2: warning: implicit declaration of function 'GC_ADDREF' is invalid in C99 [-Wimplicit-function-declaration]
       ASYNC_ADDREF(&defer->context->std);
       ^
./php_async.h:1110:2: note: expanded from macro 'ASYNC_ADDREF'
       GC_ADDREF(obj); \
       ^
/tmp/php-async/src/deferred.c:386:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/deferred.c:406:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
8 warnings generated.
/bin/sh /tmp/php-async/libtool --mode=compile cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-async/src/dns.c -o src/dns.lo 
cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include -DHAVE_CONFIG_H -g -O2 -c /tmp/php-async/src/dns.c  -fno-common -DPIC -o src/.libs/dns.o
/bin/sh /tmp/php-async/libtool --mode=compile cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-async/src/fiber.c -o src/fiber.lo 
cc -Wall -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/php-async -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/Cellar/php/7.2.12_2/include/php -I/usr/local/Cellar/php/7.2.12_2/include/php/main -I/usr/local/Cellar/php/7.2.12_2/include/php/TSRM -I/usr/local/Cellar/php/7.2.12_2/include/php/Zend -I/usr/local/Cellar/php/7.2.12_2/include/php/ext -I/usr/local/Cellar/php/7.2.12_2/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include -DHAVE_CONFIG_H -g -O2 -c /tmp/php-async/src/fiber.c  -fno-common -DPIC -o src/.libs/fiber.o
/tmp/php-async/src/fiber.c:81:2: error: no member named 'vm_stack_page_size' in 'struct _zend_executor_globals'
       ASYNC_FIBER_BACKUP_EG(stack, stack_page_size, exec);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php_async.h:1006:23: note: expanded from macro 'ASYNC_FIBER_BACKUP_EG'
       stack_page_size = EG(vm_stack_page_size); \
                         ~~~^~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/php/7.2.12_2/include/php/Zend/zend_globals_macros.h:46:34: note: expanded from macro 'EG'
# define EG(v) (executor_globals.v)
               ~~~~~~~~~~~~~~~~ ^
/tmp/php-async/src/fiber.c:83:2: error: no member named 'vm_stack_page_size' in 'struct _zend_executor_globals'
       ASYNC_FIBER_RESTORE_EG(stack, stack_page_size, exec);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php_async.h:1014:5: note: expanded from macro 'ASYNC_FIBER_RESTORE_EG'
       EG(vm_stack_page_size) = stack_page_size; \
       ~~~^~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/php/7.2.12_2/include/php/Zend/zend_globals_macros.h:46:34: note: expanded from macro 'EG'
# define EG(v) (executor_globals.v)
               ~~~~~~~~~~~~~~~~ ^
/tmp/php-async/src/fiber.c:101:5: error: no member named 'vm_stack_page_size' in 'struct _zend_executor_globals'
       EG(vm_stack_page_size) = ASYNC_FIBER_VM_STACK_SIZE;
       ~~~^~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/php/7.2.12_2/include/php/Zend/zend_globals_macros.h:46:34: note: expanded from macro 'EG'
# define EG(v) (executor_globals.v)
               ~~~~~~~~~~~~~~~~ ^
/tmp/php-async/src/fiber.c:238:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/fiber.c:252:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/fiber.c:372:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/fiber.c:383:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
/tmp/php-async/src/fiber.c:420:2: error: no member named 'vm_stack_page_size' in 'struct _zend_executor_globals'
       ASYNC_FIBER_BACKUP_EG(fiber->stack, stack_page_size, fiber->exec);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php_async.h:1006:23: note: expanded from macro 'ASYNC_FIBER_BACKUP_EG'
       stack_page_size = EG(vm_stack_page_size); \
                         ~~~^~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/php/7.2.12_2/include/php/Zend/zend_globals_macros.h:46:34: note: expanded from macro 'EG'
# define EG(v) (executor_globals.v)
               ~~~~~~~~~~~~~~~~ ^
/tmp/php-async/src/fiber.c:422:2: error: no member named 'vm_stack_page_size' in 'struct _zend_executor_globals'
       ASYNC_FIBER_RESTORE_EG(fiber->stack, stack_page_size, fiber->exec);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php_async.h:1014:5: note: expanded from macro 'ASYNC_FIBER_RESTORE_EG'
       EG(vm_stack_page_size) = stack_page_size; \
       ~~~^~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/php/7.2.12_2/include/php/Zend/zend_globals_macros.h:46:34: note: expanded from macro 'EG'
# define EG(v) (executor_globals.v)
               ~~~~~~~~~~~~~~~~ ^
/tmp/php-async/src/fiber.c:442:2: warning: implicit declaration of function 'ZEND_PARSE_PARAMETERS_NONE' is invalid in C99
     [-Wimplicit-function-declaration]
       ZEND_PARSE_PARAMETERS_NONE();
       ^
5 warnings and 5 errors generated.
make: *** [src/fiber.lo] Error 1

@joelwurtz

This comment has been minimized.

Contributor

joelwurtz commented Dec 5, 2018

I think you are on the wrong PHP version, this extension only works for php 7.3+ (prefer last RC)

@dseguy

This comment has been minimized.

dseguy commented Dec 5, 2018

a, right... phpized with php73, but the make relies on php (aka 7.2 here).
Let me see that again.

@dseguy

This comment has been minimized.

dseguy commented Dec 5, 2018

I switched php-config with a 7.3RC6, freshly updated.

I now get a linking problem related to architecture.

/bin/sh /tmp/php-async/libtool --mode=link cc -DPHP_ATOM_INC -I/tmp/php-async/include -I/tmp/php-async/main -I/tmp/php-async -I/usr/local/opt/php73/include/php -I/usr/local/opt/php73/include/php/main -I/usr/local/opt/php73/include/php/TSRM -I/usr/local/opt/php73/include/php/Zend -I/usr/local/opt/php73/include/php/ext -I/usr/local/opt/php73/include/php/ext/date/lib -I/tmp/php-async/thirdparty/libuv/include  -DHAVE_CONFIG_H  -g -O2  -lpthread -o async.la -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/php-async/modules  ./thirdparty/lib/libuv.a php_async.lo src/awaitable.lo src/context.lo src/deferred.lo src/dns.lo src/fiber.lo src/fiber_stack.lo src/helper.lo src/process.lo src/signal_watcher.lo src/socket.lo src/ssl.lo src/stream.lo src/stream_watcher.lo src/task.lo src/task_scheduler.lo src/tcp.lo src/timer.lo src/udp.lo src/fiber_asm.lo thirdparty/boost/asm/make_x86_64_sysv_macho_gas.lo thirdparty/boost/asm/jump_x86_64_sysv_macho_gas.lo 

*** Warning: Linking the shared library async.la against the
*** static library ./thirdparty/lib/libuv.a is not portable!
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/async.so -bundle  .libs/php_async.o src/.libs/awaitable.o src/.libs/context.o src/.libs/deferred.o src/.libs/dns.o src/.libs/fiber.o src/.libs/fiber_stack.o src/.libs/helper.o src/.libs/process.o src/.libs/signal_watcher.o src/.libs/socket.o src/.libs/ssl.o src/.libs/stream.o src/.libs/stream_watcher.o src/.libs/task.o src/.libs/task_scheduler.o src/.libs/tcp.o src/.libs/timer.o src/.libs/udp.o src/.libs/fiber_asm.o thirdparty/boost/asm/.libs/make_x86_64_sysv_macho_gas.o thirdparty/boost/asm/.libs/jump_x86_64_sysv_macho_gas.o  -lpthread ./thirdparty/lib/libuv.a 
ld: warning: ignoring file ./thirdparty/lib/libuv.a, file was built for archive which is not the architecture being linked (x86_64): ./thirdparty/lib/libuv.a
duplicate symbol _async_globals in:
    .libs/php_async.o
    src/.libs/context.o
duplicate symbol _async_globals in:
    .libs/php_async.o
    src/.libs/fiber.o
duplicate symbol _async_globals in:
    .libs/php_async.o
    src/.libs/signal_watcher.o
duplicate symbol _async_globals in:
    .libs/php_async.o
    src/.libs/stream_watcher.o
duplicate symbol _async_globals in:
    .libs/php_async.o
    src/.libs/task.o
duplicate symbol _async_globals in:
    .libs/php_async.o
    src/.libs/task_scheduler.o
duplicate symbol _async_globals in:
    .libs/php_async.o
    src/.libs/udp.o
duplicate symbol _async_globals in:
    .libs/php_async.o
    src/.libs/timer.o
ld: 8 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [async.la] Error 1
@martinschroeder

This comment has been minimized.

Member

martinschroeder commented Dec 6, 2018

The duplicate symbols are likely caused by ZEND_DECLARE_MODULE_GLOBALS(async) which is present in many files because i assumed it was necessary (which is not the case). Can you try to compile the xp_socket branch instead of master, the duplicated cod is removed in this branch plus you get the readlink fix for free, no need to change any files.

@dseguy

This comment has been minimized.

dseguy commented Dec 7, 2018

I had to remove the Makefile.frag that I edited locally, so this is definitely fixed.

phpize and ./configure are OK.
make ends with this error :

/tmp/php-async/src/filesystem.c:169:10: error: no member named 'st_atim' in 'struct stat'
        ssb->sb.st_atim.tv_sec = (time_t) stat->st_atim.tv_sec;
        ~~~~~~~ ^
/tmp/php-async/src/filesystem.c:170:10: error: no member named 'st_atim' in 'struct stat'
        ssb->sb.st_atim.tv_nsec = stat->st_atim.tv_nsec;
        ~~~~~~~ ^
/tmp/php-async/src/filesystem.c:172:10: error: no member named 'st_mtim' in 'struct stat'
        ssb->sb.st_mtim.tv_sec = (time_t) stat->st_mtim.tv_sec;
        ~~~~~~~ ^
/tmp/php-async/src/filesystem.c:173:10: error: no member named 'st_mtim' in 'struct stat'
        ssb->sb.st_mtim.tv_nsec = stat->st_mtim.tv_nsec;
        ~~~~~~~ ^
/tmp/php-async/src/filesystem.c:175:10: error: no member named 'st_ctim' in 'struct stat'
        ssb->sb.st_ctim.tv_sec = (time_t) stat->st_ctim.tv_sec;
        ~~~~~~~ ^
/tmp/php-async/src/filesystem.c:176:10: error: no member named 'st_ctim' in 'struct stat'
        ssb->sb.st_ctim.tv_nsec = stat->st_ctim.tv_nsec;
        ~~~~~~~ ^
6 errors generated.
@martinschroeder

This comment has been minimized.

Member

martinschroeder commented Dec 10, 2018

I was able to reproduce this error on travis and fixed it. The layout (and field names) of struct stat differ quite a bit between systems. It could also fail on BSDs and additional checks might be needed.

Switch back to installing the master branch, it contains the fix and all the commits from xp_socket have been merged by now.

@dseguy

This comment has been minimized.

dseguy commented Dec 10, 2018

First, let me thank you for your hard work on this. This is much appreciated. :)

So, I now have a full PHP 7.3.0 (no more RC) and the compilation just follows the documentation fluently. All 12 UT fails, though.

Then, php -m yields the following feedback :

dyld: lazy symbol binding failed: Symbol not found: _uv_replace_allocator
  Referenced from: /usr/local/Cellar/php/7.3.0/pecl/20180731/async.so
  Expected in: flat namespace

dyld: Symbol not found: _uv_replace_allocator
  Referenced from: /usr/local/Cellar/php/7.3.0/pecl/20180731/async.so
  Expected in: flat namespace

Abort trap: 6

I did the make install, then configure async.ini with this :

[async]
;extension="/usr/local/Cellar/php/7.3.0/pecl/20180731/async.so"
@martinschroeder

This comment has been minimized.

Member

martinschroeder commented Dec 10, 2018

I removed the code that replaces the allocator. it caused trouble on Windows as well and is not reliable at all. This error did not occur on my travis build for some reason...

While i was at it i also improved DNS lookup code which was failing on travis. Could you try to run examples/socket-http-client.php and check if there are any errors with this one in case you manage to compile the extension?

I pushed my commits to master, you can try again anytime.

@dseguy

This comment has been minimized.

dseguy commented Dec 10, 2018

So, new compilation, and now we have 22 Passing UT over 91 !!! 👍

Here are the full results, if that's good for you.

Time to start using this seriously!

Many thanks for your hard work.

=====================================================================
PHP         : /usr/local/Cellar/php/7.3.0/bin/php 
PHP_SAPI    : cli
PHP_VERSION : 7.3.0
ZEND_VERSION: 3.3.0-dev
PHP_OS      : Darwin - Darwin NeoMacBookPro.local 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64
INI actual  : /Users/*******/bin/php-async/tmp-php.ini
More .INIs  :   
---------------------------------------------------------------------
PHP         : /usr/local/Cellar/php/7.3.0/bin/phpdbg 
PHP_SAPI    : phpdbg
PHP_VERSION : 7.3.0
ZEND_VERSION: 3.3.0-dev
PHP_OS      : Darwin - Darwin NeoMacBookPro.local 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64
INI actual  : /Users/******/bin/php-async/tmp-php.ini
More .INIs  : 
---------------------------------------------------------------------
CWD         : /Users/******/bin/php-async
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2018-12-10 17:09:13
=====================================================================
PASS Fiber yielding from internal function call. [tests/001-fiber-yield-from-icall.phpt] 
PASS Fiber yielding from PHP generator. [tests/002-fiber-yield-from-generator.phpt] 
PASS Fiber yielding from iterator. [tests/003-fiber-yield-from-iterator.phpt] 
PASS Fiber preserves refcount of objects passed to start(). [tests/004-fiber-refcount-start.phpt] 
PASS Fiber preserves refcount of objects passed to resume(). [tests/005-fiber-refcount-resume.phpt] 
PASS Fiber can return object to main thread. [tests/006-fiber-can-return-object.phpt] 
PASS Fiber can yield an object to the main thread. [tests/007-fiber-can-yield-object.phpt] 
PASS Fiber can return an unreferenced object to main thread. [tests/008-fiber-can-return-tmp-object.phpt] 
PASS Fiber can yield an unreferenced object to main thread. [tests/009-fiber-can-yield-tmp-object.phpt] 
PASS Fiber can pass an unreferenced object via start(). [tests/010-fiber-pass-tmp-object-in-start.phpt] 
PASS Fiber can pass an unreferenced object using resume(). [tests/011-fiber-pass-tmp-object-in-resume.phpt] 
PASS Fiber can use object method as callback. [tests/012-fiber-use-object-method-as-callback.phpt] 
PASS Fiber will expose status. [tests/013-fiber-status.phpt] 
PASS Fiber class indicates if currently executed code is running in a fiber. [tests/014-fiber-is-running.phpt] 
PASS Fiber class can display info about used backend. [tests/015-fiber-backend-info.phpt] 
PASS Fiber in suspended state will be cleaned up by throwing into it. [tests/016-fiber-destroyed-during-suspend.phpt] 
PASS Fiber callback will not be run if disposed before start. [tests/017-fiber-disposed-before-start.phpt] 
PASS Fiber can receive an error thrown into it while suspended. [tests/018-fiber-throw-error.phpt] 
PASS Fiber only accepts throw while in suspended state. [tests/019-fiber-throw-status-check.phpt] 
FAIL Fiber yield can only be used while a fiber is running. [tests/020-fiber-cannot-yield-in-main.phpt] 
PASS Fiber cannot be started multiple times. [tests/021-fiber-prevents-multiple-starts.phpt] 
FAIL Task scheduling and running using the scheduler API. [tests/100-task-scheduling.phpt] 
FAIL Task scheduling using the static task API. [tests/101-static-task-scheduling.phpt] 
FAIL Task awaiting arbitrary values. [tests/102-task-await.phpt] 
FAIL Task being suspended and resumed. [tests/103-task-suspend.phpt] 
FAIL Task will be run on a default scheduler. [tests/104-task-default-scheduler.phpt] 
FAIL Task will store error that failed it and pass it to continuations. [tests/107-task-error-continue.phpt] 
FAIL Task with multiple continuations. [tests/108-task-multiple-continuations.phpt] 
FAIL Task default scheduler can await awaitables created by a deferred. [tests/109-task-default-scheduler-await-deferred.phpt] 
FAIL Task indicates if currently executed code is running inside a task. [tests/110-task-is-running.phpt] 
FAIL Task can be inlined into another task. [tests/111-task-inlining.phpt] 
PASS Awaitable interface cannot be implemented by userland classes. [tests/112-task-awaitable-cannot-be-implemented.phpt] 
FAIL Task will await if the returned value is awaitable. [tests/113-task-will-await-returned-awaitable.phpt] 
FAIL Task will schedule an error if an awaited object is disposed before it is resolved. [tests/114-task-disposal.phpt] 
FAIL Task await on root level will not need a scheduler for resolved deferreds. [tests/115-task-root-await-deferred.phpt] 
FAIL Task will await if the returned value is awaitable. [tests/116-task-will-await-returned-awaitable.phpt] 
FAIL Task schedulers can be stacked and unstacked. [tests/121-task-scheduler-stacking.phpt] 
FAIL Task scheduler provides access to pending tasks. [tests/123-task-scheduler-pending-tasks.phpt] 
FAIL Task can await another task that is not inlined. [tests/124-task-await-pending-task.phpt] 
FAIL Task prevents multiple inlining of the same task instance. [tests/125-task-prevents-duplicate-inlining.phpt] 
FAIL Task execution does not clear global exception. [tests/126-task-executor-restores-error.phpt] 
FAIL Task keeps loop running while awaiting background task. [tests/127-task-busy-while-waiting.phpt] 
FAIL Context provides access to variables. [tests/200-context-var-access.phpt] 
FAIL Context variable access uses inheritance. [tests/201-context-nested-var.phpt] 
FAIL Context cancellation will spread to internally suspended operation. [tests/202-context-cancel-internal.phpt] 
FAIL Context cancellation will trigger deferred cancellation callback. [tests/203-context-cancel-deferred.phpt] 
FAIL Context cancellation is chained with parent cancellation. [tests/204-context-cancel-chain.phpt] 
FAIL Context cancellation of nested context does not affect unrelated context. [tests/205-context-cancel-nested.phpt] 
FAIL Context cancellation can be triggered using an internal timer. [tests/206-context-cancel-timeout.phpt] 
FAIL Context provides access to current context. [tests/207-context-current.phpt] 
FAIL Context can be shielded from cancellation. [tests/208-context-cancel-shield.phpt] 
FAIL Deferred basic API. [tests/300-deferred-api.phpt] 
FAIL Deferred awaitable combinator API. [tests/301-deferred-combinator.phpt] 
FAIL Deferred combinator ending with failure. [tests/302-deferred-combinator-fail.phpt] 
FAIL Deferred does not allow for Awaitable params as resolution values. [tests/303-deferred-rejects-awaitable-params.phpt] 
FAIL Deferred combinator fails with an error when it is disposed. [tests/304-deferred-disposal.phpt] 
PASS Deferred combinator validates input array. [tests/305-deferred-combinator-input-validation.phpt] 
FAIL Deferred combinator can await tasks. [tests/306-deferred-combinator-task.phpt] 
FAIL Deferred transform can deferreds as input. [tests/307-deferred-transform.phpt] 
FAIL Deferred transform can tasks as input. [tests/308-deferred-transform-task.phpt] 
FAIL Deferred combine can combine multiple unresolved tasks. [tests/309-deferred-combine-tasks.phpt] 
FAIL Timer will suspend and resume root execution. [tests/400-timer-at-root-level.phpt] 
FAIL Timer can be awaited within task. [tests/401-timer-within-task.phpt] 
FAIL Timer can be disposed within task if unrefed. [tests/402-timer-disposed-within-task.phpt] 
FAIL Timer can be closed while being awaited in a task. [tests/403-timer-close-within-task.phpt] 
FAIL Timer can be closed while being awaited in a task. [tests/404-timer-close-root-level.phpt] 
FAIL Stream watcher can be awaited at root level. [tests/405-stream-watcher-root-level.phpt] 
FAIL Stream watcher can be awaited within a task. [tests/406-stream-watcher-within-task.phpt] 
FAIL Stream watcher can be closed while being awaited at root level. [tests/407-stream-watcher-closed-root-level.phpt] 
FAIL Stream watcher can be closed while being awaited within a task. [tests/408-stream-watcher-closed-within-task.phpt] 
FAIL Stream watcher can be disposed while being awaited within a task. [tests/409-stream-watcher-disposed-within-task.phpt] 
FAIL Stream watcher read & write combination. [tests/410-stream-watcher-read-write.phpt] 
FAIL Process provides access code after execution. [tests/500-process-exit-code.phpt] 
FAIL Process provides STDOUT as readable pipe. [tests/501-process-output-pipe.phpt] 
FAIL Process provides STDERR as readable pipe. [tests/502-process-error-pipe.phpt] 
FAIL Process provides STDIN as writable pipe. [tests/503-process-input-pipe.phpt] 
FAIL Process can be signalled. [tests/504-process-signal.phpt] 
FAIL Process can inherit and change env. [tests/505-process-env.phpt] 
FAIL Process can inherit and change env. [tests/506-process-execute-env.phpt] 
FAIL TCP connected socket pair. [tests/600-tcp-socket-pair.phpt] 
FAIL TCP socket connection. [tests/601-tcp-socket-connection.phpt] 
FAIL TCP socket SSL connection. [tests/602-tcp-socket-ssl-connection.phpt] 
FAIL TCP half open socket connection. [tests/603-tcp-half-open-connection.phpt] 
FAIL TCP slow receiver. [tests/604-tcp-slow-receiver.phpt] 
FAIL TCP SSL slow receiver. [tests/605-tcp-ssl-slow-receiver.phpt] 
FAIL TCP closed read stream. [tests/606-tcp-closed-read-stream.phpt] 
FAIL TCP server cancel accept. [tests/607-tcp-cancel-accept.phpt] 
FAIL TCP spcket cancel read. [tests/608-tcp-cancel-read.phpt] 
FAIL UDP unicast send and receive. [tests/650-udp-unicast.phpt] 
FAIL UDP cancel receive operation. [tests/651-udp-cancel-receiver.phpt] 
FAIL UDP async send operations. [tests/652-udp-async-send.phpt] 
=====================================================================
TIME END 2018-12-10 17:09:20

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   65
---------------------------------------------------------------------

Number of tests :   91                91
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :   69 ( 75.8%) ( 75.8%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :   22 ( 24.2%) ( 24.2%)
---------------------------------------------------------------------
Time taken      :    7 seconds
=====================================================================

@martinschroeder

This comment has been minimized.

Member

martinschroeder commented Dec 10, 2018

Could you please look into the tests directory and post the contents of one of the *.log files. Best candidate would be the first one that looks like ###-task-. there seems to be a general problem with async tasks or (more likely) libuv...

@dseguy

This comment has been minimized.

dseguy commented Dec 10, 2018

Good guess :


---- EXPECTED OUTPUT
string(7) "PENDING"
bool(false)
bool(true)
bool(true)
string(1) "A"
string(1) "B"
string(1) "C"
---- ACTUAL OUTPUT
dyld: lazy symbol binding failed: Symbol not found: _uv_loop_init
  Referenced from: /Users/famille/bin/php-async/modules/async.so
  Expected in: flat namespace

dyld: Symbol not found: _uv_loop_init
  Referenced from: /Users/famille/bin/php-async/modules/async.so
  Expected in: flat namespace


Termsig=6
---- FAILED

@martinschroeder

This comment has been minimized.

Member

martinschroeder commented Dec 11, 2018

This is a problem with linking against libuv, i have no idea how to fix it yet. Can you switch to the mac2 branch and try this:

brew install libuv
phpize --clean
phpize
./configure
make install -B
make test

It should do dynamic against libuv installed via brew. It works within a travis build.

@dseguy

This comment has been minimized.

dseguy commented Dec 12, 2018

With libluv 1.2.40 installed, and branch mac2, compilation and installation works well.

88 tests PASS, 👍

Here are the missing ones, for information

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
TCP socket SSL connection. [tests/602-tcp-socket-ssl-connection.phpt]
TCP slow receiver. [tests/604-tcp-slow-receiver.phpt]
TCP SSL slow receiver. [tests/605-tcp-ssl-slow-receiver.phpt]
=====================================================================
@martinschroeder

This comment has been minimized.

Member

martinschroeder commented Dec 12, 2018

Very nice, i am getting the same failures when building with travis. Tests 602 and 605 fail due to missing SSL support (this is likely another linker related error). Test 604 fails to set TCP_NODELAY because the underlying socket pair uses a unix domain socket. Unfortunately libuv does not return error code UV_ENOTSUP in this case, it think i have to fix this by returning false instead of throwing an error.

@martinschroeder

This comment has been minimized.

Member

martinschroeder commented Dec 12, 2018

I updated the master branch with the changes needed to compile on Mac OS and added installation instructions to the readme file. Sometime in the future somebody who is more familiar with the build process and linking should take a look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment