Skip to content

Commit

Permalink
Add compilation option to not use Compactor::FULLER.
Browse files Browse the repository at this point in the history
For some unknown reason, xapian compiled on Windows/meson crash when we
use this flag.

Let's allow us to deactivate this flag until we fix the root bug.
  • Loading branch information
mgautierfr committed Aug 15, 2024
1 parent de3401e commit bc65f30
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ else
private_conf.set('ENABLE_USE_MMAP', get_option('USE_MMAP'))
endif
private_conf.set('ENABLE_USE_BUFFER_HEADER', get_option('USE_BUFFER_HEADER'))
private_conf.set('ENABLE_XAPIAN_FULLER', get_option('with_xapian_fuller'))

static_linkage = get_option('static-linkage')
static_linkage = static_linkage or get_option('default_library')=='static'
Expand Down
2 changes: 2 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ option('tests', type : 'boolean', value : true,
description : 'Build the tests.')
option('with_xapian', type : 'boolean', value: true,
description: 'Build libzim with xapian support')
option('with_xapian_fuller', type: 'boolean', value: true,
description: 'Create xapian archive using "FULLER" compaction.\nThis is a workaround for a compilation issue on Windows. This will be removed soon')
option('test_data_dir', type : 'string', value: '',
description: 'Where the test data are. If not set, meson will use a internal directory in the build dir. If you want to download the data in the specified directory you can use `meson download_test_data`. As a special value, you can pass `none` to deactivate test using external test data.')
2 changes: 2 additions & 0 deletions src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#mesondefine ENABLE_XAPIAN

#mesondefine ENABLE_XAPIAN_FULLER

#mesondefine ENABLE_USE_MMAP

#mesondefine ENABLE_USE_BUFFER_HEADER
Expand Down
7 changes: 6 additions & 1 deletion src/writer/xapianIndexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ void XapianIndexer::indexTitle(const std::string& path, const std::string& title
void XapianIndexer::indexingPostlude()
{
this->writableDatabase.commit();
this->writableDatabase.compact(indexPath, Xapian::DBCOMPACT_SINGLE_FILE|Xapian::Compactor::FULLER);
#if defined ENABLE_XAPIAN_FULLER
auto flags = Xapian::DBCOMPACT_SINGLE_FILE|Xapian::Compactor::FULLER;
#else
auto flags = Xapian::DBCOMPACT_SINGLE_FILE;
#endif
this->writableDatabase.compact(indexPath, flags);
this->writableDatabase.close();
}

0 comments on commit bc65f30

Please sign in to comment.