Re: [PATCH] update zlib to 1.2.8
On 2014/12/23 22:54, Timo Myyrä wrote: I was trying to port notmuch mail indexer but got little stuck with it as it requires newer Zlib version than whats in base. I got little spare time in my hands and here's a rough patch which updates the base libz 1.2.3 to version 1.2.8. So far I've only compiled the library itself and tried it with notmuch on my amd64. This diff removes our local changes, most of which relate to saving space on ramdisks, we still need these. Note that there are two main copies of libz (lib/libz and sys/lib/libz) to keep in sync. (there are also other copies in Perl and cvs, I'm not sure whether they are used or not). I prepared an update to 1.2.6 before (my method was to diff the two upstream versions and apply that to our tree, resolving conflicts by hand, so as not to lose local changes), but as the reaction was less than positive I didn't go as far as updating the kernel copy.
Re: [PATCH] update zlib to 1.2.8
Updating zlib correctly is surprisingly difficult. It's not just a question of whipping out the new version and doing a diff. You should make tests. Like, you missed the #ifdef SMALL at first. Those tests include making a full release, and making sure it still works. It's also likely some of those local diffs are there for some specific architectures. If you don't have them, you have to ask for tests. I'm not saying it's not doable. But the fact you don't see the newer zlib in our tree kind-of indicates it takes quite a bit more testing than you would think.
Re: [PATCH] update zlib to 1.2.8
Stuart Henderson st...@openbsd.org writes: On 2014/12/23 22:54, Timo Myyrä wrote: I was trying to port notmuch mail indexer but got little stuck with it as it requires newer Zlib version than whats in base. I got little spare time in my hands and here's a rough patch which updates the base libz 1.2.3 to version 1.2.8. So far I've only compiled the library itself and tried it with notmuch on my amd64. This diff removes our local changes, most of which relate to saving space on ramdisks, we still need these. Yeah, I noticed few of them but missed quite lot of others. I'll be more careful in the future. Note that there are two main copies of libz (lib/libz and sys/lib/libz) to keep in sync. (there are also other copies in Perl and cvs, I'm not sure whether they are used or not). Seems that the update isn't as trivial as I initially thought. I prepared an update to 1.2.6 before (my method was to diff the two upstream versions and apply that to our tree, resolving conflicts by hand, so as not to lose local changes), but as the reaction was less than positive I didn't go as far as updating the kernel copy. That would be clearer, no need to figure out which change was due to version update and which is local change. Timo
Re: [PATCH] update zlib to 1.2.8
Marc Espie es...@nerim.net writes: Updating zlib correctly is surprisingly difficult. It's not just a question of whipping out the new version and doing a diff. You should make tests. Like, you missed the #ifdef SMALL at first. Those tests include making a full release, and making sure it still works. It's also likely some of those local diffs are there for some specific architectures. If you don't have them, you have to ask for tests. I'm not saying it's not doable. But the fact you don't see the newer zlib in our tree kind-of indicates it takes quite a bit more testing than you would think. Yes, I did lazy version first. Crude diff and just tested my own case. Idea was to get a little feedback to see if I'm heading in the right direction. Obviously diff to update all the zlib would require full release build with and without SMALL defined to cover the alternatives. Also with different architectures to cover any arch-specific issues. My original idea was to get notmuch working but as pointed out, it was trivially patched to work with base version. Timo
Re: [PATCH] update zlib to 1.2.8
On Tue, Dec 23, 2014 at 10:54:15PM +0200, Timo Myyrä wrote: I was trying to port notmuch mail indexer but got little stuck with it as it requires newer Zlib version than whats in base. It is easy to patch notmuch, the requirement is rather silly. FYI. Joerg
Re: [PATCH] update zlib to 1.2.8
Hi, There's some value in having a newer zlib release. There have been bugfixes, documentation fixes, various improvements, and API additions. I'm not sure how much is backported to the OpenBSD zlib, but a quick glance through your attached patch suggests there's stuff that would be nice to have. Do note your patch does revert some OpenBSD-local changes to zlib. You should diff the older zlib release with the OpenBSD zlib to see what they are and try to preserve them when rebasing on the latest zlib release. But if you read the patch to 1.2.8 carefully, you would also notice a good deal of added portability code. Nothing too exciting has happened in the zlib world the past decade, except the addition of more portability to support even more awful systems. It's basically the OpenSSL approach to portability gone worse. Not all of it is worth having, some of it is undesirable. I think it's a better idea to go through the patch manually and pick out the desirable changes and apply them. Or, as Joerg suggests, just patch the port to be compatible with older zlib releases if possible. Recently I got fed up with the awful code quality of upsteam zlib, so I fetched 1.2.8 and removed support for awful systems line by line, converting it to nice standard C, not zlib-C. The result was a great deal simpler and the process revealed a great deal of horrors. You just need to open a random file to find them. Jonas