Sep extension problem
While trying to make separate extension 2 problems comes out
- make create not generating class methods to .cpp, only to .h With regular functions everything ok. May be not a bug.
- During compile third_party libs not included: In file included from ../../../../../src/runtime/base/time/datetime.h:21:0, from ../../../../../src/runtime/ext/ext_datetime.h:23, from ../../../../../src/runtime/ext/profile/extprofile_datetime.h:23, from ../../../../../src/runtime/ext/ext.h:30, from extimpl_redis.cpp:3: ../../../../../src/runtime/base/time/timezone.h:26:21: fatal error: timelib.h: No such file or directory compilation terminated. distcc[27042] ERROR: compile extimpl_redis.cpp on localhost failed
We don't yet separate extensions in the open source version, I'll take a look next week.
Built in generator also have problems with tests. During compile it complains about missing tests variable
Are there any updates on this issue?
It would be great to be able to create separate extensions.
So, the current git version has same problem, unable to create separated or not-separated extensions on Debian 6.0 system... PHP to binary compilation works with hphp, but i would like to implement a new extension to this system.
scottmac: Is there a plan to release open-source version with support of separated extension just like described here: https://github.com/facebook/hiphop-php/blob/master/doc/extension.development ?
Hmm, i'm checking mhash as example, see results:
- cd src/runtime/ext/sep/mhash
- make
find: `../../../../../external-fedora/mozilla': No such file or directory
find: `../../../../../external-fedora/mozilla': No such file or directory
Compiling extmap_mhash.cpp ...
find: `../../../../../external-fedora/mozilla': No such file or directory
find: `../../../../../external-fedora/mozilla': No such file or directory
Linking libmhash.so ...
find: `../../../../../external-fedora/mozilla': No such file or directory
find: `../../../../../external-fedora/mozilla': No such file or directory
Compiling ext_mhash.cpp ...
find: `../../../../../external-fedora/mozilla': No such file or directory
find: `../../../../../external-fedora/mozilla': No such file or directory
Compiling extmap_mhash.cpp ...
find: `../../../../../external-fedora/mozilla': No such file or directory
find: `../../../../../external-fedora/mozilla': No such file or directory
Compiling test_ext_mhash.cpp ...
find: `../../../../../external-fedora/mozilla': No such file or directory
find: `../../../../../external-fedora/mozilla': No such file or directory
Linking schema.so ...
../../../../../src/hphp/hphp -t sep-ext-cpp --output-file extimpl_mhash.cpp \
-v "SepExtensions.mhash.soname=schema.so" \
-v "SepExtensions.mhash.shared=true" \
-v "SepExtensions.mhash.libpath=/opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/sep/mhash" \
find: `../../../../../external-fedora/mozilla': No such file or directory
find: `../../../../../external-fedora/mozilla': No such file or directory
running hphp...
creating temporary directory /tmp/hphp_ww0oG3 ...
parsing inputs...
parsing inputs took 0'00" (8 ms) wall time
all files saved in /tmp/hphp_ww0oG3 ...
running hphp took 0'00" (374 ms) wall time
find: `../../../../../external-fedora/mozilla': No such file or directory
find: `../../../../../external-fedora/mozilla': No such file or directory
Compiling extimpl_mhash.cpp ...
distcc[11264] (dcc_parse_hosts) Warning: /home/louise/.distcc/zeroconf/hosts contained no hosts; can't distribute work
distcc[11264] (dcc_zeroconf_add_hosts) CRITICAL! failed to parse host file.
distcc[11264] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
find: `../../../../../external-fedora/mozilla': No such file or directory
find: `../../../../../external-fedora/mozilla': No such file or directory
Linking libmhash.a ...
find: `../../../../../external-fedora/mozilla': No such file or directory
find: `../../../../../external-fedora/mozilla': No such file or directory
Linking test_mhash ...
g++: ../../../../../external-fedora/libcurl/lib/libcurl.a: No such file or directory
g++: ../../../../../external-fedora/pcre/lib/libpcre.a: No such file or directory
g++: ../../../../../external-fedora/boost/lib/libboost_program_options-gcc40-mt.a: No such file or directory
g++: ../../../../../external-fedora/boost/lib/libboost_filesystem-gcc40-mt.a: No such file or directory
g++: ../../../../../external-fedora/boost/lib/libboost_system-gcc40-mt.a: No such file or directory
g++: ../../../../../external-fedora/mysql/lib/mysql/libmysqlclient_r.a: No such file or directory
g++: ../../../../../external-fedora/sqlite/lib/libsqlite3.a: No such file or directory
g++: ../../../../../external-fedora/libmcc/lib/libmcc.a: No such file or directory
g++: ../../../../../external-fedora/libch/lib/libch.a: No such file or directory
g++: ../../../../../external-fedora/libevent/lib/libevent.a: No such file or directory
g++: ../../../../../external-fedora/gd/lib/libgd.a: No such file or directory
g++: ../../../../../external-fedora/libpng/lib/libpng.a: No such file or directory
g++: ../../../../../external-fedora/libxml2/lib/libxml2.a: No such file or directory
g++: ../../../../../external-fedora/libfbml/lib/libfbml.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libmozutil_s.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libexpat_s.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libsaxp.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libunicharutil_s.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libxptcmd.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libxptcall.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libxptinfo.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libxpt.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libxpcomcomponents_s.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libxpcomproxy_s.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libxpcomio_s.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libxpcomds_s.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libxpcomglue.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libxpcombase_s.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libxpcomthreads_s.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libstring_s.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libplc4.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libplds4.a: No such file or directory
g++: ../../../../../external-fedora/mozilla/libnspr4.a: No such file or directory
g++: ../../../../../external-fedora/libmbfl/lib/libmbfl.a: No such file or directory
g++: ../../../../../external-fedora/oniguruma/lib/libonig.a: No such file or directory
g++: ../../../../../external-fedora/libmcrypt/lib/libmcrypt.a: No such file or directory
g++: ../../../../../external-fedora/jemalloc/lib/libjemalloc.a: No such file or directory
g++: ../../../../../external-fedora/icu-4_6/lib/libicui18n.a: No such file or directory
g++: ../../../../../external-fedora/icu-4_6/lib/libicuuc.a: No such file or directory
g++: ../../../../../external-fedora/icu-4_6/lib/libicudata.a: No such file or directory
g++: ../../../../../external-fedora/libafdt/lib/libafdt.a: No such file or directory
g++: ../../../../../external-fedora/libevent/lib/libevent.a: No such file or directory
g++: ../../../../../external-fedora/xhp/lib/libxhp.a: No such file or directory
g++: ../../../../../external-fedora/timelib/lib/libtimelib.a: No such file or directory
g++: ../../../../../external-fedora/tbb/lib/libtbb.a: No such file or directory
g++: ../../../../../external-fedora/libfbi/lib/libfbi.a: No such file or directory
g++: ../../../../../external-fedora/ldap/lib/libldap.a: No such file or directory
g++: ../../../../../external-fedora/ldap/lib/liblber.a: No such file or directory
g++: ../../../../../external-fedora/readline/lib/libreadline.a: No such file or directory
g++: ../../../../../external-fedora/readline/lib/libhistory.a: No such file or directory
g++: ../../../../../external-fedora/libmemcached/lib/libmemcached.a: No such file or directory
g++: ../../../../../external-fedora/libcap/lib64/libcap.a: No such file or directory
g++: ../../../../../external-fedora/imap/lib/c-client.a: No such file or directory
g++: ../../../../../external-fedora/oracle/lib/libclntsh.so.11.1: No such file or directory
g++: ../../../../../external-fedora/zlib/lib/libz.a: No such file or directory
g++: ../../../../../external-fedora/snappy/lib/libsnappy.a: No such file or directory
make: *** [test_mhash] Error 1
-
ls -al *.so
-rwxr-xr-x 1 louise louise 212447 Sep 16 16:02 libmhash.so -rwxr-xr-x 1 louise louise 212447 Sep 16 16:02 schema.so
-
cat mhash.idl.php | grep 'name'
... 'name' => "mhash_get_hash_name", 'desc' => "Gets the name of the specified hash.", ...
-
nm -Ca libmhash.so | grep 'mhash'
0000000000001c00 t global constructors keyed to extmap_mhash.cpp 00000000002036f0 b mhash_extension_classes 00000000002036e8 b mhash_extension_constants 0000000000203440 d mhash_extension_functions 00000000002036f8 b mhash_extension_declared_dynamic 0000000000000000 a extmap_mhash.cpp 0000000000203420 D mhash_map
-
nm -Ca libmhash.a | grep 'mhash_get_hash_name'
0000000000000000 r .gcc_except_table._ZN4HPHP21f_mhash_get_hash_nameEx 0000000000000000 t .text._ZN4HPHP21f_mhash_get_hash_nameEx 0000000000000000 T HPHP::f_mhash_get_hash_name(long long) 0000000000000040 r HPHP::f_mhash_get_hash_name(long long)::__func__ 0000000000000000 t .text._ZN12TestExtMhash24test_mhash_get_hash_nameEv 0000000000000000 T TestExtMhash::test_mhash_get_hash_name() 0000000000000000 r .gcc_except_table._ZN4HPHP21f_mhash_get_hash_nameEx 0000000000000000 t .text._ZN4HPHP21f_mhash_get_hash_nameEx 0000000000000000 T HPHP::f_mhash_get_hash_name(long long) 0000000000000040 r HPHP::f_mhash_get_hash_name(long long)::__func__ 0000000000000000 t .text._ZN12TestExtMhash24test_mhash_get_hash_nameEv 0000000000000000 T TestExtMhash::test_mhash_get_hash_name()
Looks like mhash function missed in dynamic library...
Let see a non-separable extension:
-
creating "doxcore.idl.php" file in "src/idl" folder
DefineFunction( array( 'name' => "doxcore_exists", 'desc' => "Test DoxCore framework existence", 'return' => array( 'type' => Boolean, 'desc' => "Returns TRUE when exists else FALSE.", ), )); -
run "EXT=doxcore make -C idl install" in "src" folder
Generating files from doxcore.idl.php... --> ext_doxcore.h ext_doxcore.cpp --> doxcore.inc --> test_ext_doxcore.h test_ext_doxcore.cpp --> ../runtime/ext/ext_doxcore.h ../runtime/ext/ext_doxcore.cpp --> ../runtime/ext/profile/extprofile_doxcore.h git add ../runtime/ext/ext_doxcore.h ../runtime/ext/ext_doxcore.cpp git add ../runtime/ext/profile/extprofile_doxcore.h git add ../system/doxcore.inc git add ../test/test_ext_doxcore.h ../test/test_ext_doxcore.cpp
-
run "EXT=doxcore make -C idl update" in "src" folder
Generating files from doxcore.idl.php... --> ext_doxcore.h ext_doxcore.cpp --> doxcore.inc --> test_ext_doxcore.h test_ext_doxcore.cpp --> ../runtime/ext/ext_doxcore.h ../runtime/ext/ext_doxcore.cpp --> ../runtime/ext/profile/extprofile_doxcore.h
-
"rm CMakeCache.txt" and "cmake ." in "hiphop-php" folder
-- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- CMAKE_PREFIX_PATH was missing, proceeding anyway -- Performing Test HAVE_GCC_43 -- Performing Test HAVE_GCC_43 - Success -- Boost version: 1.42.0 -- Found the following Boost libraries: -- system -- program_options -- filesystem -- MySQL Include dir: /usr/include library dir: /usr/lib -- MySQL client libraries: mysqlclient_r -- Found LIBMEMCACHED: /opt/doxcore/environment/hiphop/external/lib/libmemcached.so -- Found PCRE: /usr/lib/libpcre.so -- Found libevent: /opt/doxcore/environment/hiphop/external/lib/libevent.so -- Looking for evhttp_bind_socket_with_fd -- Looking for evhttp_bind_socket_with_fd - found -- Looking for gdImagePng in /usr/lib/libgd.so -- Looking for gdImagePng in /usr/lib/libgd.so - found -- Found ZLIB: /usr/include -- Found PNG: /usr/lib/libpng.so -- Looking for gdImageJpeg in /usr/lib/libgd.so -- Looking for gdImageJpeg in /usr/lib/libgd.so - found -- Found JPEG: /usr/lib/libjpeg.so -- Looking for gdImageGif in /usr/lib/libgd.so -- Looking for gdImageGif in /usr/lib/libgd.so - found -- Found GD: /usr/lib/libgd.so -- Found CURL: /opt/doxcore/environment/hiphop/external/lib/libcurl.so -- Looking for curl_multi_select -- Looking for curl_multi_select - found -- Found LibXml2: /usr/lib/libxml2.so -- Found EXPAT: /usr/lib/libexpat.so -- Found ICU header files in /usr/include -- Found ICU libraries: /usr/lib/libicuuc.so -- Can't find jemalloc -- Found minimal tcmalloc: /usr/lib/libtcmalloc_minimal.so -- Found Intel TBB -- Found mcrypt: /usr/lib/libmcrypt.so -- Found OpenSSL: /usr/lib/libssl.so;/usr/lib/libcrypto.so -- Found BZip2: /usr/lib/libbz2.so -- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.so -- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.so - found -- Found ONIGURUMA: /usr/lib/libonig.so -- Found ldap: /usr/lib/libldap.so;/usr/lib/liblber.so -- Found Readline: /usr/include -- Looking for arpa/inet.h -- Looking for arpa/inet.h - found -- Looking for netinet/in.h -- Looking for netinet/in.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for string.h -- Looking for string.h - found -- Looking for sys/socket.h -- Looking for sys/socket.h - found -- Looking for sys/time.h -- Looking for sys/time.h - found -- Looking for unistd.h -- Looking for unistd.h - found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of size_t -- Check size of size_t - done -- Check size of ssize_t -- Check size of ssize_t - done -- Check size of uint32_t -- Check size of uint32_t - done -- Check size of uint8_t -- Check size of uint8_t - done -- Looking for AF_LOCAL -- Looking for AF_LOCAL - found -- Looking for PF_LOCAL -- Looking for PF_LOCAL - found -- Looking for memset -- Looking for memset - found -- Looking for socket -- Looking for socket - found -- Looking for strerror -- Looking for strerror - found -- Found libevent: /opt/doxcore/environment/hiphop/external/lib/libevent.so -- Looking for event_get_version_number -- Looking for event_get_version_number - not found. -- Performing Test HAVE_LIBEVENT_145 -- Performing Test HAVE_LIBEVENT_145 - Success -- Found libevent 1.4.5+ -- Looking for include files INCLUDE_CHECK_stdlib.h -- Looking for include files INCLUDE_CHECK_stdlib.h - found -- Looking for include files INCLUDE_CHECK_assert.h -- Looking for include files INCLUDE_CHECK_assert.h - found -- Looking for strcasecmp -- Looking for strcasecmp - found -- Looking for strchr -- Looking for strchr - found -- Looking for include files HAVE_SYS_STAT_H -- Looking for include files HAVE_SYS_STAT_H - found -- Looking for include files HAVE_STDLIB_H -- Looking for include files HAVE_STDLIB_H - found -- Looking for include files HAVE_STRING_H -- Looking for include files HAVE_STRING_H - found -- Looking for include files HAVE_MEMORY_H -- Looking for include files HAVE_MEMORY_H - found -- Looking for include files HAVE_STRINGS_H -- Looking for include files HAVE_STRINGS_H - found -- Looking for include files HAVE_INTTYPES_H -- Looking for include files HAVE_INTTYPES_H - found -- Looking for include files HAVE_UNISTD_H -- Looking for include files HAVE_UNISTD_H - found -- Looking for include files HAVE_DLFCN_H -- Looking for include files HAVE_DLFCN_H - found -- Looking for fdatasync -- Looking for fdatasync - found -- Looking for usleep -- Looking for usleep - found -- Looking for fullfsync -- Looking for fullfsync - not found -- Looking for localtime_r -- Looking for localtime_r - found -- Looking for gmtime_r -- Looking for gmtime_r - found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Check if the system is big endian -- Searching 16 bit integer -- Check size of unsigned short -- Check size of unsigned short - done -- Using unsigned short -- Check if the system is big endian - little endian -- Looking for include files HAVE_LOCALE_H -- Looking for include files HAVE_LOCALE_H - found -- Looking for include files HAVE_LIMITS_H -- Looking for include files HAVE_LIMITS_H - found -- Check size of int32_t -- Check size of int32_t - done -- Looking for strtoll -- Looking for strtoll - found -- Looking for atoll -- Looking for atoll - found -- Looking for strftime -- Looking for strftime - found -- Looking for setlocale -- Looking for setlocale - found -- Configuring done -- Generating done -- Build files have been written to: /opt/doxcore/environment/hiphop/external/hiphop-php
-
run "make" in "hiphop-php" folder
[ 0%] Built target sqlite3 [ 1%] Built target xhp [ 2%] Built target timelib ... [ 54%] Building CXX object src/CMakeFiles/hphp_runtime_static.dir/runtime/ext/ext_network.cpp.o [ 55%] Building CXX object src/CMakeFiles/hphp_runtime_static.dir/runtime/ext/ext_iterator.cpp.o /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp: In function 'void HPHP::f_hphp_recursiveiteratoriterator_next(const HPHP::Object&)': /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp:179: error: 'q_RecursiveIteratorIterator$$SELF_FIRST' is not a member of 'HPHP' /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp:199: error: 'q_RecursiveIteratorIterator$$CHILD_FIRST' is not a member of 'HPHP' /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp:200: error: 'q_RecursiveIteratorIterator$$LEAVES_ONLY' is not a member of 'HPHP' /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp:222: error: 'q_RecursiveIteratorIterator$$CHILD_FIRST' is not a member of 'HPHP' /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp: In function 'bool HPHP::f_hphp_recursiveiteratoriterator_valid(const HPHP::Object&)': /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp:270: error: 'q_RecursiveIteratorIterator$$LEAVES_ONLY' is not a member of 'HPHP' /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp:271: error: 'q_RecursiveIteratorIterator$$CHILD_FIRST' is not a member of 'HPHP' /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp:275: error: 'q_RecursiveIteratorIterator$$CHILD_FIRST' is not a member of 'HPHP' /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp: In function 'HPHP::Variant HPHP::f_hphp_recursivedirectoryiterator_key(const HPHP::Object&)': /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp:347: error: 'q_RecursiveDirectoryIterator$$KEY_AS_FILENAME' is not a member of 'HPHP' /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp: In function 'HPHP::Variant HPHP::f_hphp_recursivedirectoryiterator_current(const HPHP::Object&)': /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp:380: error: 'q_RecursiveDirectoryIterator$$CURRENT_AS_PATHNAME' is not a member of 'HPHP' /opt/doxcore/environment/hiphop/external/hiphop-php/src/runtime/ext/ext_iterator.cpp:383: error: 'q_RecursiveDirectoryIterator$$CURRENT_AS_FILEINFO' is not a member of 'HPHP' make[2]: *** [src/CMakeFiles/hphp_runtime_static.dir/runtime/ext/ext_iterator.cpp.o] Error 1 make[1]: *** [src/CMakeFiles/hphp_runtime_static.dir/all] Error 2
-
run "make -C system" in "src" folder
../../src/hphp/hphp --opts=none -t cpp -f sys --input-dir . -i classes/arrayaccess.php classes/debugger.php classes/directory.php classes/directoryiterator.php classes/exception.php classes/fbmysqllexer.php classes/iterator.php classes/reflection.php classes/soapfault.php classes/splfile.php classes/splobjectstorage.php classes/stdclass.php classes/xhprof.php globals/constants.php globals/symbols.php -o gen 1>/dev/null make: Leaving directory `/opt/doxcore/environment/hiphop/external/hiphop-php/src/system'
p.s.: same problem, without solution(?): http://groups.google.com/group/hiphop-php-dev/browse_thread/thread/2344683cebceec97/78178d5fc29f11a3?lnk=gst&q=extension#78178d5fc29f11a3
We're closing out all bugs older than 2 months. http://www.hiphop-php.com/wp/?p=575
If this is still an issue, please re-open it, and in order of goodness:
- Give detailed repro steps
- Write a test case in hphp/tests/quick (run it with hphp/tests/run) and send the pull request
- Fix it in a pull request