From 8420dcb4747b29e61126303bd51827e259558b31 Mon Sep 17 00:00:00 2001 From: Kelson Date: Sun, 24 Nov 2019 07:37:39 -0500 Subject: [PATCH] Bump-up Xapian to 1.4.14 (#382) --- README.md | 2 +- appveyor/install_xapian.cmd | 8 ++--- kiwixbuild/dependencies/xapian.py | 7 ++-- kiwixbuild/patches/xapian_remote.patch | 47 ++++++++++++++++++++++++++ kiwixbuild/versions.py | 4 +-- 5 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 kiwixbuild/patches/xapian_remote.patch diff --git a/README.md b/README.md index 8cbbd92..2a48dcf 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Then, download and install kiwix-build and its dependencies: git clone https://github.com/kiwix/kiwix-build.git cd kiwix-build pip install . -hash -r # Refresh bash paths +hash -r # Refresh bash paths ``` If your distribution doesn't provide ninja version > 1.6 you can get it diff --git a/appveyor/install_xapian.cmd b/appveyor/install_xapian.cmd index 6e5d255..625310c 100644 --- a/appveyor/install_xapian.cmd +++ b/appveyor/install_xapian.cmd @@ -1,9 +1,9 @@ REM ======================================================== REM Install xapian -curl -fsSL -O http://download.kiwix.org/dev/xapian-core-1.4.10.zip || exit /b 1 -7z x xapian-core-1.4.10.zip || exit /b 1 -cd xapian-core-1.4.10 +curl -fsSL -O http://download.kiwix.org/dev/xapian-core-1.4.14.zip || exit /b 1 +7z x xapian-core-1.4.14.zip || exit /b 1 +cd xapian-core-1.4.14 mkdir build cd build -%MINGW64_RUN% "cd /c/Projects/kiwix-build/xapian-core-1.4.10/build && /c/Projects/kiwix-build/appveyor/build_xapian.sh" > build_xapian.log || exit /b 1 +%MINGW64_RUN% "cd /c/Projects/kiwix-build/xapian-core-1.4.14/build && /c/Projects/kiwix-build/appveyor/build_xapian.sh" > build_xapian.log || exit /b 1 cd ..\.. diff --git a/kiwixbuild/dependencies/xapian.py b/kiwixbuild/dependencies/xapian.py index 7b20b32..a9ec63f 100644 --- a/kiwixbuild/dependencies/xapian.py +++ b/kiwixbuild/dependencies/xapian.py @@ -12,11 +12,12 @@ class Xapian(Dependency): name = "xapian-core" class Source(ReleaseDownload): - archive = Remotefile('xapian-core-1.4.10.tar.xz', - '68669327e08544ac88fe3473745dbcae4e8e98d5060b436c4d566f1f78709bb8') + archive = Remotefile('xapian-core-1.4.14.tar.xz', + '975a7ac018c9d34a15cc94a3ecc883204403469f748907e5c4c64d0aec2e4949') patches = [ 'xapian_sys_types.patch', - 'xapian_fix_include_errno.patch' + 'xapian_fix_include_errno.patch', + 'xapian_remote.patch' ] class Builder(MakeBuilder): diff --git a/kiwixbuild/patches/xapian_remote.patch b/kiwixbuild/patches/xapian_remote.patch new file mode 100644 index 0000000..8e494ab --- /dev/null +++ b/kiwixbuild/patches/xapian_remote.patch @@ -0,0 +1,47 @@ +diff -ur xapian-core-1.4.14/matcher/multimatch.cc xapian-core-1.4.14.patched/matcher/multimatch.cc +--- xapian-core-1.4.14/matcher/multimatch.cc 2019-11-23 08:12:20.000000000 +0100 ++++ xapian-core-1.4.14.patched/matcher/multimatch.cc 2019-12-08 20:14:24.948683845 +0100 +@@ -441,9 +441,11 @@ + // number of matching documents which is higher than the number of + // documents it returns (because it wasn't asked for more documents). + Xapian::doccount definite_matches_not_seen = 0; ++#ifdef XAPIAN_HAS_REMOTE_BACKEND + // Track these for calculating uncollapsed_upper_bound for the local. + size_t n_remotes = 0; + Xapian::doccount remote_uncollapsed_upper_bound = 0; ++#endif + try { + for (size_t i = 0; i != leaves.size(); ++i) { + // Pick the highest total subqueries answer amongst the +@@ -453,6 +455,7 @@ + Xapian::termcount total_subqs_i = 0; + PostList* pl = leaves[i]->get_postlist(this, &total_subqs_i); + total_subqs = max(total_subqs, total_subqs_i); ++#ifdef XAPIAN_HAS_REMOTE_BACKEND + if (is_remote[i]) { + ++n_remotes; + RemoteSubMatch* rem_match = +@@ -469,6 +472,7 @@ + definite_matches_not_seen -= first + maxitems; + } + } ++#endif + postlists.push_back(pl); + } + } catch (...) { +@@ -950,6 +954,7 @@ + Xapian::doccount uncollapsed_lower_bound = matches_lower_bound; + Xapian::doccount uncollapsed_upper_bound = matches_upper_bound; + Xapian::doccount uncollapsed_estimated = matches_estimated; ++#ifdef XAPIAN_HAS_REMOTE_BACKEND + if (collapser && n_remotes) { + // We need to adjust uncollapsed_upper_bound if there are multiple + // shards and some or all are remote. The lower bound and estimate +@@ -971,6 +976,7 @@ + } + } + } ++#endif + if (items.size() < max_msize) { + // We have fewer items in the mset than we tried to get for it, so we + // must have all the matches in it. diff --git a/kiwixbuild/versions.py b/kiwixbuild/versions.py index df7da82..bac7619 100644 --- a/kiwixbuild/versions.py +++ b/kiwixbuild/versions.py @@ -42,13 +42,13 @@ release_versions = { # This is the "version" of the whole base_deps_versions dict. # Change this when you change base_deps_versions. -base_deps_meta_version = '55' +base_deps_meta_version = '57' base_deps_versions = { 'zlib' : '1.2.8', 'lzma' : '5.2.4', 'uuid' : '1.43.4', - 'xapian-core' : '1.4.10', + 'xapian-core' : '1.4.14', 'mustache' : '3.2', 'pugixml' : '1.2', 'libmicrohttpd' : '0.9.66',