Skip to content

Commit d13e4c2

Browse files
committed
sanity_checks: add global build options
Some projects need non-default options to avoid build failures, and are also frequent dependencies of other projects. Rather than adding "foo:tests=false" to all projects that depend on foo, allow specifying the option globally. Since we might want to disable foo tests only when foo is built as a dependency, ignore any global options that configure the project currently under test. Consolidate existing options for libxml2. Also disable building glib tests; 2.86.0 introduced a build failure on clang-cl, our glib CI already disables tests, and glib has a lot of them. Also drop an unneeded glib:sysprof=disabled in pango.
1 parent 2fdfd30 commit d13e4c2

File tree

3 files changed

+20
-27
lines changed

3 files changed

+20
-27
lines changed

ci_config.json

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"_comment": [
2+
"_comment_broken": [
33
"This is intentionally undocumented in README.md, do not use it.",
44
"Using it is an automatic CI error.",
55
"broken_linux, broken_windows and broken_darwin are lists of wraps that are known",
@@ -23,6 +23,15 @@
2323
"graphite2",
2424
"mocklibc"
2525
],
26+
"_comment_global": [
27+
"global_build_options are passed to every build except for the project",
28+
"they control; for example glib:tests=false is passed to every project",
29+
"except glib. This helps avoid irrelevant CI failures in dependencies."
30+
],
31+
"global_build_options": [
32+
"glib:tests=false",
33+
"libxml2:iconv=disabled"
34+
],
2635
"apache-orc": {
2736
"test_options": [
2837
"--timeout-multiplier=2"
@@ -92,13 +101,11 @@
92101
"cairo": {
93102
"_comment": [
94103
"- Force-enable fontconfig to avoid https://gitlab.freedesktop.org/cairo/cairo/-/issues/862",
95-
"- Prevent libxml2 from requiring iconv",
96104
"- fontconfig warns on v1 wraps; fixed in next release",
97105
"- Some tests fails and they are still run despite -Dtests=disabled"
98106
],
99107
"build_options": [
100-
"cairo:fontconfig=enabled",
101-
"libxml2:iconv=disabled"
108+
"cairo:fontconfig=enabled"
102109
],
103110
"fatal_warnings": false,
104111
"skip_tests": true
@@ -275,9 +282,6 @@
275282
"alpine_packages": [
276283
"bash"
277284
],
278-
"build_options": [
279-
"libxml2:iconv=disabled"
280-
],
281285
"fatal_warnings": false
282286
},
283287
"freeglut": {
@@ -323,7 +327,6 @@
323327
"- By default Glycin is mandatory on Linux",
324328
"- Disable man because it requires rst2man",
325329
"- Enable miscellaneous built-in loaders",
326-
"- glib tests don't build on clang-cl",
327330
"- Disable fatal warnings because of v1 wraps",
328331
"- Disable fatal warnings because of https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/merge_requests/156",
329332
"- Disable tests because one is broken: https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/215",
@@ -332,8 +335,7 @@
332335
"build_options": [
333336
"gdk-pixbuf:glycin=disabled",
334337
"gdk-pixbuf:man=false",
335-
"gdk-pixbuf:others=enabled",
336-
"glib:tests=false"
338+
"gdk-pixbuf:others=enabled"
337339
],
338340
"alpine_packages": [
339341
"shared-mime-info"
@@ -456,7 +458,6 @@
456458
],
457459
"fatal_warnings": false,
458460
"build_options": [
459-
"glib:tests=false",
460461
"harfbuzz:glib=enabled",
461462
"harfbuzz:gobject=enabled",
462463
"harfbuzz:freetype=enabled",
@@ -831,11 +832,6 @@
831832
"diffutils"
832833
]
833834
},
834-
"libxmlpp": {
835-
"build_options": [
836-
"libxml2:iconv=disabled"
837-
]
838-
},
839835
"libxkbcommon": {
840836
"build_options": [
841837
"libxkbcommon:enable-docs=false",
@@ -878,11 +874,6 @@
878874
"libx11-dev"
879875
]
880876
},
881-
"libxslt": {
882-
"build_options": [
883-
"libxml2:iconv=disabled"
884-
]
885-
},
886877
"libxv": {
887878
"_comment": "X11 needs a POSIX system",
888879
"build_on": {
@@ -1132,14 +1123,10 @@
11321123
},
11331124
"pango": {
11341125
"_comment": [
1135-
"- Avoid sysprof build errors on Windows",
11361126
"- fontconfig warns on v1 wraps; fixed in next release",
11371127
"- skip dependency checks for optionally provided dependencies",
11381128
"- Known test failure: https://gitlab.gnome.org/GNOME/pango/-/issues/682"
11391129
],
1140-
"build_options": [
1141-
"glib:sysprof=disabled"
1142-
],
11431130
"fatal_warnings": false,
11441131
"skip_dependency_check": [
11451132
"pangoft2",

tools/sanity_checks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ def check_new_release(self, name: str, builddir: str = '_build', deps=None, prog
448448
fatal_warnings = ci.get('fatal_warnings', expect_working) and self.fatal_warnings
449449
if fatal_warnings:
450450
options.append('--fatal-meson-warnings')
451-
options += [f'-D{o}' for o in ci.get('build_options', [])]
451+
options += self.ci_config.get_option_arguments(name)
452452
if Path(builddir, 'meson-private', 'cmd_line.txt').exists():
453453
options.append('--wipe')
454454
meson_env = self.install_packages(ci)
@@ -746,7 +746,7 @@ def get_meson_version_deps(self, name: str, builddir: str, wrap: configparser.Co
746746
version_request += '.0'
747747

748748
options = ['-Dpython.install_env=auto', f'-Dwraps={name}']
749-
options += [f'-D{o}' for o in ci.get('build_options', [])]
749+
options += self.ci_config.get_option_arguments(name)
750750
try:
751751
subprocess.check_call(
752752
['meson', 'rewrite', 'kwargs', 'set', 'project', '/', 'meson_version', '>=0'],

tools/utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ def broken(self) -> list[str]:
169169
system = platform.system().lower()
170170
return T.cast('list[str]', self.get(f'broken_{system}', []))
171171

172+
def get_option_arguments(self, name: str) -> list[str]:
173+
global_opts = T.cast('list[str]', self.get('global_build_options', []))
174+
opts = [o for o in global_opts if not o.startswith(f'{name}:')]
175+
opts += self.get(name, {}).get('build_options', [])
176+
return [f'-D{o}' for o in opts]
177+
172178
def wrap_path(name: str) -> Path:
173179
return Path('subprojects', f'{name}.wrap')
174180

0 commit comments

Comments
 (0)