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

compile time error #13140

Closed
vahidr76 opened this issue Oct 28, 2017 · 7 comments
Closed

compile time error #13140

vahidr76 opened this issue Oct 28, 2017 · 7 comments

Comments

@vahidr76
Copy link

vahidr76 commented Oct 28, 2017

Hi. I want customize phalcon framework with zephir and then compile it.
in bult time get some error !

.
.
.
Warning: Function "textdomain" does not exist at compile time in /home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/phalcon/translate/adapter/gettext.zep on 137 [nonexistent-function]

	  return textdomain(this->getDefaultDomain());
	---------------------------------------------^


Warning: Function "bindtextdomain" does not exist at compile time in /home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/phalcon/translate/adapter/gettext.zep on 178 [nonexistent-function]

	    bindtextdomain(key, value);
	------------------------------^


Warning: Function "bindtextdomain" does not exist at compile time in /home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/phalcon/translate/adapter/gettext.zep on 181 [nonexistent-function]

	   bindtextdomain(this->getDefaultDomain(), directory);
	------------------------------------------------------^


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

in compile-error.log

/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:11: error: stray ‘\’ in program
  * Phalcon\Di\InjectionAwareInterface
           ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Di’
  * Phalcon\Di\InjectionAwareInterface
            ^~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:14: error: stray ‘\’ in program
  * Phalcon\Di\InjectionAwareInterface
              ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/exception.zep.c:18:11: error: stray ‘\’ in program
  * Phalcon\Exception
           ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/exception.zep.c:18:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Exception’
  * Phalcon\Exception
            ^~~~~~~~~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:12: error: unknown type name ‘Di’
  * Phalcon\Di\InjectionAwareInterface
            ^~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:18:88: error: stray ‘\’ in program
  * This interface must be implemented in those classes that uses internally the Phalcon\Di that creates them
                                                                                        ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:29:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘the’
  * Sets the dependency injector
         ^~~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:29:9: error: unknown type name ‘the’
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘the’
  * Returns the internal dependency injector
            ^~~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/exception.zep.c:18:12: error: unknown type name ‘Exception’
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:12: error: unknown type name ‘the’
make: *** [Makefile:236: phalcon/exception.lo] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:234: phalcon/di/injectionawareinterface.lo] Error 1
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:11: error: stray ‘\’ in program
  * Phalcon\Di\InjectionAwareInterface
           ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Di’
  * Phalcon\Di\InjectionAwareInterface
            ^~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:14: error: stray ‘\’ in program
  * Phalcon\Di\InjectionAwareInterface
              ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:12: error: unknown type name ‘Di’
  * Phalcon\Di\InjectionAwareInterface
            ^~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:18:88: error: stray ‘\’ in program
  * This interface must be implemented in those classes that uses internally the Phalcon\Di that creates them
                                                                                        ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:29:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘the’
  * Sets the dependency injector
         ^~~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:29:9: error: unknown type name ‘the’
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘the’
  * Returns the internal dependency injector
            ^~~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:12: error: unknown type name ‘the’
make: *** [Makefile:234: phalcon/di/injectionawareinterface.lo] Error 1

php -v

PHP 7.1.10 (cli) (built: Sep 27 2017 17:33:37) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

Zephir version 0.9.11-1f84124d4a

@Jurigag
Copy link
Contributor

Jurigag commented Oct 28, 2017

Possibly duplicate of #13076

@sergeyklay
Copy link
Member

You have to use re2c < 1.x. Check it by re2c --version

@vahidr76
Copy link
Author

I install re2c 0.16 but now get same error !

@sergeyklay
Copy link
Member

You'll need to clean the generated code by using zephir fullclean. Also provide please your compiler and version.

@vahidr76
Copy link
Author

Nope ! not work

cat /etc/*elease

LSB_VERSION=1.4
DISTRIB_ID=Arch
DISTRIB_RELEASE=rolling
DISTRIB_DESCRIPTION="Arch Linux"
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
ID_LIKE=archlinux
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"

gcc -v

Target: x86_64-pc-linux-gnu
gcc version 7.2.0 (GCC)

zephir help
Zephir version 0.9.11-1f84124d4a

re2c --version
re2c 0.16

make -v
GNU Make 4.2.1

autoconf-2.69-4
automake-1.15
pcre-8.41

sudo zephir fullclean
sudo zephir build

Warning: Function "bindtextdomain" does not exist at compile time in /home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/phalcon/translate/adapter/gettext.zep on 178 [nonexistent-function]

      bindtextdomain(key, value);
  ------------------------------^


Warning: Function "bindtextdomain" does not exist at compile time in /home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/phalcon/translate/adapter/gettext.zep on 181 [nonexistent-function]

     bindtextdomain(this->getDefaultDomain(), directory);
  ------------------------------------------------------^


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

compile-error.log

/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:11: error: stray ‘\’ in program
  * Phalcon\Di\InjectionAwareInterface
           ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Di’
  * Phalcon\Di\InjectionAwareInterface
            ^~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:14: error: stray ‘\’ in program
  * Phalcon\Di\InjectionAwareInterface
              ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:12: error: unknown type name ‘Di’
  * Phalcon\Di\InjectionAwareInterface
            ^~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:18:88: error: stray ‘\’ in program
  * This interface must be implemented in those classes that uses internally the Phalcon\Di that creates them
                                                                                        ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:29:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘the’
  * Sets the dependency injector
         ^~~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:29:9: error: unknown type name ‘the’
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘the’
  * Returns the internal dependency injector
            ^~~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:12: error: unknown type name ‘the’
make: *** [Makefile:234: phalcon/di/injectionawareinterface.lo] Error 1
make: *** Waiting for unfinished jobs....
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/exception.zep.c:18:11: error: stray ‘\’ in program
  * Phalcon\Exception
           ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/exception.zep.c:18:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Exception’
  * Phalcon\Exception
            ^~~~~~~~~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/exception.zep.c:18:12: error: unknown type name ‘Exception’
make: *** [Makefile:236: phalcon/exception.lo] Error 1
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:11: error: stray ‘\’ in program
  * Phalcon\Di\InjectionAwareInterface
           ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Di’
  * Phalcon\Di\InjectionAwareInterface
            ^~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:14: error: stray ‘\’ in program
  * Phalcon\Di\InjectionAwareInterface
              ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:16:12: error: unknown type name ‘Di’
  * Phalcon\Di\InjectionAwareInterface
            ^~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:18:88: error: stray ‘\’ in program
  * This interface must be implemented in those classes that uses internally the Phalcon\Di that creates them
                                                                                        ^
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:29:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘the’
  * Sets the dependency injector
         ^~~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:29:9: error: unknown type name ‘the’
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘the’
  * Returns the internal dependency injector
            ^~~
/home/mohsen/drive/mohsen95/workspace/php/custom_phalcon/01/cphalcon/ext/phalcon/di/injectionawareinterface.zep.c:34:12: error: unknown type name ‘the’
make: *** [Makefile:234: phalcon/di/injectionawareinterface.lo] Error 1

@sergeyklay
Copy link
Member

@vahidr76 Please see #13076 (comment)

sergeyklay added a commit to zephir-lang/php-zephir-parser that referenced this issue Nov 4, 2017
Don't concatenate result output in tests to avoid confusion.

Correct parser output for the following text:
```
/**
 * Comment
 */
```

is:

```
/**
 * Comment
 *
```

Related issues:

* #31
* zephir-lang/zephir#1591
* phalcon/cphalcon#13140
sergeyklay added a commit to zephir-lang/php-zephir-parser that referenced this issue Nov 4, 2017
Don't concatenate result output with "/" in tests
to avoid confusion. Correct parser output for the
following text:

  /**
   * Comment
   */

is:

  **
  * Comment
  *

Related issues:

* #31
* zephir-lang/zephir#1591
* phalcon/cphalcon#13140

8ae4b82
sergeyklay added a commit to zephir-lang/php-zephir-parser that referenced this issue Nov 4, 2017
Actually this is temporary workaround to be able try latest changes
of re2c >= 1.x.

Related issues:

* skvadrik/re2c#197
* #31
* zephir-lang/zephir#1591
* phalcon/cphalcon#13140
@sergeyklay
Copy link
Member

@vahidr76 I've prepared a patch for Zephir Parser to work with re2c >= 1.0. Could you please reinstall Zephir Parser from development branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants