You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Anthony Molinaro (JIRA)" <ji...@apache.org> on 2010/08/16 08:54:26 UTC

[jira] Created: (THRIFT-854) Provide configure option and make rules to build/install php extension

Provide configure option and make rules to build/install php extension
----------------------------------------------------------------------

                 Key: THRIFT-854
                 URL: https://issues.apache.org/jira/browse/THRIFT-854
             Project: Thrift
          Issue Type: Improvement
    Affects Versions: 0.5
            Reporter: Anthony Molinaro


I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.

configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (THRIFT-854) Provide configure option and make rules to build/install php extension

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury closed THRIFT-854.
--------------------------------

         Assignee: Anthony Molinaro
    Fix Version/s: 0.5
       Resolution: Fixed

OK, I committed this patch with php_extension defaulting to yes. Thanks Anthony!

> Provide configure option and make rules to build/install php extension
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-854
>                 URL: https://issues.apache.org/jira/browse/THRIFT-854
>             Project: Thrift
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Anthony Molinaro
>            Assignee: Anthony Molinaro
>             Fix For: 0.5
>
>         Attachments: php-ext.patch, thrift_protocol.ini
>
>
> I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.
> configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
> PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-854) Provide configure option and make rules to build/install php extension

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899075#action_12899075 ] 

David Reiss commented on THRIFT-854:
------------------------------------

I don't think putting phpize in bootstrap is good because we don't want people to run that on release tarballs.  Is there any way to move that to configure or make?

In general, I found that trying to cram other build systems into our autoconf/automake setup leads to trouble and people have better luck running ant/setup.py/gem/phpize directly.  You guys build RPMs, right?  Would you be amenable to putting these commands in contrib/thrift.spec instead?

> Provide configure option and make rules to build/install php extension
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-854
>                 URL: https://issues.apache.org/jira/browse/THRIFT-854
>             Project: Thrift
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Anthony Molinaro
>         Attachments: php-ext.patch, thrift_protocol.ini
>
>
> I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.
> configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
> PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-854) Provide configure option and make rules to build/install php extension

Posted by "Anthony Molinaro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900815#action_12900815 ] 

Anthony Molinaro commented on THRIFT-854:
-----------------------------------------

No, I just figured that it was safer to leave it off by default since that mimics current behavior, but leaving it on is probably fine.  We'll flush out any issues sooner that way.

> Provide configure option and make rules to build/install php extension
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-854
>                 URL: https://issues.apache.org/jira/browse/THRIFT-854
>             Project: Thrift
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Anthony Molinaro
>         Attachments: php-ext.patch, thrift_protocol.ini
>
>
> I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.
> configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
> PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-854) Provide configure option and make rules to build/install php extension

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900805#action_12900805 ] 

Bryan Duxbury commented on THRIFT-854:
--------------------------------------

I have no problem with needing phpize installed (since apparently I already have it). However... what exactly am I supposed to do to test this change? Running "make" in lib/php does nothing.

> Provide configure option and make rules to build/install php extension
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-854
>                 URL: https://issues.apache.org/jira/browse/THRIFT-854
>             Project: Thrift
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Anthony Molinaro
>         Attachments: php-ext.patch, thrift_protocol.ini
>
>
> I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.
> configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
> PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-854) Provide configure option and make rules to build/install php extension

Posted by "Anthony Molinaro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900771#action_12900771 ] 

Anthony Molinaro commented on THRIFT-854:
-----------------------------------------

So I don't want this one to linger too much longer, is it cool, can we commit it?  It's probably up to Bryan since he'll need phpize installed when creating distros.

> Provide configure option and make rules to build/install php extension
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-854
>                 URL: https://issues.apache.org/jira/browse/THRIFT-854
>             Project: Thrift
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Anthony Molinaro
>         Attachments: php-ext.patch, thrift_protocol.ini
>
>
> I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.
> configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
> PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-854) Provide configure option and make rules to build/install php extension

Posted by "Anthony Molinaro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899120#action_12899120 ] 

Anthony Molinaro commented on THRIFT-854:
-----------------------------------------

phpize simply generates the autoconf items necessary for properly compiling php, the artifacts generated are those that bootstrap normally generates.  In fact if you look at the patch you'll see I invoke this in configure.ac via AC_CONFIG_SUBDIRS.  I'm not exactly sure how you would go about putting this into make, I guess you could call phpize, but it will then require people have autoconf/automake, etc.  Where with this solution only the packager requires autoconf/automake and phpize.  I guess alternatively I could tear apart phpize (its just a bash script which invokes autoconf and autoheader), and try to figure out how to reproduce its macros and integrate them into the main configure.ac, but that seem fraught with peril.

I've tested this on MacOSX Snow Leopard (which has phpize installed in the base os) and CentOS 5 (which has phpize in php-devel) and both do the right thing.

The only problem is while I build debs and rpms I don't actually touch a .spec or .deb file (I use an autotools wrapper called framewerk which takes care of those details, but it assumes autotools packages, thus the patches).  Also, I do think this is more useful to the end user as they can simply download, configure, make and install and have the extension even when they aren't working with rpms (for instance I can use this patch on my Mac to get the php extension).

It's definitely possible to create a spec file and put these things in contrib, but I'm unlikely to get to it soon, so not unwilling, but not likely to get to it soon.

> Provide configure option and make rules to build/install php extension
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-854
>                 URL: https://issues.apache.org/jira/browse/THRIFT-854
>             Project: Thrift
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Anthony Molinaro
>         Attachments: php-ext.patch, thrift_protocol.ini
>
>
> I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.
> configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
> PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-854) Provide configure option and make rules to build/install php extension

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899634#action_12899634 ] 

David Reiss commented on THRIFT-854:
------------------------------------

I guess doing it in bootstrap is fine, then.

> Provide configure option and make rules to build/install php extension
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-854
>                 URL: https://issues.apache.org/jira/browse/THRIFT-854
>             Project: Thrift
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Anthony Molinaro
>         Attachments: php-ext.patch, thrift_protocol.ini
>
>
> I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.
> configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
> PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-854) Provide configure option and make rules to build/install php extension

Posted by "Anthony Molinaro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anthony Molinaro updated THRIFT-854:
------------------------------------

    Attachment: php-ext.patch
                thrift_protocol.ini

Almost forgot, thrift_protocol.ini should be added to the lib/php directory.

The patch to the lib/php/Makefile.am also no longer installs the .cpp and config.m4 for to the extension.

> Provide configure option and make rules to build/install php extension
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-854
>                 URL: https://issues.apache.org/jira/browse/THRIFT-854
>             Project: Thrift
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Anthony Molinaro
>         Attachments: php-ext.patch, thrift_protocol.ini
>
>
> I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.
> configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
> PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-854) Provide configure option and make rules to build/install php extension

Posted by "Anthony Molinaro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899276#action_12899276 ] 

Anthony Molinaro commented on THRIFT-854:
-----------------------------------------

Oh, I didn't know about the spec file in contrib, I'll have to take a look.  As for phpize being specific to a particular php installation, I can't say for sure.
I did the following test which makes me think it is not

1. build a distribution with this patch on Centos 5.3 with php 5.2.11,
2. copy distribution to MacOSX Snow Leopard with php 5.3.1
3. ./configure --with-php_extension=yes && make
4. extension built fine

I then did the opposite,

1. build a distribution with this patch on MacOSX Snow Leopard with php 5.3.1
2. copy distribution to Centos 5.3 with php 5.2.11
3. ./configure --with-php_extension=yes && make
4. extension built fine

So it seems to work with different php's both forward in version and backward in version.

Now I'm not a php expert, so I can't say there's not some subtle issue, but I also grepped through the files and don't find the versions coded in there, just looks like the rest of the autotools stuff, macros and makefiles.

So, it seems benign to me to include it, however, I can probably figure out another way to do it if need be.  I'd say my second attempt would probably involve invoking phpize in the makefile, along with the configure script it generates.  That might look a little odd as you'd have just run the thrift configure only to see configure type output happen when you make, but that's probably not too bad.  I guess the real question is would you accept any solution where the extension is built/installed with the rest of thrift,  I don't want to spend more time messing with it, if there little or no chance of inclusion.

> Provide configure option and make rules to build/install php extension
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-854
>                 URL: https://issues.apache.org/jira/browse/THRIFT-854
>             Project: Thrift
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Anthony Molinaro
>         Attachments: php-ext.patch, thrift_protocol.ini
>
>
> I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.
> configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
> PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-854) Provide configure option and make rules to build/install php extension

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899161#action_12899161 ] 

David Reiss commented on THRIFT-854:
------------------------------------

There's already a spec file in contrib.  I was just suggesting that you add the php extension commands to it.

I was under the impression that phpize binds the generated files to the particular php installation that you ran phpize from.  If that is correct, I don't think we should be distributing those in release tarballs.

> Provide configure option and make rules to build/install php extension
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-854
>                 URL: https://issues.apache.org/jira/browse/THRIFT-854
>             Project: Thrift
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Anthony Molinaro
>         Attachments: php-ext.patch, thrift_protocol.ini
>
>
> I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.
> configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
> PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-854) Provide configure option and make rules to build/install php extension

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900806#action_12900806 ] 

Bryan Duxbury commented on THRIFT-854:
--------------------------------------

Ah, I just reread your original description and figured it out. Is there any reason we can't have with-php_extension default to true? Otherwise, it's going to get forgotten a lot.

> Provide configure option and make rules to build/install php extension
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-854
>                 URL: https://issues.apache.org/jira/browse/THRIFT-854
>             Project: Thrift
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Anthony Molinaro
>         Attachments: php-ext.patch, thrift_protocol.ini
>
>
> I like to build and install the php extension at the same time I build the php and other thrift artifacts.  The attached path adds the necessary logic to build and install the extension to work on redhat/centos/fedora machines.
> configure has a new option --with-php_extension=yes which will enable the compilation/installation of the extension, along with an environment variable 
> PHP_CONFIG_PREFIX which controls where the .ini file for enabling the extension is installed.  The one requirement for this to work is the person creating builds must have phpize installed (this prepares the autoconf artifacts to be appropriately added to the distribution).  On Centos/Redhat/Fedora this is in the php-devel package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.