Bug 657812 - update pulls in unnecessary dependencies
Summary: update pulls in unnecessary dependencies
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: php-pear
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Remi Collet
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-28 08:24 UTC by Michael Cronenworth
Modified: 2010-12-12 09:35 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-12 09:35:19 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
add check for header in phpize (537 bytes, patch)
2010-11-30 16:37 UTC, Remi Collet
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
PHP Bug Tracker 53436 0 None None None Never

Description Michael Cronenworth 2010-11-28 08:24:19 UTC
Description of problem: The latest php-pear update pulls in php-devel, which pulls in automake and autoconf. I don't see why production systems need those things installed.


Version-Release number of selected component (if applicable): php-pear-1.9.1-5.fc13.noarch

Additional info:
$ rpm -q php-pear --requires | grep php-devel
php-devel

php-pear-1.9.1-3.fc13.noarch did not require it. The RPM changelog does not mention anything about requiring php-devel.

Comment 1 Joe Orton 2010-11-28 15:04:29 UTC
Maybe it was lost in the merge - /usr/bin/pecl doesn't work without php-devel.

* Fri Sep 10 2010 Joe Orton <jorton> - 1:1.9.1-3
- require php-devel (without which pecl doesn't work)

I don't think it is correct for the package to ignore deps for the sake of convenience; we have had bugs filed about that too.

Perhaps we should split /usr/bin/pecl into a separate package?

Comment 2 Remi Collet 2010-11-28 18:47:34 UTC
I agree it's a bad practice to install devel stuff on a production server, when packaged pear/pecl extensions are available in the repository.


If we split "pecl" command (with dep to php-devel), in a sub package, we won't be able to register the packaged pecl extension.

Or we need to redefine the %pecl_(un)install macro to something like : 
/usr/bin/php -C -n -q -d include_path=/usr/share/pear -d output_buffering=1 /usr/share/pear/peclcmd.php install --nodeps --soft --force --register-only --nobuild

But, most of extension requires
Requires(post): %{__pecl}
Requires(postun): %{__pecl}

So, this will also requires a Guidelines update (and find a solution to keep compatibility)

Another solution could be to hack the pecl script to add a test

If options contains install 
and doesn't contains --nobuild
and /usr/include/php missing, then echo 
    Have you try ?
    yum install php-pecl-<extension> ?
    If you really want to build this extension, you must run
    yum install php-devel

Comment 3 Tim Jackson 2010-11-29 15:01:19 UTC
I would suggest going with patching the pecl script, it seems like the cleanest solution by far. If people manage everything using yum, they will never hit a problem (because they won't need to build stuff on the machine) and if they want to go outside that, installing php-devel seems like a reasonable compromise as long as we clearly explain it (and return non-zero from "pecl" so that any automated scripts will hopefully catch the error).

Comment 4 Remi Collet 2010-11-30 16:37:11 UTC
Created attachment 463772 [details]
add check for header in phpize

Another (even simpler) solution is to patch the phpize script which is only call before build (impact is less, I think, than patching the pecl script).

I also think this patch could be proposed upstream.

Comment 5 Joe Orton 2010-12-01 14:21:56 UTC
I defer to you guys on this; sorry for causing the hassle.

Patch looks fine, I'd correct the wording to:

"You must install the php-devel package."

Comment 6 Joe Orton 2010-12-01 14:30:09 UTC
Or to be more passive:

"The php-devel package is required for use of this command."

Comment 7 Remi Collet 2010-12-01 14:46:56 UTC
In fact this patch can't work.

When php-devel is not installed

# pecl install /tmp/APC-3.1.6.tgz 
49 source files, building
running: phpize
sh: phpize : commande introuvable
ERROR: `phpize' failed


Or we have to move the phpize command to php-cli sub-package...

Comment 8 Martí­n Marqués 2010-12-03 12:14:49 UTC
/usr/bin/pecl could (or should) look like:

#!/bin/sh
if [ -f /usr/bin/phpize ]; then 
    exec /usr/bin/php -C -n -q -d include_path=/usr/share/pear \
        -d output_buffering=1 /usr/share/pear/peclcmd.php "$@"
else
    echo "The php-devel package is required for use of this command."
fi

Using Joe Orton's output message.

Comment 9 Remi Collet 2010-12-03 13:49:09 UTC
(In reply to comment #8)
> /usr/bin/pecl could (or should) look like:

No, this change will break the "install --nobuild" options used during RPM (un)install scriptlet (which doesn't requires phpize).

This also breaks most of pecl commands which really doesn't build anything (help, list, list-all, list-upgrades, ...)

My idea, for now is :
- wait for upstream feedback on linked bug (or other idea)
- patch phpize to check for headers and display an explicit message on error
- move phpize to php-cli package
- remove php-pear dependency for php-devel

This seems (AMHA) the simpler and more robust (less impact).

Comment 10 Remi Collet 2010-12-12 09:35:19 UTC
Fix in php-5.3.4-1 and php-pear-1.9.1-6 in rawhide.


Note You need to log in before you can comment on or make changes to this bug.