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

Can't install with pickle #562

Closed
rageshkrishna opened this issue Mar 17, 2017 · 14 comments
Closed

Can't install with pickle #562

rageshkrishna opened this issue Mar 17, 2017 · 14 comments

Comments

@rageshkrishna
Copy link

Description

Running pickle install mongodb results in the following error:

root@00b966884cbc:~# pickle install mongodb
  - Installing mongodb (latest-stable): Downloading (100%)


  [Exception]
  Couldn't parse the version defined in the PHP_MONGODB_VERSION macro


install [--no-convert] [--defaults] [--source] [--with-configure-options WITH-CONFIGURE-OPTIONS] [--save-logs SAVE-LOGS] [--dry-run] [--php PHP] [--ini INI] [--tmp-dir TMP-DIR] [--] [<path>]

I suspect pickle is looking for PHP_MONGODB_VERSION but mongo-php-driver doesn't define it anywhere. To be honest, I'm not sure if this is a bug in mongo-php-driver or in pickle, but it looks like pickle is able to find it on several other extensions I am installing so is it some sort of standard approach that is not adopted by mongo-php-driver?

Environment

Ubuntu 16.04 docker container, PHP 7.1 installed with php-build and managed with phpenv.

Test Script

Fails on install with the command above. No other test script,

Expected and Actual Behavior

Expected the extension to be installed, but it did not.

@jmikola
Copy link
Member

jmikola commented Mar 17, 2017

PHP_EXTNAME_VERSION is included PHP's skeleton header for extensions. I don't recall if we used that when creating this extension, but this is easy to address. I've opened PHPC-936 to add the missing macro.


@weltling, @pierrejoye: I believe the PHP_EXTNAME_VERSION convention dates back to php/php-src@dcfd753, but can you explain why Pickle needs to derive a version from extension headers? I realize you need the version before building the extension, so phpversion('extname') is not an option, but Composer pulls version info from Git tags. Since you support both Git and HTTP sources (I assume that means PECL's index), wouldn't you simply pull version info from tags and PECL's database, respectively?

@pierrejoye
Copy link

pierrejoye commented Mar 17, 2017 via email

@pierrejoye
Copy link

pierrejoye commented Mar 17, 2017 via email

@jmikola
Copy link
Member

jmikola commented Mar 20, 2017

@pierrejoye: Thanks for the quick reply.

@rageshkrishna: 1.2.8 has been released with the change, so I will close this.

I attempted to install the extension using pickle install mongodb and there appears to be a configure error emanating from PHP_SETUP_OPENSSL() on my system. The headers are not being found as they normally are through a pecl install. I'm unsure if this is just specific to my OS environment or a widespread issue, but it's beyond the scope of PHPC-936 so please open a new issue if problems persist for you. Unfortunately, I'm not sure how to attempt installation with pickle before creating the PECL release, so I was unable to catch this before the release.

@jmikola jmikola closed this as completed Mar 20, 2017
@pierrejoye
Copy link

pierrejoye commented Mar 21, 2017 via email

@rageshkrishna
Copy link
Author

This got me around the OpenSSL error:

echo "--with-openssl-dir=yes" >> opts
pickle install --with-configure-options=opts mongodb

Thanks for the help @jmikola @pierrejoye!

@derickr
Copy link
Contributor

derickr commented Mar 21, 2017

@rageshkrishna — that sounds like a bug (in pickle), as --with-openssl-dir by default is set to true, and it uses --without-openssl-dir when you use the -n flag to pickle:

derick@singlemalt:/tmp/pickle $ bin/pickle -n install mongodb
  - Installing mongodb (latest-stable): Downloading (100%)         
+-----------------------------------+---------+
| Package name                      | mongodb |
| Package version (current release) | 1.2.8   |
| Package status                    | stable  |
+-----------------------------------+---------+
The following error(s) happened: configure failed, see log at /tmp/pickle-42ad7f47688e6bdf7b6c6cf9875adf308065564b\config.log
1: phpize
2: Configuring for:
2: PHP Api Version:         20160303
2: Zend Module Api No:      20160303
2: Zend Extension Api No:   320160303
1: /tmp/mongodb/mongodb-1.2.8/configure --enable-mongodb=shared  --without-openssl-dir --without-system-ciphers --without-libbson --without-libmongoc --without-mongodb-sasl
2: checking for grep that handles long lines and -e... /bin/grep
2: checking for egrep... /bin/grep -E
2: checking for a sed that does not truncate output... /bin/sed
2: checking for cc... cc
2: checking whether the C compiler works... yes
2: checking for C compiler default output file name... a.out
2: checking for suffix of executables...
2: checking whether we are cross compiling... no
2: checking for suffix of object files... o
2: checking whether we are using the GNU C compiler... yes
2: checking whether cc accepts -g... yes
2: checking for cc option to accept ISO C89... none needed
2: checking how to run the C preprocessor... cc -E
2: checking for icc... no
2: checking for suncc... no
2: checking whether cc understands -c and -o together... yes
2: checking for system library directory... lib
2: checking if compiler supports -R... no
2: checking if compiler supports -Wl,-rpath,... yes
2: checking build system type... x86_64-unknown-linux-gnu
2: checking host system type... x86_64-unknown-linux-gnu
2: checking target system type... x86_64-unknown-linux-gnu
2: checking for PHP prefix... /usr/local/php/7.1dev
2: checking for PHP includes... -I/usr/local/php/7.1dev/include/php -I/usr/local/php/7.1dev/include/php/main -I/usr/local/php/7.1dev/include/php/TSRM -I/usr/local/php/7.1dev/include/php/Zend -I/usr/local/php/7.1dev/include/php/ext -I/usr/local/php/7.1dev/include/php/ext/date/lib
2: checking for PHP extension directory... /usr/local/php/7.1dev/lib/php/extensions/debug-non-zts-20160303
2: checking for PHP installed headers prefix... /usr/local/php/7.1dev/include/php
2: checking if debug is enabled... yes
2: checking if zts is enabled... no
2: checking for re2c... re2c
2: checking for re2c version... 0.16 (ok)
2: checking for gawk... gawk
2: checking whether to enable mongodb support... yes, shared
2: checking OpenSSL dir for mongodb... no
2: checking whether to use system default cipher list instead of hardcoded value... no
2: checking PHP version... 70104
2: checking whether to enable developer build flags... no
2: checking whether to enable code coverage... no
2: checking whether to use system libbson... no
2: checking whether to use system libmongoc... no
2: checking configuring libmongoc... ...
2: checking for pkg-config... /usr/bin/pkg-config
2: configure: error: Cannot find OpenSSL's <evp.h>

@derickr
Copy link
Contributor

derickr commented Mar 21, 2017

I filed a ticket for pickle: FriendsOfPHP/pickle#152

@rageshkrishna
Copy link
Author

@derickr You're right, I get the evp.h error if I just do pickle install mongodb and accept the defaults on all the prompts. It works fine only if I specifically say yes when it asks for OpenSSL dir for mongodb (default: ): .

Thanks for opening the issue on pickle.

@allella
Copy link

allella commented Apr 4, 2017

@derickr Is there any interest in promoting a forthcoming yum installable PECL package for CentOS / RHEL 7?

The folks at IUS are rolling out php71u-pecl-mongodb
to go along with many of the other PHP and PECL packages they support.

I figured I'd ask on this somewhat related thread rather than open a new issue for the sake of getting someone's guidance if if this is a good or bad idea.

Thanks

@derickr
Copy link
Contributor

derickr commented Apr 5, 2017

Hi @allella , there has been a YUM installable package for a long time, made by @remicollet for the Fedora (and related) projects: http://pkgs.fedoraproject.org/cgit/rpms/php-pecl-mongodb.git/

@remicollet
Copy link
Contributor

The php-pecl-mongodb package in EPEL is design to work with default PHP in base system.

Official RH answer to provide newer PHP versions is Software Collections which are also available for CentOS users
=> https://wiki.centos.org/AdditionalResources/Repositories/SCL

Additional packages maintained by community (the CentOS SCLo SIG) includes the sclo-php-pecl-mongodb package (planed to be rebase to 1.2.x with RHSCL next version)
=> https://blog.remirepo.net/post/2017/02/23/Additional-PHP-packages-for-RHSCL

@allella I don't think promoting alternative 3rd party repository make sense, especially when tons exists: ius, remi, webtatic... (and especially IUS which only provide a very minimal set of extensions, just pulling their sources from another repository...)

@allella
Copy link

allella commented Apr 5, 2017

@remicollet Alright. I had noticed EPEL was showing php-pecl-mongodb-1.1.10-1.el7.x86_64.rpm which is why I asking IUS to create a 1.2 version. Also, because we're using PHP 7.1.

I'll read more about the SCLo.

Thanks

@carlwgeorge
Copy link

@allella Check out https://www.hogarthuk.com/?q=node/15 and https://ius.io/IUSvsSCL/ for some SCL comparisons.

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

7 participants