Bundling libxml2 default?

php.internals

Adam Dickmeiss

23 years ago
With PHP5 as of today, a "clean" configure - with just --with-apxs compiles PHP5 with a bundled libxml2. That can't be right? I have libxml2-dev installed. Do I really have to use --without-bundle-libxml to make a sane installation? -- Adam
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Derick Rethans

23 years ago
On Fri, 16 May 2003, Adam Dickmeiss wrote:
> With PHP5 as of today, a "clean" configure - with just > --with-apxs > compiles PHP5 with a bundled libxml2. That can't be right? > I have libxml2-dev installed. Do I really have to use > --without-bundle-libxml > to make a sane installation?
Yup, feel free to unbundle libxml again :) Derick
-- "my other box is your windows PC" ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -------------------------------------------------------------------------

Sebastian Bergmann

23 years ago
Derick Rethans wrote:
> Yup, feel free to unbundle libxml again :)
Why not simply drop *all* bundled libraries (maybe libmysql beeing the only exception (for historic reasons)) and just require libxml2, pcre, etc.?
-- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

Zeev Suraski

23 years ago
At 10:12 17/05/2003, Sebastian Bergmann wrote:
>Derick Rethans wrote: > > Yup, feel free to unbundle libxml again :) > > Why not simply drop *all* bundled libraries (maybe libmysql beeing the > only exception (for historic reasons)) and just require libxml2, pcre, > etc.?
Because this is not helpful, short of giving very few people @php.net a warm fuzzy feeling. Zeev

Adam Dickmeiss

23 years ago
On Sat, May 17, 2003 at 06:15:37PM +0300, Zeev Suraski wrote:
> At 10:12 17/05/2003, Sebastian Bergmann wrote: > >Derick Rethans wrote: > >> Yup, feel free to unbundle libxml again :) > > > > Why not simply drop *all* bundled libraries (maybe libmysql beeing the > > only exception (for historic reasons)) and just require libxml2, pcre, > > etc.? > > Because this is not helpful, short of giving very few people @php.net a > warm fuzzy feeling.
What's your point? -- Adam
> Zeev > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Zeev Suraski

23 years ago
At 18:34 17/05/2003, Adam Dickmeiss wrote:
>On Sat, May 17, 2003 at 06:15:37PM +0300, Zeev Suraski wrote: > > At 10:12 17/05/2003, Sebastian Bergmann wrote: > > >Derick Rethans wrote: > > >> Yup, feel free to unbundle libxml again :) > > > > > > Why not simply drop *all* bundled libraries (maybe libmysql beeing the > > > only exception (for historic reasons)) and just require libxml2, pcre, > > > etc.? > > > > Because this is not helpful, short of giving very few people @php.net a > > warm fuzzy feeling. >What's your point?
That we've gone through this discussion a zillion times before. Search the archives. Zeev

Adam Dickmeiss

23 years ago
On Sat, May 17, 2003 at 10:41:36PM +0300, Zeev Suraski wrote:
> At 18:34 17/05/2003, Adam Dickmeiss wrote: > >On Sat, May 17, 2003 at 06:15:37PM +0300, Zeev Suraski wrote: > >> At 10:12 17/05/2003, Sebastian Bergmann wrote: > >> >Derick Rethans wrote: > >> >> Yup, feel free to unbundle libxml again :) > >> > > >> > Why not simply drop *all* bundled libraries (maybe libmysql beeing the > >> > only exception (for historic reasons)) and just require libxml2, pcre, > >> > etc.? > >> > >> Because this is not helpful, short of giving very few people @php.net a > >> warm fuzzy feeling. > >What's your point? > > That we've gone through this discussion a zillion times before. Search the > archives.
What's the point of making a comment when you apparently is not willing to discuss this? The problems with bundling becomes more and more apparent, IMHO. Not only makes it PHP more difficult to configure, it also results in more unnecessary work for PHP contributors, since they have to ensure the "latest and greatest". What about security for external bundled software. Will there be a PHP release when vulnerabilities are found in any of those? If no bundling took place updating would in many cases be provided by the OS provider. Even if it doesn't it will mean recompile or refetch a DLL/SO without the need to recompile whole PHP. Now, let's assume for a moment that the PHP code maintainers are still willing to do it. At least the configure options for the components could be harmonized : --with-component Search for component in system directories. If that is not found, use the bundled version (if any). --with-component=bundled Use the bundled version. Suggested by Moriyoshi. --with-component=dir Use the installed component in prefix dir. --without-component Do not use component. -- Adam
> Zeev
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Zeev Suraski

23 years ago
At 23:15 17/05/2003, Adam Dickmeiss wrote:
>Now, let's assume for a moment that the PHP code maintainers >are still willing to do it. At least the configure options >for the components could be harmonized : > > --with-component > Search for component in system directories. If that is > not found, use the bundled version (if any). > > --with-component=bundled > Use the bundled version. Suggested by Moriyoshi. > > --with-component=dir > Use the installed component in prefix dir. > > --without-component > Do not use component.
I'm all for that solution. I don't want to dive into the thou shalt not bundle discussion, I think bundling is a good idea for certain components, and giving users the ability to override that is even better. Zeev

Jani Taskinen

23 years ago
On Sat, 17 May 2003, Zeev Suraski wrote:
>At 23:15 17/05/2003, Adam Dickmeiss wrote: >>Now, let's assume for a moment that the PHP code maintainers >>are still willing to do it. At least the configure options >>for the components could be harmonized : >> >> --with-component >> Search for component in system directories. If that is >> not found, use the bundled version (if any). >> >> --with-component=bundled >> Use the bundled version. Suggested by Moriyoshi. >> >> --with-component=dir >> Use the installed component in prefix dir. >> >> --without-component >> Do not use component. > >I'm all for that solution. I don't want to dive into the thou shalt not >bundle discussion, I think bundling is a good idea for certain components, >and giving users the ability to override that is even better.
So you totally ignored all the points given why bundling is evil? Again the majority doesn't mean anything. Just the warm fuzzy feeling.. --Jani

Zeev Suraski

23 years ago
At 15:44 18/05/2003, Jani Taskinen wrote:
> So you totally ignored all the points given why bundling is evil?
No, I just got tired of repeating the same answers. Zeev

Jani Taskinen

23 years ago
On Sun, 18 May 2003, Zeev Suraski wrote:
>At 15:44 18/05/2003, Jani Taskinen wrote: >> So you totally ignored all the points given why bundling is evil? > >No, I just got tired of repeating the same answers.
I must have missed those, any urls to the archive? (I can't find any "answers" there) --Jani

(Marcus Börger)

23 years ago
At 22:58 17.05.2003, Zeev Suraski wrote:
>At 23:15 17/05/2003, Adam Dickmeiss wrote: >>Now, let's assume for a moment that the PHP code maintainers >>are still willing to do it. At least the configure options >>for the components could be harmonized : >> >> --with-component >> Search for component in system directories. If that is >> not found, use the bundled version (if any). >> >> --with-component=bundled >> Use the bundled version. Suggested by Moriyoshi. >> >> --with-component=dir >> Use the installed component in prefix dir. >> >> --without-component >> Do not use component. > >I'm all for that solution. I don't want to dive into the thou shalt not >bundle discussion, I think bundling is a good idea for certain components, >and giving users the ability to override that is even better.
So can we at least stick to this (what we do already) and add the good idea from moriyoshi? marcus

Moriyoshi Koizumi

23 years ago
marcus.boerger@t-online.de (Marcus Börger) wrote:
> At 22:58 17.05.2003, Zeev Suraski wrote: > >At 23:15 17/05/2003, Adam Dickmeiss wrote: > >>Now, let's assume for a moment that the PHP code maintainers > >>are still willing to do it. At least the configure options > >>for the components could be harmonized : > >> > >> --with-component > >> Search for component in system directories. If that is > >> not found, use the bundled version (if any). > >> > >> --with-component=bundled > >> Use the bundled version. Suggested by Moriyoshi. > >> > >> --with-component=dir > >> Use the installed component in prefix dir. > >> > >> --without-component > >> Do not use component. > > > >I'm all for that solution. I don't want to dive into the thou shalt not > >bundle discussion, I think bundling is a good idea for certain components, > >and giving users the ability to override that is even better. > > > So can we at least stick to this (what we do already) and add the good idea > from moriyoshi?
I made a patch to accomplish Adam's suggestion: http://www.voltex.jp/patches/bundle-libxml.patch.diff Moriyoshi

Adam Dickmeiss

23 years ago
On Sun, May 18, 2003 at 09:10:56AM +0900, Moriyoshi Koizumi wrote:
> marcus.boerger@t-online.de (Marcus Börger) wrote: > > > At 22:58 17.05.2003, Zeev Suraski wrote: > > >At 23:15 17/05/2003, Adam Dickmeiss wrote: > > >>Now, let's assume for a moment that the PHP code maintainers > > >>are still willing to do it. At least the configure options > > >>for the components could be harmonized : > > >> > > >> --with-component > > >> Search for component in system directories. If that is > > >> not found, use the bundled version (if any). > > >> > > >> --with-component=bundled > > >> Use the bundled version. Suggested by Moriyoshi. > > >> > > >> --with-component=dir > > >> Use the installed component in prefix dir. > > >> > > >> --without-component > > >> Do not use component. > > > > > >I'm all for that solution. I don't want to dive into the thou shalt not > > >bundle discussion, I think bundling is a good idea for certain components, > > >and giving users the ability to override that is even better. > > > > > > So can we at least stick to this (what we do already) and add the good idea > > from moriyoshi? > > I made a patch to accomplish Adam's suggestion: > http://www.voltex.jp/patches/bundle-libxml.patch.diff
I've applied your patch. Things didn't work quite as I expected. First of all, default is that Expat is enabled and bundled. libxml is off by default. This is due to ",no" and ",bundled" in PHP_ARG_BUNDLE in bundle/libxml/config.m4 and bunle/expat/config.m4 respectively. I thought we wanted libxml enabled and Expat disabled. So I then used --with-libxml --without-expat which I assumed would choose my already installed libxml. That still used the bundled version of libxml. -- Adam
> > Moriyoshi >
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Moriyoshi Koizumi

23 years ago
Adam Dickmeiss <adam@indexdata.dk> wrote:
> > I made a patch to accomplish Adam's suggestion: > > http://www.voltex.jp/patches/bundle-libxml.patch.diff > I've applied your patch. Things didn't work quite as I expected. > > First of all, default is that Expat is enabled and bundled. libxml > is off by default. This is due to ",no" and ",bundled" in > PHP_ARG_BUNDLE in bundle/libxml/config.m4 and bunle/expat/config.m4 > respectively. I thought we wanted libxml enabled and Expat disabled. > So I then used > --with-libxml --without-expat > which I assumed would choose my already installed libxml. That still > used the bundled version of libxml.
forgot to mention the meaning of options: --with-libxml=auto => detecting the location of libxml automatically --with-libxml=PFX => using the libxml installed in the specified prefix --with-libxml=bundled => using the bundled libxml --with-libxml => using the bundled libxml default: disabled (in order to avoid confusion) --with-expat=bundled => using the bundled expat --with-expat=PFX => using the expat installed in the specified prefix --with-expat => looking for libexpat in either /usr or /usr/local default: enabled (--with-expat=bundled) Moriyoshi

Adam Dickmeiss

23 years ago
On Mon, May 19, 2003 at 12:24:21AM +0900, Moriyoshi Koizumi wrote:
> Adam Dickmeiss <adam@indexdata.dk> wrote: > > > > I made a patch to accomplish Adam's suggestion: > > > http://www.voltex.jp/patches/bundle-libxml.patch.diff > > I've applied your patch. Things didn't work quite as I expected. > > > > First of all, default is that Expat is enabled and bundled. libxml > > is off by default. This is due to ",no" and ",bundled" in > > PHP_ARG_BUNDLE in bundle/libxml/config.m4 and bunle/expat/config.m4 > > respectively. I thought we wanted libxml enabled and Expat disabled. > > So I then used > > --with-libxml --without-expat > > which I assumed would choose my already installed libxml. That still > > used the bundled version of libxml. > > forgot to mention the meaning of options: > > --with-libxml=auto => detecting the location of libxml automatically > --with-libxml=PFX => using the libxml installed in the specified prefix > --with-libxml=bundled => using the bundled libxml > --with-libxml => using the bundled libxml > default: disabled (in order to avoid confusion) > > --with-expat=bundled => using the bundled expat > --with-expat=PFX => using the expat installed in the specified prefix > --with-expat => looking for libexpat in either /usr or /usr/local > default: enabled (--with-expat=bundled)
Is that a solution you like, or was it implemented that way because that was a quick way to move on? As you can guess, it was not exactly what I had in mind. But thank you for the patch. Again, IMHO, the whole bundling is for sysadmins who is either unware that they already have libxml2, mysql already installed or simply don't know how to get a separate component (either as a package for their dist or do configure&& make && make install). Therefore, the right way is to use the _system wide_ (note the term) libs for PHP unless explicitly told not to. The cost of - and danger of - running multiple versions of a shared/static component is evident. Let's view some of them: o Expat. The fact Expat is used by multiple parties in multiple versions is a problem. At times I've had to configure Apache to do ./configure --disable-rule=EXPAT ... (say no more). o Mysql. That big fat warning whenever you configure PHP. What's that for? If people already have a MySQL server they probably have the guts to compile with the libraries.. I don't know about this at all. It just smells bad. o libxml2 is now being bundled by default. That's going to hurt too. Regularly D. V. will publish fixes which will not be put in to PHP. And people will wonder why things don't work. If they are using some other component that uses libxml2 and they do ldd libphp5.so they will see that libxml2.so is loaded. The problem is that that will be "fake", since there is already a static libxml2 version inside PHP itself (with a bug in it) That's why --with-component should use the system version if it exists. And if a component is enabled by default, it should use the system version. Bundling is a bad thing. However, it is a way to ensure that cd php-.. configure make will succeed on all Unix like systems. Zeev, I've grepped in the archives and I admit there have been a lot discussions already. -- Adam
> Moriyoshi
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Adam Dickmeiss

23 years ago
On Mon, May 19, 2003 at 12:24:21AM +0900, Moriyoshi Koizumi wrote:
> Adam Dickmeiss <adam@indexdata.dk> wrote: > > > > I made a patch to accomplish Adam's suggestion: > > > http://www.voltex.jp/patches/bundle-libxml.patch.diff > > I've applied your patch. Things didn't work quite as I expected. > > > > First of all, default is that Expat is enabled and bundled. libxml > > is off by default. This is due to ",no" and ",bundled" in > > PHP_ARG_BUNDLE in bundle/libxml/config.m4 and bunle/expat/config.m4 > > respectively. I thought we wanted libxml enabled and Expat disabled. > > So I then used > > --with-libxml --without-expat > > which I assumed would choose my already installed libxml. That still > > used the bundled version of libxml. > > forgot to mention the meaning of options: > > --with-libxml=auto => detecting the location of libxml automatically > --with-libxml=PFX => using the libxml installed in the specified prefix > --with-libxml=bundled => using the bundled libxml > --with-libxml => using the bundled libxml > default: disabled (in order to avoid confusion) > > --with-expat=bundled => using the bundled expat > --with-expat=PFX => using the expat installed in the specified prefix > --with-expat => looking for libexpat in either /usr or /usr/local > default: enabled (--with-expat=bundled) > > Moriyoshi
Hi, I took Moriyoshi's patch. Twisted it a bit so that libxml2 is default enabled. Expat is disabled. --with-libxml uses system wide if found. Otherwise bundled version. --with-libxml=bundled use bundled version. --with-libxml[=dir] use version in dir. The Expat config.m4 is barely touched. It does not yet use system wide by default. Also modified ext/domxml/config.m4 a bit. Uses PHP_EVAL_INCLINE for PHP_LIBXML_CFLAGS . You can get the patch here: http://dickmeiss.net/files/bundle-libxml.patch2 (the diff is against PHP CVS, not against PHP CVS + Moriyoshi's patch) -- Adam
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Sterling Hughes

23 years ago
On Fri, 2003-05-16 at 10:50, Adam Dickmeiss wrote:
> With PHP5 as of today, a "clean" configure - with just > --with-apxs > compiles PHP5 with a bundled libxml2. That can't be right? > I have libxml2-dev installed. Do I really have to use > --without-bundle-libxml > to make a sane installation? >
Yep. We default to using the bundle, just like we do with expat, or mysql, gd, or any other piece of software we bundle. -Sterling
-- "Reductionists like to take things apart. The rest of us are just trying to get it together." - Larry Wall, Programming Perl, 3rd Edition

Adam Dickmeiss

23 years ago
On Fri, May 16, 2003 at 09:30:07AM -0400, Sterling Hughes wrote:
> On Fri, 2003-05-16 at 10:50, Adam Dickmeiss wrote: > > With PHP5 as of today, a "clean" configure - with just > > --with-apxs > > compiles PHP5 with a bundled libxml2. That can't be right? > > I have libxml2-dev installed. Do I really have to use > > --without-bundle-libxml > > to make a sane installation? > > > > Yep. We default to using the bundle, just like we do with expat, or > mysql, gd, or any other piece of software we bundle.
Default or force:) Is it possible to use system wide libxml2 for XML parsing in PHP? What options should I use? -- Adam
> -Sterling > > -- > "Reductionists like to take things apart. The rest of us are > just trying to get it together." > - Larry Wall, Programming Perl, 3rd Edition > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Moriyoshi Koizumi

23 years ago
Adam Dickmeiss <adam@indexdata.dk> wrote:
> Default or force:) Is it possible to use system wide libxml2 for > XML parsing in PHP? > What options should I use?
--with-bundle-libxml=[PATH] ? Moriyoshi

Adam Dickmeiss

23 years ago
On Sat, May 17, 2003 at 12:04:31AM +0900, Moriyoshi Koizumi wrote:
> Adam Dickmeiss <adam@indexdata.dk> wrote: > > > Default or force:) Is it possible to use system wide libxml2 for > > XML parsing in PHP? > > What options should I use? > > --with-bundle-libxml=[PATH] ?
Thanks. So, must use -with-bundled when I don't want that:) -- Adam
> > Moriyoshi > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Moriyoshi Koizumi

23 years ago
Adam Dickmeiss <adam@indexdata.dk> wrote:
> On Sat, May 17, 2003 at 12:04:31AM +0900, Moriyoshi Koizumi wrote: > > Adam Dickmeiss <adam@indexdata.dk> wrote: > > > > > Default or force:) Is it possible to use system wide libxml2 for > > > XML parsing in PHP? > > > What options should I use? > > > > --with-bundle-libxml=[PATH] ? > Thanks. So, must use -with-bundled when I don't want that:)
Right, possibly --with-libxml=bundled or whatever would make more sense? :) Moriyoshi

Adam Dickmeiss

23 years ago
On Sat, May 17, 2003 at 12:27:57AM +0900, Moriyoshi Koizumi wrote:
> Adam Dickmeiss <adam@indexdata.dk> wrote: > > > On Sat, May 17, 2003 at 12:04:31AM +0900, Moriyoshi Koizumi wrote: > > > Adam Dickmeiss <adam@indexdata.dk> wrote: > > > > > > > Default or force:) Is it possible to use system wide libxml2 for > > > > XML parsing in PHP? > > > > What options should I use? > > > > > > --with-bundle-libxml=[PATH] ? > > Thanks. So, must use -with-bundled when I don't want that:) > > Right, possibly --with-libxml=bundled or whatever would make more sense? :)
Yes. That would make much more sense, IMHO. -- Adam
> > Moriyoshi >
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Adam Dickmeiss

23 years ago
On Fri, May 16, 2003 at 05:16:09PM +0200, Adam Dickmeiss wrote:
> On Sat, May 17, 2003 at 12:04:31AM +0900, Moriyoshi Koizumi wrote: > > Adam Dickmeiss <adam@indexdata.dk> wrote: > > > > > Default or force:) Is it possible to use system wide libxml2 for > > > XML parsing in PHP? > > > What options should I use? > > > > --with-bundle-libxml=[PATH] ? > Thanks. So, must use -with-bundled when I don't want that:)
OK with '--with-apxs=/home/adam/proj/apache/bin/apxs' \ '--with-bundle-libxml=/usr' \ '--without-bundle-expat' \ '--with-zlib-dir=/usr' \ things worked and the libphp5.so went from 7.0 MB to 3.6 MB. zlib was needed when I didn't bundle. Why? Now, the first thing I notice is that xml_parser_create(encoding); using libxml works like xml_parser_create(""); using Expat as far as input encoding is concerned. So from that perspective BC is breaked with libxml. -- Adam
> -- Adam > > > > > Moriyoshi > > > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk > Index Data T: +45 33410100 Mob.: 212 212 66 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Sterling Hughes

23 years ago
On Fri, 2003-05-16 at 12:41, Adam Dickmeiss wrote:
> On Fri, May 16, 2003 at 05:16:09PM +0200, Adam Dickmeiss wrote: > > On Sat, May 17, 2003 at 12:04:31AM +0900, Moriyoshi Koizumi wrote: > > > Adam Dickmeiss <adam@indexdata.dk> wrote: > > > > > > > Default or force:) Is it possible to use system wide libxml2 for > > > > XML parsing in PHP? > > > > What options should I use? > > > > > > --with-bundle-libxml=[PATH] ? > > Thanks. So, must use -with-bundled when I don't want that:) > OK with > '--with-apxs=/home/adam/proj/apache/bin/apxs' \ > '--with-bundle-libxml=/usr' \ > '--without-bundle-expat' \ > '--with-zlib-dir=/usr' \ > things worked and the libphp5.so went from 7.0 MB to 3.6 MB. >
the size of libphp5, yes. The imprint probably didn't.
> zlib was needed when I didn't bundle. Why? >
Because that's how the authors of the domxml extension wanted it afaik. We could probably be fancier and check the libs that libxml2 was compiled with, and only require it as necessary.
> Now, the first thing I notice is that > xml_parser_create(encoding); using libxml > works like > xml_parser_create(""); using Expat > as far as input encoding is concerned. So from that > perspective BC is breaked with libxml. >
Err, that's not how it works in CVS at least: xml/compat.c - 279 parser->parser->encoding = xmlStrdup(encoding); -Sterling
> -- Adam > > > -- Adam > > > > > > > > Moriyoshi > > > > > > > > > > > > -- > > > PHP Internals - PHP Runtime Development Mailing List > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > > Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk > > Index Data T: +45 33410100 Mob.: 212 212 66 > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk > Index Data T: +45 33410100 Mob.: 212 212 66
-- "The three most dangerous things in the world are a programmer with a soldering iron, a hardware type with a program patch and a user with an idea." - Unknown

Sterling Hughes

23 years ago
On Fri, 2003-05-16 at 11:20, Sterling Hughes wrote:
> On Fri, 2003-05-16 at 12:41, Adam Dickmeiss wrote: > > On Fri, May 16, 2003 at 05:16:09PM +0200, Adam Dickmeiss wrote: > > > On Sat, May 17, 2003 at 12:04:31AM +0900, Moriyoshi Koizumi wrote: > > > > Adam Dickmeiss <adam@indexdata.dk> wrote: > > > > > > > > > Default or force:) Is it possible to use system wide libxml2 for > > > > > XML parsing in PHP? > > > > > What options should I use? > > > > > > > > --with-bundle-libxml=[PATH] ? > > > Thanks. So, must use -with-bundled when I don't want that:) > > OK with > > '--with-apxs=/home/adam/proj/apache/bin/apxs' \ > > '--with-bundle-libxml=/usr' \ > > '--without-bundle-expat' \ > > '--with-zlib-dir=/usr' \ > > things worked and the libphp5.so went from 7.0 MB to 3.6 MB. > > > > the size of libphp5, yes. The imprint probably didn't.
memory imprint probably didn't change is what i meant to say. -Sterling
-- "The three most dangerous things in the world are a programmer with a soldering iron, a hardware type with a program patch and a user with an idea." - Unknown

Adam Dickmeiss

23 years ago
On Fri, May 16, 2003 at 11:20:53AM -0400, Sterling Hughes wrote:
> On Fri, 2003-05-16 at 12:41, Adam Dickmeiss wrote: > > On Fri, May 16, 2003 at 05:16:09PM +0200, Adam Dickmeiss wrote: > > > On Sat, May 17, 2003 at 12:04:31AM +0900, Moriyoshi Koizumi wrote: > > > > Adam Dickmeiss <adam@indexdata.dk> wrote: > > > > > > > > > Default or force:) Is it possible to use system wide libxml2 for > > > > > XML parsing in PHP? > > > > > What options should I use? > > > > > > > > --with-bundle-libxml=[PATH] ? > > > Thanks. So, must use -with-bundled when I don't want that:) > > OK with > > '--with-apxs=/home/adam/proj/apache/bin/apxs' \ > > '--with-bundle-libxml=/usr' \ > > '--without-bundle-expat' \ > > '--with-zlib-dir=/usr' \ > > things worked and the libphp5.so went from 7.0 MB to 3.6 MB. > > > > the size of libphp5, yes. The imprint probably didn't.
I'm not an expert in this issue. Again, the real problem for me is that YAZ uses /usr/lib/libxml2.so and if PHP has its own version, two copies of a relatively big library is loaded twice (bundled and system wide).
> > zlib was needed when I didn't bundle. Why? > > > > Because that's how the authors of the domxml extension wanted it afaik. > We could probably be fancier and check the libs that libxml2 was > compiled with, and only require it as necessary.
OK.
> > Now, the first thing I notice is that > > xml_parser_create(encoding); using libxml > > works like > > xml_parser_create(""); using Expat > > as far as input encoding is concerned. So from that > > perspective BC is breaked with libxml. > > > > Err, that's not how it works in CVS at least: > > xml/compat.c - 279 > > parser->parser->encoding = xmlStrdup(encoding);
Yes. That's what it does . Question is, what it means for libxml2. Does it mean input encoding? Are you allowed to tamper with the encoding member in the parser struct at all? It could be that the encoding is _set_ by libxml2 to hold the actual encoding of the XML record.. We should check the libxml doc. I also noticed another issue with libxml. xml_parser_create fails for an XML record using UTF-16 encoding. That's even more strange, because libxml does support it. At least xmllint (part of libxml2) does not reject the XML file itself. -- Adam
> -Sterling > > > -- Adam > > > > > -- Adam > > > > > > > > > > > Moriyoshi > > > > > > > > > > > > > > > > -- > > > > PHP Internals - PHP Runtime Development Mailing List > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > > > Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk > > > Index Data T: +45 33410100 Mob.: 212 212 66 > > > > > > -- > > > PHP Internals - PHP Runtime Development Mailing List > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > > Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk > > Index Data T: +45 33410100 Mob.: 212 212 66 > -- > "The three most dangerous things in the world are a programmer > with a soldering iron, a hardware type with a program patch and > a user with an idea." > - Unknown
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Jani Taskinen

23 years ago
On Fri, 16 May 2003, Adam Dickmeiss wrote:
>On Fri, May 16, 2003 at 11:20:53AM -0400, Sterling Hughes wrote: >> On Fri, 2003-05-16 at 12:41, Adam Dickmeiss wrote: >> > On Fri, May 16, 2003 at 05:16:09PM +0200, Adam Dickmeiss wrote: >> > > On Sat, May 17, 2003 at 12:04:31AM +0900, Moriyoshi Koizumi wrote: >> > > > Adam Dickmeiss <adam@indexdata.dk> wrote: >> > > > >> > > > > Default or force:) Is it possible to use system wide libxml2 for >> > > > > XML parsing in PHP? >> > > > > What options should I use? >> > > > >> > > > --with-bundle-libxml=[PATH] ? >> > > Thanks. So, must use -with-bundled when I don't want that:) >> > OK with >> > '--with-apxs=/home/adam/proj/apache/bin/apxs' \ >> > '--with-bundle-libxml=/usr' \ >> > '--without-bundle-expat' \ >> > '--with-zlib-dir=/usr' \ >> > things worked and the libphp5.so went from 7.0 MB to 3.6 MB. >> > >> >> the size of libphp5, yes. The imprint probably didn't. >I'm not an expert in this issue. Again, the real problem for >me is that YAZ uses /usr/lib/libxml2.so and if PHP has >its own version, two copies of a relatively big library >is loaded twice (bundled and system wide).
Yet another reason NOT to bundle libxml.. --Jani

Adam Dickmeiss

23 years ago
On Fri, May 16, 2003 at 07:00:32PM +0200, Adam Dickmeiss wrote:
> On Fri, May 16, 2003 at 11:20:53AM -0400, Sterling Hughes wrote:
[snip]
> > Err, that's not how it works in CVS at least: > > > > xml/compat.c - 279 > > > > parser->parser->encoding = xmlStrdup(encoding); > Yes. That's what it does . Question is, what it means > for libxml2. Does it mean input encoding? Are you allowed > to tamper with the encoding member in the parser struct at all? > It could be that the encoding is _set_ by libxml2 to hold > the actual encoding of the XML record.. We should check > the libxml doc. > > I also noticed another issue with libxml. xml_parser_create > fails for an XML record using UTF-16 encoding. That's > even more strange, because libxml does support it. At least xmllint > (part of libxml2) does not reject the XML file itself.
I looked at this issue a little, and I think that libxml refuses to decode UTF-16 files (in compat.c) is due to the fact xmlCreatePushParserCtxt is not called with the leading 4 bytes of the XML file. So my thought was that maybe it's best to defer calling that function until XML_Parse is called the first time. XML_ParserCreate_MM would just do parser->parser = 0; to indicate that parser context is not yet there. I don't supply a patch, since it doesn't yet work. If anybody has input on this issue that'd be nice. -- Adam

Moriyoshi Koizumi

23 years ago
Could you try the attached patch and see if it works? Moriyoshi Adam Dickmeiss <adam@indexdata.dk> wrote:

Moriyoshi Koizumi

23 years ago
Adam Dickmeiss <adam@indexdata.dk> wrote:
> Now, the first thing I notice is that > xml_parser_create(encoding); using libxml > works like > xml_parser_create(""); using Expat > as far as input encoding is concerned. So from that > perspective BC is breaked with libxml. >
IMO, libxml SAX support will never be fully compatible with the current implementation and we'd better prepare a whole new SAX interface for libxml. Moriyoshi

Sterling Hughes

23 years ago
On Fri, 2003-05-16 at 12:52, Moriyoshi Koizumi wrote:
> Adam Dickmeiss <adam@indexdata.dk> wrote: > > > Now, the first thing I notice is that > > xml_parser_create(encoding); using libxml > > works like > > xml_parser_create(""); using Expat > > as far as input encoding is concerned. So from that > > perspective BC is breaked with libxml. > > > > IMO, libxml SAX support will never be fully compatible with the current > implementation and we'd better prepare a whole new SAX interface for > libxml.
That's not true. It will never be 100% compatible, yes. There are certainly some features that we might have to place on top of libxml2. But a reasonable 99% can be implemented (what's in CVS still needs a bit of work, I had a better subset before I reimplemented it as a C compat layer.) As far as forwards compatibility, we can also add new features that libxml2 supports and expat doesn't with '#ifdef's and a warning saying: "You are using the deprecated expat library, if you want this feature use libxml2". Just because the API libxml2 doesn't map 1-1 with expat. Doesn't mean we shouldn't be as BC as possible. -Sterling
-- "Programming today is a race between software engineers stirring to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Unknown

Moriyoshi Koizumi

23 years ago
Sterling Hughes <sterling@bumblebury.com> wrote:
> > IMO, libxml SAX support will never be fully compatible with the current > > implementation and we'd better prepare a whole new SAX interface for > > libxml. > > That's not true. It will never be 100% compatible, yes. There are > certainly some features that we might have to place on top of libxml2. > But a reasonable 99% can be implemented (what's in CVS still needs a bit > of work, I had a better subset before I reimplemented it as a C compat > layer.) > > As far as forwards compatibility, we can also add new features that > libxml2 supports and expat doesn't with '#ifdef's and a warning saying: > > "You are using the deprecated expat library, if you want this feature > use libxml2". > > Just because the API libxml2 doesn't map 1-1 with expat. Doesn't mean > we shouldn't be as BC as possible.
Sounds good, as I took much look into this BC issue and wondering if we have to be consistent on BC. I'd rather take advantage of libxml's better error handling. Moriyoshi

Moriyoshi Koizumi

23 years ago
Forgot to mention default_handler. How are you going to implement that feature with libxml? As far as I tried to, it seemed impossible at all to ensure full compatibility for it. Moriyoshi Moriyoshi Koizumi <moriyoshi@at.wakwak.com> wrote:

Adam Dickmeiss

23 years ago
On Fri, May 16, 2003 at 09:30:07AM -0400, Sterling Hughes wrote:
> On Fri, 2003-05-16 at 10:50, Adam Dickmeiss wrote: > > With PHP5 as of today, a "clean" configure - with just > > --with-apxs > > compiles PHP5 with a bundled libxml2. That can't be right? > > I have libxml2-dev installed. Do I really have to use > > --without-bundle-libxml > > to make a sane installation? > > > > Yep. We default to using the bundle, just like we do with expat, or > mysql, gd, or any other piece of software we bundle.
Ok, here we go again.. I still have not seen any good reason to bundle. You state at http://edwardbear.org/blog/ that libxml2 is bundled because expat is bundled. Is that the best argument? You want people to switch to a more "modern" interface. The new interface apparently breaks BC in multiple ways (that's not your fault, the tools are just different). How about unbundling expat and let people choose with configure what of those libs they want to use. That solution will both make configure for PHP easier to use _and_ save you from updating the bundled software (for security updates, for example). -- Adam
> -Sterling > > -- > "Reductionists like to take things apart. The rest of us are > just trying to get it together." > - Larry Wall, Programming Perl, 3rd Edition
-- Adam Dickmeiss mailto:adam@indexdata.dk http://www.indexdata.dk Index Data T: +45 33410100 Mob.: 212 212 66

Derick Rethans

23 years ago
On Fri, 16 May 2003, Adam Dickmeiss wrote:
> I still have not seen any good reason to bundle. You state at > http://edwardbear.org/blog/ that libxml2 is bundled because expat > is bundled. Is that the best argument? > > You want people to switch to a more "modern" interface. The > new interface apparently breaks BC in multiple ways (that's > not your fault, the tools are just different). How about unbundling > expat and let people choose with configure what of those > libs they want to use. That solution will both make configure > for PHP easier to use _and_ save you from updating the bundled > software (for security updates, for example).
I agree 100% (and if I'm not mistaken Sterling does too). Derick
-- "my other box is your windows PC" ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ International PHP Magazine http://php-mag.net/ -------------------------------------------------------------------------

Jani Taskinen

23 years ago
On Fri, 16 May 2003, Derick Rethans wrote:
>On Fri, 16 May 2003, Adam Dickmeiss wrote: > >> I still have not seen any good reason to bundle. You state at >> http://edwardbear.org/blog/ that libxml2 is bundled because expat >> is bundled. Is that the best argument? >> >> You want people to switch to a more "modern" interface. The >> new interface apparently breaks BC in multiple ways (that's >> not your fault, the tools are just different). How about unbundling >> expat and let people choose with configure what of those >> libs they want to use. That solution will both make configure >> for PHP easier to use _and_ save you from updating the bundled >> software (for security updates, for example). > >I agree 100% (and if I'm not mistaken Sterling does too).
At least he did agree in Amsterdam about it. :) Just unbundle everything and let people decided for themselves what they want to use.. --Jani

Sterling Hughes

23 years ago
On Fri, 2003-05-16 at 14:27, Adam Dickmeiss wrote:
> On Fri, May 16, 2003 at 09:30:07AM -0400, Sterling Hughes wrote: > > On Fri, 2003-05-16 at 10:50, Adam Dickmeiss wrote: > > > With PHP5 as of today, a "clean" configure - with just > > > --with-apxs > > > compiles PHP5 with a bundled libxml2. That can't be right? > > > I have libxml2-dev installed. Do I really have to use > > > --without-bundle-libxml > > > to make a sane installation? > > > > > > > Yep. We default to using the bundle, just like we do with expat, or > > mysql, gd, or any other piece of software we bundle. > Ok, here we go again.. > > I still have not seen any good reason to bundle. You state at > http://edwardbear.org/blog/ that libxml2 is bundled because expat > is bundled. Is that the best argument? > > You want people to switch to a more "modern" interface. The > new interface apparently breaks BC in multiple ways (that's > not your fault, the tools are just different). How about unbundling > expat and let people choose with configure what of those > libs they want to use. That solution will both make configure > for PHP easier to use _and_ save you from updating the bundled > software (for security updates, for example). >
Most of those ways can be fixed, the unfixables are relatively minor. As for unbundling, I've repeatedly said. Unbundle expat, and I'm fine with unbundling libxml2 (I speak only for myself though). The point is, if we only bundle expat, then expat becomes the defacto library, we can't deprecate it. People will develop both extensions and user space solutions for expat's functionality and expat doesn't currently doesn't come close to meeting our needs. -Sterling
-- "Science is like sex: sometimes something useful comes out, but that is not the reason we are doing it." - Richard Feynman

(Marcus Börger)

23 years ago
At 20:48 16.05.2003, Derick Rethans wrote:
>On Fri, 16 May 2003, Adam Dickmeiss wrote: > > > I still have not seen any good reason to bundle. You state at > > http://edwardbear.org/blog/ that libxml2 is bundled because expat > > is bundled. Is that the best argument? > > > > You want people to switch to a more "modern" interface. The > > new interface apparently breaks BC in multiple ways (that's > > not your fault, the tools are just different). How about unbundling > > expat and let people choose with configure what of those > > libs they want to use. That solution will both make configure > > for PHP easier to use _and_ save you from updating the bundled > > software (for security updates, for example).
The whole point is we must unbundle expat first because not doing that would make it hard to develop good xml support for PHP. Simply because the developers would use the bundled lib instead of the more sophisticaated external one. And that would result in keeping PHP a poor language compared to other scripting languages.
>I agree 100% (and if I'm not mistaken Sterling does too).
I talked with Sterling too and i guess Dericks is right. And after reading the above you may at least understand my problems with expat/libxml. marcus

Moriyoshi Koizumi

23 years ago
Adam Dickmeiss <adam@indexdata.dk> wrote:
> With PHP5 as of today, a "clean" configure - with just > --with-apxs > compiles PHP5 with a bundled libxml2. That can't be right? > I have libxml2-dev installed. Do I really have to use > --without-bundle-libxml > to make a sane installation?
Unless you specify either option, both libraries will be built and then libxml support will be preferred automatically. Moriyoshi