From 4a1e35f62473809f2976a4435e57494da9ec94df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Mon, 3 May 2021 15:50:48 +0200 Subject: [PATCH 1/5] 2.12.1 bump --- .gitignore | 2 ++ ...-E3F42FCE156830A80358E6E94FD1AEC3365AF7BF.gpg | Bin 0 -> 2895 bytes libmodulemd.spec | 9 ++++++++- sources | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 gpgkey-E3F42FCE156830A80358E6E94FD1AEC3365AF7BF.gpg diff --git a/.gitignore b/.gitignore index fc15bef..3dc62ef 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,5 @@ /modulemd-2.11.1.tar.xz /modulemd-2.11.2.tar.xz /modulemd-2.12.0.tar.xz +/modulemd-2.12.1.tar.xz +/modulemd-2.12.1.tar.xz.asc diff --git a/gpgkey-E3F42FCE156830A80358E6E94FD1AEC3365AF7BF.gpg b/gpgkey-E3F42FCE156830A80358E6E94FD1AEC3365AF7BF.gpg new file mode 100644 index 0000000000000000000000000000000000000000..3cbbce4a35934919221753bbf487140def1ea837 GIT binary patch literal 2895 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 0.47 BuildRequires: pkgconfig BuildRequires: gcc @@ -92,6 +95,7 @@ Development files for libmodulemd. %prep +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %autosetup -p1 -n modulemd-%{version} @@ -163,6 +167,9 @@ mv %{buildroot}%{_mandir}/man1/modulemd-validator.1 \ %changelog +* Mon May 03 2021 Petr Pisar - 2.12.1-1 +- 2.12.1 bump + * Thu Jan 14 2021 Stephen Gallagher - 2.12.0-1 - Add support for 'buildorder' to Packager documents diff --git a/sources b/sources index 2ae70ad..9e0fc7c 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (modulemd-2.12.0.tar.xz) = 8dda8bf92a0e1ad4578bf15099443bc1ef42b4a0609a635b2e7a885c878994ce64c1670ffb75ab566ac6ce08f87e0b2807149d08fe3b701abd0ef4a4a9569f88 +SHA512 (modulemd-2.12.1.tar.xz) = 2bd4242f0f1aea561a5b899678237f7390652987e02c46652b72eadebde60d7cfb82d93e0a720e3c070261a7449245b9319b9fd755aba1c6f354660a959373b3 +SHA512 (modulemd-2.12.1.tar.xz.asc) = 072141c83a991ac7f1177d2e3ccf2b050c2d644453c5e815ad826b8fe4a994954d0754c9da5279727ccc74f182c193f89d5f227ff0580b0a8ab3e730ab52b287 From d34f5e308549b246d9b779c71ad040bc6d37cf8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Thu, 6 May 2021 13:27:49 +0200 Subject: [PATCH 2/5] Correct source addresses 2.12.1 was released from "2.12.1" tag. Also document a source of the PGP keyring as required by the packaging guidelines. --- libmodulemd.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmodulemd.spec b/libmodulemd.spec index 7b76475..c89e9a9 100644 --- a/libmodulemd.spec +++ b/libmodulemd.spec @@ -19,8 +19,9 @@ Summary: Module metadata manipulation library License: MIT URL: https://github.com/fedora-modularity/libmodulemd -Source0: %{url}/releases/download/%{upstream_name}-%{version}/modulemd-%{version}.tar.xz -Source1: %{url}/releases/download/%{upstream_name}-%{version}/modulemd-%{version}.tar.xz.asc +Source0: %{url}/releases/download/%{version}/modulemd-%{version}.tar.xz +Source1: %{url}/releases/download/%{version}/modulemd-%{version}.tar.xz.asc +# Key exported from Petr Pisar's keyring Source2: gpgkey-E3F42FCE156830A80358E6E94FD1AEC3365AF7BF.gpg BuildRequires: gnupg2 From dbc1d733ff7fa5386418cf82408cc64b93c7e536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 11 May 2021 11:31:20 +0200 Subject: [PATCH 3/5] Document licenses --- libmodulemd.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libmodulemd.spec b/libmodulemd.spec index c89e9a9..7c839a5 100644 --- a/libmodulemd.spec +++ b/libmodulemd.spec @@ -17,6 +17,10 @@ Version: 2.12.1 Release: 1%{?dist} Summary: Module metadata manipulation library +# COPYING: MIT +## not in any binary package +# contrib/coverity-modeling.c: GPLv2+ +# contrib/release-tools/semver: GPLv3 License: MIT URL: https://github.com/fedora-modularity/libmodulemd Source0: %{url}/releases/download/%{version}/modulemd-%{version}.tar.xz From 6e7f014a6c904d9c6e214c2af6c9b78fa49745b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Fri, 9 Jul 2021 13:28:12 +0200 Subject: [PATCH 4/5] 2.13.0 bump --- .gitignore | 2 ++ libmodulemd.spec | 64 ++++++++++++++++++++++++++++-------------------- sources | 4 +-- 3 files changed, 41 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 3dc62ef..2d27b90 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,5 @@ /modulemd-2.12.0.tar.xz /modulemd-2.12.1.tar.xz /modulemd-2.12.1.tar.xz.asc +/modulemd-2.13.0.tar.xz +/modulemd-2.13.0.tar.xz.asc diff --git a/libmodulemd.spec b/libmodulemd.spec index 7c839a5..3362c47 100644 --- a/libmodulemd.spec +++ b/libmodulemd.spec @@ -1,9 +1,12 @@ %if 0%{?rhel} && 0%{?rhel} <= 7 - %global meson_python_flags -Dwith_py2=true + # There is no python3-gobject-base in RHEL 7. But it exists in EPEL 7. + %global meson_python_flags -Dwith_py2=true -Dwith_py3=true %global build_python2 1 + %global build_python3 1 %else - %global meson_python_flags -Dwith_py2=false + %global meson_python_flags -Dwith_py2=false -Dwith_py3=true %global build_python2 0 + %global build_python3 1 %endif %global upstream_name libmodulemd @@ -13,7 +16,7 @@ %endif Name: %{upstream_name}%{?v2_suffix} -Version: 2.12.1 +Version: 2.13.0 Release: 1%{?dist} Summary: Module metadata manipulation library @@ -44,8 +47,10 @@ BuildRequires: file-devel BuildRequires: python2-devel BuildRequires: python-gobject-base %endif +%if %{build_python3} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-gobject-base +%endif BuildRequires: help2man @@ -53,37 +58,38 @@ BuildRequires: help2man %description -C Library for manipulating module metadata files. +C library for manipulating module metadata files. See https://github.com/fedora-modularity/libmodulemd/blob/master/README.md for more details. %if %{build_python2} %package -n python2-%{name} -Summary: Python 2 bindings for %{name} -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: python-gobject-base -Requires: python-six +Summary: Python 2 bindings for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: python-gobject-base +Requires: python-six %description -n python2-%{name} -Python 2 bindings for %{name} +Python 2 bindings for %{name}. %endif +%if %{build_python3} %package -n python%{python3_pkgversion}-%{name} -Summary: Python 3 bindings for %{name} -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: python%{python3_pkgversion}-gobject-base - +Summary: Python 3 bindings for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: python%{python3_pkgversion}-gobject-base %if (0%{?rhel} && 0%{?rhel} <= 7) # The py3_dist macro on EPEL 7 doesn't work right at the moment -Requires: python3.6dist(six) +Requires: python3.6dist(six) %else -Requires: %{py3_dist six} +Requires: %{py3_dist six} %endif %description -n python%{python3_pkgversion}-%{name} -Python %{python3_pkgversion} bindings for %{name} +Python %{python3_pkgversion} bindings for %{name}. +%endif %package devel @@ -96,7 +102,7 @@ Conflicts: libmodulemd-devel %description devel -Development files for libmodulemd. +Development files for %{name}. %prep @@ -105,22 +111,21 @@ Development files for libmodulemd. %build -%meson -Ddeveloper_build=false \ - %{meson_python_flags} - +%meson \ + -Dlibmagic=enabled \ + -Drpmio=enabled \ + -Dskip_introspection=false \ + -Dtest_installed_lib=false \ + -Dwith_docs=true \ + -Dwith_manpages=enabled \ + %{meson_python_flags} %meson_build %check - export LC_CTYPE=C.utf8 - -# Don't run tests on ARM for now. There are problems with -# performance on the builders and often these time out. -%ifnarch %{arm} aarch64 # The tests sometimes time out in CI, so give them a little extra time %{__meson} test -C %{_vpath_builddir} %{?_smp_mesonflags} --print-errorlogs -t 5 -%endif %install @@ -142,7 +147,7 @@ mv %{buildroot}%{_mandir}/man1/modulemd-validator.1 \ %files %license COPYING -%doc README.md +%doc NEWS README.md %{_bindir}/modulemd-validator%{?v2_suffix} %{_mandir}/man1/modulemd-validator%{?v2_suffix}.1* %{_libdir}/%{upstream_name}.so.2* @@ -167,11 +172,16 @@ mv %{buildroot}%{_mandir}/man1/modulemd-validator.1 \ %endif +%if %{build_python3} %files -n python%{python3_pkgversion}-%{name} %{python3_sitearch}/gi/overrides/ +%endif %changelog +* Fri Jul 09 2021 Petr Pisar - 2.13.0-1 +- 2.13.0 bump + * Mon May 03 2021 Petr Pisar - 2.12.1-1 - 2.12.1 bump diff --git a/sources b/sources index 9e0fc7c..4fa392a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (modulemd-2.12.1.tar.xz) = 2bd4242f0f1aea561a5b899678237f7390652987e02c46652b72eadebde60d7cfb82d93e0a720e3c070261a7449245b9319b9fd755aba1c6f354660a959373b3 -SHA512 (modulemd-2.12.1.tar.xz.asc) = 072141c83a991ac7f1177d2e3ccf2b050c2d644453c5e815ad826b8fe4a994954d0754c9da5279727ccc74f182c193f89d5f227ff0580b0a8ab3e730ab52b287 +SHA512 (modulemd-2.13.0.tar.xz) = b2a4fa4120d4dca714ef724a9e8f805d4f8a306a950e670f86f6184467c070ddb93360fff3bb079eb3a442b52024fe796ceb1195800d62bbb1f5cb67f8889e05 +SHA512 (modulemd-2.13.0.tar.xz.asc) = f588c1333b91db297ab5ec7e67f1d62884d4f58032a75feed1b3c3ff2ae67eb0f13a4209605f4a32d00fe6ccb3561b6fab81c2196f1d4439222b0e141f541ff6 From 64e8d6e6a66e16b01b038e2486086d52faacea25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 14 Sep 2021 14:32:10 +0200 Subject: [PATCH 5/5] Accept an invalid buildorder 18446744073709551615 found in RHEL 8 repositories --- libmodulemd.spec | 18 +- ...73709551615-buildorder-if-accept_ove.patch | 192 ++++++++++++++++++ tests/tests.yml | 2 +- 3 files changed, 210 insertions(+), 2 deletions(-) create mode 100644 modulemd-2.13.0-Accept-18446744073709551615-buildorder-if-accept_ove.patch diff --git a/libmodulemd.spec b/libmodulemd.spec index 3362c47..c6994d5 100644 --- a/libmodulemd.spec +++ b/libmodulemd.spec @@ -9,6 +9,13 @@ %global build_python3 1 %endif +%if (0%{?fedora} && 0%{?fedora} <= 50) || (0%{?rhel} && 0%{?rhel} <= 10) + # Support RHEL 8 module builds with an invalid buildorder. + %global meson_accept_overflowed_buildorder_flag -Daccept_overflowed_buildorder=true +%else + %global meson_accept_overflowed_buildorder_flag -Daccept_overflowed_buildorder=false +%endif + %global upstream_name libmodulemd %if (0%{?rhel} && 0%{?rhel} <= 7) @@ -17,7 +24,7 @@ Name: %{upstream_name}%{?v2_suffix} Version: 2.13.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Module metadata manipulation library # COPYING: MIT @@ -30,6 +37,10 @@ Source0: %{url}/releases/download/%{version}/modulemd-%{version}.tar.xz Source1: %{url}/releases/download/%{version}/modulemd-%{version}.tar.xz.asc # Key exported from Petr Pisar's keyring Source2: gpgkey-E3F42FCE156830A80358E6E94FD1AEC3365AF7BF.gpg +# Accept invalid, but existing buildorder 18446744073709551615 when loading +# modulemd-v2 documents, bug #1984402, , +# in upstream after 2.13.0 +Patch0: modulemd-2.13.0-Accept-18446744073709551615-buildorder-if-accept_ove.patch BuildRequires: gnupg2 BuildRequires: meson >= 0.47 @@ -112,6 +123,7 @@ Development files for %{name}. %build %meson \ + %{meson_accept_overflowed_buildorder_flag} \ -Dlibmagic=enabled \ -Drpmio=enabled \ -Dskip_introspection=false \ @@ -179,6 +191,10 @@ mv %{buildroot}%{_mandir}/man1/modulemd-validator.1 \ %changelog +* Tue Sep 14 2021 Petr Pisar - 2.13.0-2 +- Accept an invalid buildorder 18446744073709551615 found in RHEL 8 repositories + (https://pagure.io/koji/issue/3025) + * Fri Jul 09 2021 Petr Pisar - 2.13.0-1 - 2.13.0 bump diff --git a/modulemd-2.13.0-Accept-18446744073709551615-buildorder-if-accept_ove.patch b/modulemd-2.13.0-Accept-18446744073709551615-buildorder-if-accept_ove.patch new file mode 100644 index 0000000..2e54628 --- /dev/null +++ b/modulemd-2.13.0-Accept-18446744073709551615-buildorder-if-accept_ove.patch @@ -0,0 +1,192 @@ +From b0dd663edd6ab66ec26c48ff34a52afa040694e6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Thu, 22 Jul 2021 15:23:55 +0200 +Subject: [PATCH] Accept 18446744073709551615 buildorder if + accept_overflowed_buildorder build boolean is true +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +7c0158bcec05b692d27e37ff46a134f4e294d957 commit (Reject invalid signed +integers (rpm buildorder), as found in 2.13.0 release, fortified +parsing signed integers. + +It turned out that RHEL 8 delivers a few modules: + +container-tools:rhel8:8020120200601155013:ffd2803a +container-tools:rhel8:8030020200923153805:2a301c24 +container-tools:rhel8:8030020201124131330:830d479e +container-tools:rhel8:8030120210208205200:c127ee91 + +which contain an invalid buildorder value 18446744073709551615. DNF +then warned on loading them into an index and ignored them: + + # dnf module list --repoid pulp-appstream + Last metadata expiration check: 3:59:10 ago on Wed 21 Jul 2021 12:38:00 PM CEST. + Module yaml error: Failed to parse buildorder in component: 18446744073709551615: The integer value is larger than 9223372036854775807 [line 118 col 9] + Module yaml error: Failed to parse buildorder in component: 18446744073709551615: The integer value is larger than 9223372036854775807 [line 118 col 9] + Module yaml error: Failed to parse buildorder in component: 18446744073709551615: The integer value is larger than 9223372036854775807 [line 107 col 9] + Module yaml error: Failed to parse buildorder in component: 18446744073709551615: The integer value is larger than 9223372036854775807 [line 114 col 9] + Module yaml error: Failed to parse buildorder in component: 18446744073709551615: The integer value is larger than 9223372036854775807 [line 118 col 9] + Module yaml error: Failed to parse buildorder in component: 18446744073709551615: The integer value is larger than 9223372036854775807 [line 118 col 9] + Module yaml error: Failed to parse buildorder in component: 18446744073709551615: The integer value is larger than 9223372036854775807 [line 107 col 9] + Module yaml error: Failed to parse buildorder in component: 18446744073709551615: The integer value is larger than 9223372036854775807 [line 114 col 9] + +Those were probably built with a broken MBS/libmodulemd which +loaded -1 and serialized it as an 64-bit unsigned integer +18446744073709551615. + +Because the distributor does not change once-released builds, it +became impossible to process them with libmodulemd-2.13.0. + +This patch adds an accept_overflowed_buildorder build option (disabled +by default) which enables a workaround to accept 18446744073709551615 +string as -1 integer when parsing 64-bit signed integers. (The type is +used only in buildorder field now). + +(Originally, I developed a more complicated patch only affecting +loading while keeping validation strict. But that was not enough for +DNF, creareterepo_c and probably many other tools. Thus I prepared +even more complicated patch affecting both loading and validation of +modulemd formats only (cf. modulemd-packager-v3) and that helped DNF. +But the patch ugglified to code to much and considering it's only +a temporary hack, I decided for this simple patch which affects +loading and validation of all formats.) + +Petr Písař: Ported to 2.13.0 from +37a688cc12d7fbab67fda95c47a4605405d7a154. + +Signed-off-by: Petr Písař +--- + meson.build | 1 + + meson_options.txt | 3 +++ + modulemd/meson.build | 2 ++ + modulemd/modulemd-yaml-util.c | 11 +++++++++++ + modulemd/tests/test-modulemd-parse_int64.c | 15 ++++++++++++++- + 5 files changed, 31 insertions(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 37792b3..bbb56ba 100644 +--- a/meson.build ++++ b/meson.build +@@ -215,6 +215,7 @@ if meson.version().version_compare('>=0.53') + 'Python 2 Support': get_option('with_py2'), + 'Python 3 Support': get_option('with_py3'), + 'Skip Introspection': get_option('skip_introspection'), ++ 'Accept overflowed buildorder': get_option('accept_overflowed_buildorder'), + 'Test Installed Library': get_option('test_installed_lib'), + }, section: 'Build Configuration') + endif +diff --git a/meson_options.txt b/meson_options.txt +index 7873d42..3d84459 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -11,6 +11,9 @@ + # + # REMEMBER TO UPDATE THE SUMMARY() IN meson.build when adding options here + ++option('accept_overflowed_buildorder', type : 'boolean', value: 'false', ++ description : 'Accept overflowed 18446744073709551615 buildorder as -1. This breaks a specification, but some RHEL 8 module builds look like that.') ++ + option('verbose_tests', type : 'boolean', value : true, + description : 'Tests that are run under the "debug" configuration will print all debug messages. Disable this option for valgrind checks, as it speeds it up substantially.') + +diff --git a/modulemd/meson.build b/modulemd/meson.build +index 2a60364..0b74818 100644 +--- a/modulemd/meson.build ++++ b/modulemd/meson.build +@@ -14,6 +14,7 @@ + test_installed_lib = get_option('test_installed_lib') + skip_introspection = get_option('skip_introspection') + verbose_tests = get_option('verbose_tests') ++accept_overflowed_buildorder = get_option('accept_overflowed_buildorder') + clang_simple_version_script = find_program ('clang_simple_version.sh') + + +@@ -144,6 +145,7 @@ cdata.set('HAVE_RPMIO', rpm.found()) + cdata.set('HAVE_LIBMAGIC', magic.found()) + cdata.set('HAVE_GDATE_AUTOPTR', has_gdate_autoptr) + cdata.set('HAVE_EXTEND_AND_STEAL', has_extend_and_steal) ++cdata.set('HAVE_OVERFLOWED_BUILDORDER', accept_overflowed_buildorder) + configure_file( + output : 'config.h', + configuration : cdata +diff --git a/modulemd/modulemd-yaml-util.c b/modulemd/modulemd-yaml-util.c +index 6cbf4cc..ad0bd3c 100644 +--- a/modulemd/modulemd-yaml-util.c ++++ b/modulemd/modulemd-yaml-util.c +@@ -11,6 +11,7 @@ + * For more information on free software, see . + */ + ++#include "config.h" + #include "modulemd-errors.h" + #include "private/modulemd-subdocument-info-private.h" + #include "private/modulemd-util.h" +@@ -441,6 +442,16 @@ modulemd_yaml_parse_int64 (yaml_parser_t *parser, GError **error) + + if ((value == G_MAXINT64 && errno == ERANGE)) + { ++#ifdef HAVE_OVERFLOWED_BUILDORDER ++ /* A temporary hack. Remove when RHEL 8 goes end of life. */ ++ if (g_str_equal ((const gchar *)event.data.scalar.value, ++ "18446744073709551615")) ++ { ++ g_debug ("Coercing an invalid signed 64-bit integer to -1: %s", ++ (const gchar *)event.data.scalar.value); ++ return -1; ++ } ++#endif + g_set_error (error, + MODULEMD_YAML_ERROR, + MODULEMD_ERROR_VALIDATE, +diff --git a/modulemd/tests/test-modulemd-parse_int64.c b/modulemd/tests/test-modulemd-parse_int64.c +index 2ccfb53..8759c21 100644 +--- a/modulemd/tests/test-modulemd-parse_int64.c ++++ b/modulemd/tests/test-modulemd-parse_int64.c +@@ -11,6 +11,7 @@ + * For more information on free software, see . + */ + ++#include "config.h" + #include + #include + #include +@@ -36,7 +37,7 @@ test (const char *input, gint64 expected_value, gboolean expected_error) + g_assert_nonnull (error); + else + g_assert_null (error); +- g_assert_cmpuint (parsed, ==, expected_value); ++ g_assert_cmpint (parsed, ==, expected_value); + } + + static void +@@ -69,6 +70,16 @@ test_int64_invalid_too_big (void) + test ("9223372036854775808", 0, TRUE); + } + ++static void ++test_int64_invalid_overflowed (void) ++{ ++#ifdef HAVE_OVERFLOWED_BUILDORDER ++ test ("18446744073709551615", -1, FALSE); ++#else ++ test ("18446744073709551615", 0, TRUE); ++#endif ++} ++ + static void + test_int64_invalid_too_small (void) + { +@@ -143,6 +154,8 @@ main (int argc, char *argv[]) + test_int64_invalid_too_big); + g_test_add_func ("/modulemd/v2/int64/yaml/parse/invalid_too_small", + test_int64_invalid_too_small); ++ g_test_add_func ("/modulemd/v2/int64/yaml/parse/invalid_overflowed", ++ test_int64_invalid_overflowed); + + g_test_add_func ("/modulemd/v2/uint64/yaml/parse/valid", test_uint64_valid); + g_test_add_func ("/modulemd/v2/uint64/yaml/parse/invalid_no_digit", +-- +2.31.1 + diff --git a/tests/tests.yml b/tests/tests.yml index afbcca6..bab8cae 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -26,7 +26,7 @@ tests: - build: dir: . - run: meson -Dtest_installed_lib=true -Ddeveloper_build=false source + run: meson -Daccept_overflowed_buildorder=true -Dlibmagic=enabled -Drpmio=enabled -Dskip_introspection=false -Dtest_installed_lib=true -Dwith_py2=false -Dwith_py3=true -Ddeveloper_build=false source - unittests: dir: . run: ninja test