From 497f15181087ff00f94edae7bc372386529ca0e0 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 19 Sep 2022 10:29:40 -0400 Subject: [PATCH] ci: Check that all installed files have a tag --- .gitlab-ci/check-missing-install-tag.py | 25 +++++++++++++++++++++++++ .gitlab-ci/run-tests.sh | 2 ++ .gitlab-ci/test-msvc.bat | 1 + 3 files changed, 28 insertions(+) create mode 100755 .gitlab-ci/check-missing-install-tag.py diff --git a/.gitlab-ci/check-missing-install-tag.py b/.gitlab-ci/check-missing-install-tag.py new file mode 100755 index 000000000..7081bc746 --- /dev/null +++ b/.gitlab-ci/check-missing-install-tag.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +""" +This script checks Meson configuration logs to verify no installed file is +missing installation tag. +""" + +import argparse +from pathlib import Path + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('builddir', type=Path) + args = parser.parse_args() + + logfile = args.builddir / 'meson-logs' / 'meson-log.txt' + with logfile.open(encoding='utf-8') as f: + if 'Failed to guess install tag' in f.read(): + print(f'Some files are missing install_tag, see {logfile} for details.') + return 1 + return 0 + + +if __name__ == "__main__": + exit(main()) diff --git a/.gitlab-ci/run-tests.sh b/.gitlab-ci/run-tests.sh index 86402dcaf..634f861eb 100755 --- a/.gitlab-ci/run-tests.sh +++ b/.gitlab-ci/run-tests.sh @@ -1,5 +1,7 @@ #!/bin/bash +./.gitlab-ci/check-missing-install-tag.py _build + meson test \ -C _build \ --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \ diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat index 37976d4d0..82e445e00 100644 --- a/.gitlab-ci/test-msvc.bat +++ b/.gitlab-ci/test-msvc.bat @@ -14,6 +14,7 @@ set args=%args:~1% :: FIXME: make warnings fatal pip3 install --upgrade --user meson==0.60.3 || goto :error meson %args% _build || goto :error +python .gitlab-ci/check-missing-install-tag.py _build || goto :error ninja -C _build || goto :error :: FIXME: dont ignore test errors