[RFC] Binary pecl packages

php.internals

Tomas V.V.Cox

23 years ago
What about to start discussing about managment of binary pecl packages? I'm not the best person for listing the requirements, but here are some ideas: pecl package name ----------------- The name of the extension would be: peclfoo-bin-<OS>-<ARCH>-3.1.2-<STATE>.tgz The os (Operating system) and arch (CPU type), would be the value returned by the OS_Guess class. STATE is a valid PEAR_Common package state. package creation ---------------- pear build -b peclfoo-3.1.2.tgz The -b (or --bin) option generates the package containing only the compiled extension and the files marked with role "php", "doc", "test", "data" or "script" with the original package.xml modified automagically (explained in the next point). Without args it compiles the extension as it does nowadays. An idea would be to create a COMPILED_AT.txt file with some data about the env where the extension was compiled at, like the php version, the php_uname(), the extra libs versions, os vendor version, /etc/shadow file, etc. package.xml ----------- As a binary release shares the same release data with the source distrib, except the filelist (please confirm if an extension compiled may have different dependencies across different platforms), the same package.xml file could be used for all kind of distribs. Let's say something like: <release> <version>... <date> <notes> <filelist>.. <file role="ext" os="" arch=""> </release> installation ------------ pear install -b peclfoo (download and install the binary distrib of peclfoo for your current OS-ARCH) pear install peclfoo-bin-<OS>-<ARCH>-3.1.2-<STATE>.tgz All the files with role="ext" would be installed in "ext_dir" (pear cmd setting). The user can config it with "pear config-set ext_dir=XXX". If this var is not explicitly set, the following will be used for finding a default location: if (getenv('PHP_PEAR_EXTENSION_DIR')) { define('PEAR_CONFIG_DEFAULT_EXT_DIR', getenv('PHP_PEAR_EXTENSION_DIR')); } else { if (ini_get('extension_dir')) { define('PEAR_CONFIG_DEFAULT_EXT_DIR', ini_get('extension_dir')); } elseif (defined('PEAR_EXTENSION_DIR') && @is_dir(PEAR_EXTENSION_DIR)) { define('PEAR_CONFIG_DEFAULT_EXT_DIR', PEAR_EXTENSION_DIR); } elseif (defined('PHP_EXTENSION_DIR')) { define('PEAR_CONFIG_DEFAULT_EXT_DIR', PHP_EXTENSION_DIR); } else { define('PEAR_CONFIG_DEFAULT_EXT_DIR', '.'); } } Listing in the web ------------------ A new column "Type" should be added to the release listing under the package home page at pear.php.net, saying that the package is a binary distrib compiled for OS X and ARCH Y or sources.
-- Tomas V.V.Cox mailto:cox@idecnet.com

(Marcus Börger)

23 years ago
Hello Tomas, Why not using RPMs? Only windows is a problem, isn't it ? regards marcus Thursday, June 19, 2003, 1:19:36 AM, you wrote: TVVC> What about to start discussing about managment of binary pecl TVVC> packages? TVVC> I'm not the best person for listing the requirements, but here are some TVVC> ideas: TVVC> pecl package name TVVC> ----------------- TVVC> The name of the extension would be: TVVC> peclfoo-bin-<OS>-<ARCH>-3.1.2-<STATE>.tgz TVVC> The os (Operating system) and arch (CPU type), would be the value TVVC> returned by the OS_Guess class. STATE is a valid PEAR_Common package TVVC> state. TVVC> package creation TVVC> ---------------- TVVC> pear build -b peclfoo-3.1.2.tgz TVVC> The -b (or --bin) option generates the package containing only the TVVC> compiled extension and the files marked with role "php", "doc", "test", TVVC> "data" or "script" with the original package.xml modified TVVC> automagically (explained in the next point). TVVC> Without args it compiles the extension as it does nowadays. TVVC> An idea would be to create a COMPILED_AT.txt file with some data about TVVC> the env where the extension was compiled at, like the TVVC> php version, the php_uname(), the extra libs versions, os vendor TVVC> version, /etc/shadow file, etc. TVVC> package.xml TVVC> ----------- TVVC> As a binary release shares the same release data with the source TVVC> distrib, except the filelist (please confirm if an TVVC> extension compiled may have different dependencies across different TVVC> platforms), the same package.xml file could be used for all kind of TVVC> distribs. Let's say something like: TVVC> <release> TVVC> <version>... TVVC> <date> TVVC> <notes> TVVC> <filelist>.. TVVC> <file role="ext" os="" arch=""> TVVC> </release> TVVC> installation TVVC> ------------ TVVC> pear install -b peclfoo (download and install the binary distrib of TVVC> peclfoo for your current OS-ARCH) TVVC> pear install peclfoo-bin-<OS>-<ARCH>-3.1.2-<STATE>.tgz TVVC> All the files with role="ext" would be installed TVVC> in "ext_dir" (pear cmd setting). The user can config it with "pear config-set ext_dir=XXX". TVVC> If this var is not explicitly set, the following will be used for TVVC> finding a default location: TVVC> if (getenv('PHP_PEAR_EXTENSION_DIR')) { TVVC> define('PEAR_CONFIG_DEFAULT_EXT_DIR', getenv('PHP_PEAR_EXTENSION_DIR')); TVVC> } else { TVVC> if (ini_get('extension_dir')) { TVVC> define('PEAR_CONFIG_DEFAULT_EXT_DIR', ini_get('extension_dir')); TVVC> } elseif (defined('PEAR_EXTENSION_DIR') && @is_dir(PEAR_EXTENSION_DIR)) { TVVC> define('PEAR_CONFIG_DEFAULT_EXT_DIR', PEAR_EXTENSION_DIR); TVVC> } elseif (defined('PHP_EXTENSION_DIR')) { TVVC> define('PEAR_CONFIG_DEFAULT_EXT_DIR', PHP_EXTENSION_DIR); TVVC> } else { TVVC> define('PEAR_CONFIG_DEFAULT_EXT_DIR', '.'); TVVC> } TVVC> } TVVC> Listing in the web TVVC> ------------------ TVVC> A new column "Type" should be added to the release listing under the TVVC> package home page at pear.php.net, saying that the package is a binary TVVC> distrib compiled for OS X and ARCH Y or sources.
-- Best regards, Marcus mailto:helly@php.net

Rasmus Lerdorf

23 years ago
On Thu, 19 Jun 2003, Marcus Börger wrote:
> Why not using RPMs? Only windows is a problem, isn't it ?
Windows is the primary platform we need binaries for. -Rasmus

Ken Tossell

23 years ago
On Wed, 18 Jun 2003, Rasmus Lerdorf wrote:
> On Thu, 19 Jun 2003, Marcus Börger wrote: > > Why not using RPMs? Only windows is a problem, isn't it ? > > Windows is the primary platform we need binaries for.
And many major Linux distributions do not support RPM...
-- Ken Tossell ken at tossell dot net http://www.kennyt.com/ washington, dc / gmt -4

Gareth Ardron

23 years ago
On Thursday 19 June 2003 12:39 am, Ken Tossell wrote:
> > > > Windows is the primary platform we need binaries for. > And many major Linux distributions do not support RPM...
But would that matter? Slackware users are used to compiling everything by hand - having only rpm's avaliable is pretty common to them, so they won't care provided the source is to hand Debian users..well, somebody'll package it anyway within no time, and if they don't then again, we're all used to having only .rpm's avaliable and building from source. I honestly can't remember about suse and rpms, so I'm not going to go there. But deb and slack are the 2 really major distros which don't support rpms. Infact, a quick `apt-cache search rpm` seems to suggest there's a version of rpm for debian as well. Can't honestly think of any other major distro that doesn't support it.
-- Gareth Ardron

Manuel Lemos

23 years ago
Hello, On 06/18/2003 09:04 PM, Gareth Ardron wrote:
> On Thursday 19 June 2003 12:39 am, Ken Tossell wrote: > >>>Windows is the primary platform we need binaries for. >> >>And many major Linux distributions do not support RPM... > > > But would that matter?
Yes, it would not matter but if you want to have a single distribution of RPMs that are not dependent on the OS you need to have a private RPM database installed packages. AFAIK, RPMs for different distributions are not interchangeable at least because on each one the directory layout is different.
-- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/

Roman Neuhauser

23 years ago
# ken@tossell.net / 2003-06-18 19:39:22 -0400:
> On Wed, 18 Jun 2003, Rasmus Lerdorf wrote: > > > On Thu, 19 Jun 2003, Marcus Börger wrote: > > > Why not using RPMs? Only windows is a problem, isn't it ? > > > > Windows is the primary platform we need binaries for. > > And many major Linux distributions do not support RPM...
when has PHP (and/or PEAR) become Linux-only software?
-- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html

Ken Tossell

23 years ago
Roman Neuhauser wrote:
># ken@tossell.net / 2003-06-18 19:39:22 -0400: > > >>On Wed, 18 Jun 2003, Rasmus Lerdorf wrote: >> >> >> >>>On Thu, 19 Jun 2003, Marcus Börger wrote: >>> >>> >>>>Why not using RPMs? Only windows is a problem, isn't it ? >>>> >>>> >>>Windows is the primary platform we need binaries for. >>> >>> >>And many major Linux distributions do not support RPM... >> >> > > when has PHP (and/or PEAR) become Linux-only software? > > >
It never did. That's another point against RPM.

Derick Rethans

23 years ago
On Thu, 19 Jun 2003, Ken Tossell wrote:
> Roman Neuhauser wrote: > > > > when has PHP (and/or PEAR) become Linux-only software? > > > It never did. That's another point against RPM.
? WTF has this to do with each other. Because PHP is not Linux-only, that doesn't mean we can not provide RPMs too. Derick
-- "Interpreting what the GPL actually means is a job best left to those that read the future by examining animal entrails." ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ International PHP Magazine http://php-mag.net/ -------------------------------------------------------------------------

Dan Kalowsky

23 years ago
On Friday, June 20, 2003, at 02:53 AM, Derick Rethans wrote:
> On Thu, 19 Jun 2003, Ken Tossell wrote: > >> Roman Neuhauser wrote: >>> >>> when has PHP (and/or PEAR) become Linux-only software? >>> >> It never did. That's another point against RPM. > > ? WTF has this to do with each other. Because PHP is not Linux-only, > that doesn't mean we can not provide RPMs too.
Derick, I think the point of this is to not focus solely on RPMs which is a good mantra to follow.
>---------------------------------------------------------------<
Dan Kalowsky "The future is always uncertain, http://www.deadmime.org/~dank and the end is always near." dank-nom@aps-deadmime.org - "Roadhouse Blues", kalowsky@php.net The Doors

Derick Rethans

23 years ago
On Fri, 20 Jun 2003, Dan Kalowsky wrote:
> On Friday, June 20, 2003, at 02:53 AM, Derick Rethans wrote: > > > ? WTF has this to do with each other. Because PHP is not Linux-only, > > that doesn't mean we can not provide RPMs too. > > Derick, I think the point of this is to not focus solely on RPMs which > is a good mantra to follow.
I don't disagree with that, but the comments that was made looked liked it was "against any use of RPM", and that's something I'm disagreeing with. Derick
-- "Interpreting what the GPL actually means is a job best left to those that read the future by examining animal entrails." ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ International PHP Magazine http://php-mag.net/ -------------------------------------------------------------------------

Ken Tossell

23 years ago
On Fri, 20 Jun 2003, Derick Rethans wrote:
> On Fri, 20 Jun 2003, Dan Kalowsky wrote: > > > On Friday, June 20, 2003, at 02:53 AM, Derick Rethans wrote: > > > > > ? WTF has this to do with each other. Because PHP is not Linux-only, > > > that doesn't mean we can not provide RPMs too. > > > > Derick, I think the point of this is to not focus solely on RPMs which > > is a good mantra to follow. > > I don't disagree with that, but the comments that was made looked liked > it was "against any use of RPM", and that's something I'm disagreeing > with.
Oh, sorry. I should have made myself clearer. I'm just against RPM being *the* way to get packages from php.net. :-)
> > Derick > >
-- Ken Tossell ken at tossell dot net http://www.kennyt.com/ washington, dc / gmt -4

Tomas V.V.Cox

23 years ago
On Thursday, June 19, 2003 1:26, Marcus Börger wrote:
> Hello Tomas,
> Why not using RPMs? Only windows is a problem, isn't it ?
RPM is supported too, just do a "pear makerpm <package>". The command still need some work for pecl packages, but will be avaible as soon as the binary distrib system is set.
-- Tomas V.V.Cox mailto:cox@idecnet.com

Mika Tuupola

23 years ago
On Thu, 19 Jun 2003, Marcus BXrger wrote:
> Why not using RPMs? Only windows is a problem, isn't it ?
Too linux centric IMO.
-- Mika Tuupola http://www.appelsiini.net/~tuupola/

(Marcus Börger)

23 years ago
Hello Mika, Thursday, June 19, 2003, 7:44:11 PM, you wrote: MT> On Thu, 19 Jun 2003, Marcus BXrger wrote:
>> Why not using RPMs? Only windows is a problem, isn't it ?
MT> Too linux centric IMO. I didn't mean to only support RPMs. But i don't see any reason to not use RPMs where available in any form whatsoever. On Windows we should use msi of course.
-- Best regards, Marcus mailto:helly@php.net

Jon Parise

23 years ago
On Thu, Jun 19, 2003 at 01:19:36AM +0200, Tomas V.V.Cox wrote:
> package creation > ---------------- > > pear build -b peclfoo-3.1.2.tgz > > The -b (or --bin) option generates the package containing only the > compiled extension and the files marked with role "php", "doc", "test", > "data" or "script" with the original package.xml modified > automagically (explained in the next point).
I think 'pear dist' would be a more appropriate name for this operation (or maybe just an extension of 'pear package').
> An idea would be to create a COMPILED_AT.txt file with some data about > the env where the extension was compiled at, like the > php version, the php_uname(), the extra libs versions, os vendor > version, /etc/shadow file, etc.
I'd suggest BUILDINFO.txt. I'm not sure if this is entirely necessary, but I can see where it would be useful. I'll also point you to distutils[1]. The Python folks spent a lot of time thinking about these kinds of problems, and the result is a quite good system. [1] http://www.python.org/doc/current/lib/module-distutils.html
-- Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)

Tomas V.V.Cox

23 years ago
On Thursday, June 19, 2003 4:27, Jon Parise wrote:
> On Thu, Jun 19, 2003 at 01:19:36AM +0200, Tomas V.V.Cox wrote:
>> package creation >> ---------------- >> >> pear build -b peclfoo-3.1.2.tgz >> >> The -b (or --bin) option generates the package containing only the >> compiled extension and the files marked with role "php", "doc", "test", >> "data" or "script" with the original package.xml modified >> automagically (explained in the next point).
> I think 'pear dist' would be a more appropriate name for this > operation (or maybe just an extension of 'pear package').
Umm, yes, maybe it's better to just use "package". We have now native pear packages, rpm, msi is planned and others will surely come. Additionally we can generate the package description file and also call the tools for generating the whole package. Let's say something like: pear package [-t <type>] [-b] [-s] <package> -t <type> The type of package you want to generate (pear, rpm, msi, etc) -b Specifies a binary package -d Only generate the description package file You could even do a "pear package -t pear -d foo.tgz" to generate the package.xml file, at least the skeleton for hacking :)
>> An idea would be to create a COMPILED_AT.txt file with some data about >> the env where the extension was compiled at, like the >> php version, the php_uname(), the extra libs versions, os vendor >> version, /etc/shadow file, etc.
> I'd suggest BUILDINFO.txt. I'm not sure if this is entirely > necessary, but I can see where it would be useful.
I personally met with some situations with non working RPMs, where I missed a lot this info. It's just a helper file, even suitable for better bug reporting. Umm, that takes me to the idea of a new "pear bugreport" command ;)
> I'll also point you to distutils[1]. The Python folks spent a lot of > time thinking about these kinds of problems, and the result is a quite > good system.
> [1] http://www.python.org/doc/current/lib/module-distutils.html
Thanks, good info to look at.
-- Tomas V.V.Cox mailto:cox@idecnet.com

Jon Parise

23 years ago
On Thu, Jun 19, 2003 at 01:59:35PM +0200, Tomas V.V.Cox wrote:
> >> pear build -b peclfoo-3.1.2.tgz > >> > >> The -b (or --bin) option generates the package containing only the > >> compiled extension and the files marked with role "php", "doc", "test", > >> "data" or "script" with the original package.xml modified > >> automagically (explained in the next point). > > > I think 'pear dist' would be a more appropriate name for this > > operation (or maybe just an extension of 'pear package'). > > Umm, yes, maybe it's better to just use "package". We have now native > pear packages, rpm, msi is planned and others will surely come. > Additionally we can generate the package description file and also > call the tools for generating the whole package. > > Let's say something like: > > pear package [-t <type>] [-b] [-s] <package> > > -t <type> The type of package you want to generate (pear, rpm, > msi, etc) > -b Specifies a binary package > -d Only generate the description package file
I think this sounds good. The 'pear makerpm' command could be deprecated in favor of using the above, and this scheme allows more flexibility moving forward.
-- Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)

Martin Jansen

23 years ago
On Thu Jun 19, 2003 at 03:5002PM -0400, Jon Parise wrote:
> On Thu, Jun 19, 2003 at 01:59:35PM +0200, Tomas V.V.Cox wrote: > > Let's say something like: > > > > pear package [-t <type>] [-b] [-s] <package> > > > > -t <type> The type of package you want to generate (pear, rpm, > > msi, etc) > > -b Specifies a binary package > > -d Only generate the description package file > > I think this sounds good. The 'pear makerpm' command could be > deprecated in favor of using the above, and this scheme allows more > flexibility moving forward.
Agreed. Just a minor note: If the -t option isn't specified, it should default to "-t pear", as packaging this format will happen most times, imo.
-- - Martin Martin Jansen http://martinjansen.com/

Wez Furlong

23 years ago
When I get a little more time (in about 2 months!) I will be completing the work that I started on the .MSI installer generator for PHP. This will generate an installer for the PHP distribution (including PEAR) based on the .zip binary distros cooked by the snaps machine and meta data from the source tree. One of the things that should be possible is generating additional .MSI files for PECL packages. From the example below, the 'peclfoo' package would be generated as 'peclfoo-3.1.2-<STATE>.msi'. Since .msi is "equivalent" to .rpm, we would then have the benefits of a system supported package manager; the main thing that I can think of is that it will handle upgrading extensions that are in use (if the user has enough privileges) by being able to stop the web server while it updates the file, or perhaps scheduling a restart if that is required. --Wez.

Tomas V.V.Cox

23 years ago
On Thursday, June 19, 2003 8:42, Wez Furlong wrote:
> When I get a little more time (in about 2 months!) I will be completing the > work that I started on the .MSI installer generator for PHP.
> This will generate an installer for the PHP distribution (including PEAR) > based on the .zip binary distros cooked by the snaps machine and meta data > from the source tree.
> One of the things that should be possible is generating additional .MSI > files for PECL packages. From the example below, the 'peclfoo' package would > be generated as 'peclfoo-3.1.2-<STATE>.msi'.
> Since .msi is "equivalent" to .rpm, we would then have the benefits of a > system supported package manager; the main thing that I can think of is that > it will handle upgrading extensions that are in use (if the user has enough > privileges) by being able to stop the web server while it updates the file, > or perhaps scheduling a restart if that is required.
Could this .msi generator be integrated into the pear cmd? A "pear makemsi" command would be cool.
-- Tomas V.V.Cox mailto:cox@idecnet.com

Markus Fischer

23 years ago
Hi, On Thu, Jun 19, 2003 at 01:19:36AM +0200, Tomas V.V.Cox wrote : [...]
> pecl package name > ----------------- > > The name of the extension would be: > > peclfoo-bin-<OS>-<ARCH>-3.1.2-<STATE>.tgz > > The os (Operating system) and arch (CPU type), would be the value > returned by the OS_Guess class. STATE is a valid PEAR_Common package > state.
[...] The only thing I was really missing here (unless I managed to miss it in the text only) is different PHP versions. A binary built for PHP 4.0 wouldn't work with PHP 4.3 for example due to interface changes (bad example because not only the API changed but also some internals afaik; neverthless). I don't know if it's a good idea to show the version of PHP the binary was compiled against, but somehow it needs to be known if the binary is compatible at all. For example mod_ssl [1] always includes the version number of the Apache server it works with: 21-Mar-2003: Released 2.8.14-1.3.27: Important bugfixes. So, with a quick look on the filename you know if it's compiled against your PHP version or not. - Markus

Pierre-Alain Joye

23 years ago
On Fri, 20 Jun 2003 01:56:41 +0200 Markus Fischer <mfischer@gjat.josefine.at> wrote:
> For example mod_ssl [1] always includes the version number of > the Apache server it works with: > > 21-Mar-2003: Released 2.8.14-1.3.27: Important bugfixes. > > So, with a quick look on the filename you know if it's > compiled against your PHP version or not.
Sounds good too. And we already have the php version dependencies management. pierre