Skip to content
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

php7.1 compile phalcon error #13082

Closed
gotoin opened this issue Sep 22, 2017 · 13 comments
Closed

php7.1 compile phalcon error #13082

gotoin opened this issue Sep 22, 2017 · 13 comments
Labels
need script to reproduce Script is required to reproduce the issue

Comments

@gotoin
Copy link

gotoin commented Sep 22, 2017

Questions should go to https://forum.phalconphp.com
Documentation issues should go to https://github.com/phalcon/docs/issues

Expected and Actual Behavior

Describe what you are trying to achieve and what goes wrong.

Provide output if related. Provide coredump if any. Use https://github.com/phalcon/cphalcon/wiki/Generating-a-backtrace as reference

// paste output here

Provide minimal script to reproduce the issue

// paste code

sudo zephir build —backend=ZendEngine3
Warning: Variable "beforeLine" assigned but not used in Phalcon\Debug::showTraceItem in /cphalcon/phalcon/debug.zep on 337 [unused-variable]

	   beforeLine, firstLine, afterLine, lastLine, i, linePosition, currentLine,
	-------------^


Warning: Function "\\sodium\\randombytes_buf" does not exist at compile time in /cphalcon/phalcon/security/random.zep on 124 [nonexistent-function]

	   return \\Sodium\\randombytes_buf(len);
	----------------------------------------^


Warning: Function "\\sodium\\randombytes_uniform" does not exist at compile time in /cphalcon/phalcon/security/random.zep on 321 [nonexistent-function]

	   return \\Sodium\\randombytes_uniform(len) + 1;
	---------------------------------------------^


Compiling...
Installing...
Zephir\CompilerException: Internal extension compilation failed. Check compile-errors.log for more information

Details

  • Phalcon version: 3.1.2
  • PHP Version: 7.1.8
  • Operating System: mac os
  • Installation type: Compiling from source
  • Zephir version (if any): 0.9.9-868cb1f92b
  • Server: Nginx
  • Other related info (Database, table schema): mysql
@gotoin
Copy link
Author

gotoin commented Sep 22, 2017

compile-error.log

/cphalcon/ext/phalcon/exception.zep.c:18:4/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
:16:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * Phalcon\Exception
   ^ * Phalcon\Di\InjectionAwareInterface
   ^

/cphalcon/ext/phalcon/exception.zep.c:18/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16::11: error: 11: error: expected ';' after top level declarator
expected ';' after top level declarator
 * Phalcon\Exception
          ^
          ;
 * Phalcon\Di\InjectionAwareInterface
          ^
          ;
/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * Returns the internal dependency injector
   ^
/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:11: error: expected ';' after top level declarator
 * Returns the internal dependency injector
          ^
          ;
1 warning and 1 error generated.
2 warnings and 2 errors generated.
make: *** [phalcon/exception.lo] Error 1
make: *** Waiting for unfinished jobs....
make: *** [phalcon/di/injectionawareinterface.lo] Error 1
/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * Phalcon\Di\InjectionAwareInterface
   ^
/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:11: error: expected ';' after top level declarator
 * Phalcon\Di\InjectionAwareInterface
          ^
          ;
/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * Returns the internal dependency injector
   ^
/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:11: error: expected ';' after top level declarator
 * Returns the internal dependency injector
          ^
          ;
2 warnings and 2 errors generated.
make: *** [phalcon/di/injectionawareinterface.lo] Error 1

@gotoin
Copy link
Author

gotoin commented Sep 22, 2017

and i try to

sudo zephir compile --backend=ZendEngine3 

Warning: Variable "beforeLine" assigned but not used in Phalcon\Debug::showTraceItem in /cphalcon/phalcon/debug.zep on 337 [unused-variable]

	   beforeLine, firstLine, afterLine, lastLine, i, linePosition, currentLine,
	-------------^


Warning: Function "\\sodium\\randombytes_buf" does not exist at compile time in /cphalcon/phalcon/security/random.zep on 124 [nonexistent-function]

	   return \\Sodium\\randombytes_buf(len);
	----------------------------------------^


Warning: Function "\\sodium\\randombytes_uniform" does not exist at compile time in /cphalcon/phalcon/security/random.zep on 321 [nonexistent-function]

	   return \\Sodium\\randombytes_uniform(len) + 1;
	---------------------------------------------^


Compiling...

sudo php build/gen-build.php 
Generating safe build... OK
Generating builds, optimized for 32-bit and 64-bit platforms... OK

cd build/php7/64bits/
sudo phpize && sudo ./configure && sudo make




Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
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 whether cc understands -c and -o together... yes
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-apple-darwin16.3.0
checking host system type... x86_64-apple-darwin16.3.0
checking target system type... x86_64-apple-darwin16.3.0
checking for PHP prefix... /usr/local/Cellar/php71/7.1.8_20
checking for PHP includes... -I/usr/local/Cellar/php71/7.1.8_20/include/php -I/usr/local/Cellar/php71/7.1.8_20/include/php/main -I/usr/local/Cellar/php71/7.1.8_20/include/php/TSRM -I/usr/local/Cellar/php71/7.1.8_20/include/php/Zend -I/usr/local/Cellar/php71/7.1.8_20/include/php/ext -I/usr/local/Cellar/php71/7.1.8_20/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/php71/7.1.8_20/lib/php/extensions/no-debug-non-zts-20160303
checking for PHP installed headers prefix... /usr/local/Cellar/php71/7.1.8_20/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 1.0.2 (ok)
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable phalcon... yes, shared
checking whether HAVE_BUNDLED_PCRE is declared... yes
checking for ext/pcre/php_pcre.h... yes
checking whether HAVE_JSON is declared... yes
checking for ext/json/php_json.h... yes
checking for ld used by cc... /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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/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 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 dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
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 for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin16.3.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... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
/bin/sh /cphalcon/build/php7/64bits/libtool --mode=compile cc  -I. -I/cphalcon/build/php7/64bits -DPHP_ATOM_INC -I/cphalcon/build/php7/64bits/include -I/cphalcon/build/php7/64bits/main -I/cphalcon/build/php7/64bits -I/usr/local/Cellar/php71/7.1.8_20/include/php -I/usr/local/Cellar/php71/7.1.8_20/include/php/main -I/usr/local/Cellar/php71/7.1.8_20/include/php/TSRM -I/usr/local/Cellar/php71/7.1.8_20/include/php/Zend -I/usr/local/Cellar/php71/7.1.8_20/include/php/ext -I/usr/local/Cellar/php71/7.1.8_20/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /cphalcon/build/php7/64bits/phalcon.zep.c -o phalcon.lo 
mkdir .libs
 cc -I. -I/cphalcon/build/php7/64bits -DPHP_ATOM_INC -I/cphalcon/build/php7/64bits/include -I/cphalcon/build/php7/64bits/main -I/cphalcon/build/php7/64bits -I/usr/local/Cellar/php71/7.1.8_20/include/php -I/usr/local/Cellar/php71/7.1.8_20/include/php/main -I/usr/local/Cellar/php71/7.1.8_20/include/php/TSRM -I/usr/local/Cellar/php71/7.1.8_20/include/php/Zend -I/usr/local/Cellar/php71/7.1.8_20/include/php/ext -I/usr/local/Cellar/php71/7.1.8_20/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /cphalcon/build/php7/64bits/phalcon.zep.c  -fno-common -DPIC -o .libs/phalcon.o
/cphalcon/build/php7/64bits/phalcon.zep.c:7921:9: warning: nonnull parameter 'ce' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
        while (ce) {
        ~~~~~  ^~
/cphalcon/build/php7/64bits/phalcon.zep.c:2896:83: note: declared 'nonnull' here
static int zephir_has_constructor_ce(const zend_class_entry *ce) ZEPHIR_ATTR_PURE ZEPHIR_ATTR_NONNULL;
                                                                                  ^
./php_phalcon.h:97:45: note: expanded from macro 'ZEPHIR_ATTR_NONNULL'
# define ZEPHIR_ATTR_NONNULL __attribute__((nonnull))
                                            ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12501:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * Phalcon\Acl
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12501:11: error: expected ';' after top level declarator
 * Phalcon\Acl
          ^
          ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12509:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * use Phalcon\Acl\Role;
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12509:7: error: expected ';' after top level declarator
 * use Phalcon\Acl\Role;
      ^
      ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12510:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * use Phalcon\Acl\Resource;
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12510:7: error: expected ';' after top level declarator
 * use Phalcon\Acl\Resource;
      ^
      ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12511:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * use Phalcon\Acl\Adapter\Memory;
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12511:7: error: expected ';' after top level declarator
 * use Phalcon\Acl\Adapter\Memory;
      ^
      ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12513:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * $acl = new Memory();
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12513:11: error: use of undeclared identifier 'new'
 * $acl = new Memory();
          ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12513:14: error: expected ';' after top level declarator
 * $acl = new Memory();
             ^
             ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12516:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * $acl->setDefaultAction(Acl::DENY);
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12516:8: error: expected ';' after top level declarator
 * $acl->setDefaultAction(Acl::DENY);
       ^
       ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12519:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * $roleAdmins = new Role("Administrators", "Super-User role");
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12519:18: error: use of undeclared identifier 'new'
 * $roleAdmins = new Role("Administrators", "Super-User role");
                 ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12519:21: error: expected ';' after top level declarator
 * $roleAdmins = new Role("Administrators", "Super-User role");
                    ^
                    ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12520:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * $roleGuests = new Role("Guests");
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12520:18: error: use of undeclared identifier 'new'
 * $roleGuests = new Role("Guests");
                 ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12520:21: error: expected ';' after top level declarator
 * $roleGuests = new Role("Guests");
                    ^
                    ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12523:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * $acl->addRole($roleGuests);
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12523:8: error: expected ';' after top level declarator
 * $acl->addRole($roleGuests);
       ^
       ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12526:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * $acl->addRole("Designers");
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12526:8: error: expected ';' after top level declarator
 * $acl->addRole("Designers");
       ^
       ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12529:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * $customersResource = new Resource("Customers", "Customers management");
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12529:25: error: use of undeclared identifier 'new'
 * $customersResource = new Resource("Customers", "Customers management");
                        ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12529:28: error: expected ';' after top level declarator
 * $customersResource = new Resource("Customers", "Customers management");
                           ^
                           ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12532:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * $acl->addResource($customersResource, "search");
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12532:8: error: expected ';' after top level declarator
 * $acl->addResource($customersResource, "search");
       ^
       ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12533:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * $acl->addResource($customersResource, ["create", "update"]);
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12533:4: error: redefinition of '$acl' with a different type: 'int *' vs 'int ***'
/cphalcon/build/php7/64bits/phalcon.zep.c:12532:4: note: previous definition is here
 * $acl->addResource($customersResource, "search");
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12533:8: error: expected ';' after top level declarator
 * $acl->addResource($customersResource, ["create", "update"]);
       ^
       ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12536:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * $acl->allow("Guests", "Customers", "search");
   ^
/cphalcon/build/php7/64bits/phalcon.zep.c:12536:8: error: expected ';' after top level declarator
 * $acl->allow("Guests", "Customers", "search");
       ^
       ;
/cphalcon/build/php7/64bits/phalcon.zep.c:12537:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 * $acl->allow("Guests", "Customers", "create");
   ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
16 warnings and 20 errors generated.
make: *** [phalcon.lo] Error 1



@gotoin
Copy link
Author

gotoin commented Sep 22, 2017

could you help me? i hope modify the phalcon code, thanks.

@kaioken
Copy link
Member

kaioken commented Sep 25, 2017

why not use brew to install it?

@gotoin
Copy link
Author

gotoin commented Sep 26, 2017

i need to change the phalcon code

@sergeyklay
Copy link
Member

So what did you change?

@sergeyklay sergeyklay added Need information need script to reproduce Script is required to reproduce the issue labels Sep 26, 2017
@gotoin
Copy link
Author

gotoin commented Sep 26, 2017

I haven't made any changes yet. i only try to compiled.

@gotoin
Copy link
Author

gotoin commented Sep 28, 2017

@sergeyklay could you help me? thank you.

@sergeyklay
Copy link
Member

What Phalcon branch commit do you use? Also provide please compiler info (version, name).

@Fisiu
Copy link

Fisiu commented Oct 10, 2017

It look similar to #13076.

@gotoin
Copy link
Author

gotoin commented Oct 11, 2017

gcc: stable 7.2.0 (bottled)

@gotoin
Copy link
Author

gotoin commented Oct 11, 2017

cphalcon 3.1.2

@sergeyklay
Copy link
Member

sergeyklay commented Oct 12, 2017

Closing this in favor of #13076

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need script to reproduce Script is required to reproduce the issue
Projects
None yet
Development

No branches or pull requests

4 participants