-
-
Notifications
You must be signed in to change notification settings - Fork 64
Properly handle libicu in Meson #1015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
kelson42
commented
Oct 27, 2025
- Fix handling of libicu 76+
- Simplify a bit the handling of all deps
meson.build
Outdated
| all_deps = [thread_dep, xapian_dep, lzma_dep, zstd_dep, win_deps] | ||
|
|
||
| # Dependencies as array | ||
| all_deps += libicu_deps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libicu_deps → icu_deps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| endif | ||
|
|
||
| # Dependencies as string | ||
| all_deps = [thread_dep, xapian_dep, lzma_dep, zstd_dep, win_deps] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xapian_dep must be included conditionally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already conditional because empty if not requested.
| if xapian_dep.found() | ||
| icu_dep = dependency('icu-i18n', static:static_linkage) | ||
| if icu_dep.version().version_compare('>= 76') | ||
| icu_dep = [icu_dep, dependency('icu-uc', static:static_linkage)] | ||
| icu_deps = [icu_dep, dependency('icu-uc', static:static_linkage)] | ||
| else | ||
| icu_deps = [icu_dep] | ||
| endif | ||
| else | ||
| icu_dep = dependency('icu-i18n', 'required:false', static:static_linkage) | ||
| if icu_dep.version().version_compare('>= 76') | ||
| icu_dep = [icu_dep, dependency('icu-uc', 'required:false', static:static_linkage)] | ||
| icu_deps = [icu_dep, dependency('icu-uc', 'required:false', static:static_linkage)] | ||
| else | ||
| icu_deps = [icu_dep] | ||
| endif | ||
| endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we can avoid the duplication between the positive and negative branches of this if, by introducing a variable icu_dep_is_required = xapian_dep.found()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done it differently but the idea is the same: simplification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But your change works differently. Before, if xapian was not found, icu participated as an optional dependency, whereas now in that case it is simply skipped.
|
@veloman-yunkan Sorry, I was not over |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1015 +/- ##
==========================================
- Coverage 58.13% 56.18% -1.96%
==========================================
Files 101 101
Lines 5384 4989 -395
Branches 2197 2170 -27
==========================================
- Hits 3130 2803 -327
+ Misses 795 739 -56
+ Partials 1459 1447 -12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| if target_machine.system() == 'freebsd' | ||
| deps += [execinfo_dep] | ||
| endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable deps was replaced with all_deps and could have been deleted altogether, however this piece of code means that something was overlooked
| if xapian_dep.found() | ||
| icu_dep = dependency('icu-i18n', static:static_linkage) | ||
| if icu_dep.version().version_compare('>= 76') | ||
| icu_dep = [icu_dep, dependency('icu-uc', static:static_linkage)] | ||
| icu_deps = [icu_dep, dependency('icu-uc', static:static_linkage)] | ||
| else | ||
| icu_deps = [icu_dep] | ||
| endif | ||
| else | ||
| icu_dep = dependency('icu-i18n', 'required:false', static:static_linkage) | ||
| if icu_dep.version().version_compare('>= 76') | ||
| icu_dep = [icu_dep, dependency('icu-uc', 'required:false', static:static_linkage)] | ||
| icu_deps = [icu_dep, dependency('icu-uc', 'required:false', static:static_linkage)] | ||
| else | ||
| icu_deps = [icu_dep] | ||
| endif | ||
| endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But your change works differently. Before, if xapian was not found, icu participated as an optional dependency, whereas now in that case it is simply skipped.