Use public Xapian API in preference#1018
Conversation
|
Duplicating the old version of the code seems clumsy, but I didn't see a way to combine the conditionals - obvious options such as this fail if I tested by appending an
|
|
It looks like the defacto requirement is at least Xapian 1.4.0 currently (since |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1018 +/- ##
=======================================
Coverage 56.18% 56.18%
=======================================
Files 101 101
Lines 4989 4989
Branches 2170 2170
=======================================
Hits 2803 2803
Misses 739 739
Partials 1447 1447 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
veloman-yunkan
left a comment
There was a problem hiding this comment.
I think it's safe to use XAPIAN_AT_LEAST unconditionally. You provided enough justification for doing so.
I also think that we can afford requiring a minimum version of 1.4.12 (or higher) for our Xapian dependency. Ubuntu 22.04 which is the oldest build platform we currently support across the Kiwix projects has 1.4.18.
@kelson42 Do you agree? Or libzim has to provide broader guarantees for backward compatibility compared to libkiwx?
I confirm |
OK, I'll update the patch. Should anyone want to try to build on an older Ubuntu, 20.04 has 1.4.14 packaged and I also provide a PPA with backports of recent Xapian releases which has xapian-core 1.4.22 for Ubuntu 16.04 and later: https://launchpad.net/~xapian/+archive/ubuntu/backports (Not sure why it lacks trusty (14.04) packages for xapian-core but has them for the others.) |
Xapian 1.4.12 and later have a Database::size() method which returns the number of shards, so use this instead which fixes a compilation failure with Xapian 2.0.x where the internal object is no longer a std::vector. This raises the Xapian version requirement to 1.4.12 (released 2019, available in Ubuntu 20.04 and later), which is now checked by meson.build (previously there wasn't a checked requirement but at least 1.4.0 was needed for e.g. Xapian::LatLongCoord).
c74e2d0 to
e3c39f7
Compare
Xapian 1.4.12 and later have a Database::size() method which returns the number of shards, so use this instead which fixes a compilation failure with Xapian 2.0.x where the internal object is no longer a std::vector.
For older versions, we still need to peek at the internal object but assuming internal details is less problematic there at least.