From 2c94349e79ac6b5bfedd2d3437ee5f950ebe9cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 24 May 2024 18:00:55 +0200 Subject: [PATCH] ci: Ignore lcov errors on source missing When using dtrace some temporary files may be leaked as source files and this may lead to build issues such as geninfo: ERROR: unable to open /builds/GNOME/glib/_build/.dtrace-temp.ed1c5ba9.c: No such file or directory AFAIK there's no way to keep these temporary files around, so the only thing we can do is making lcov less strict about missing files. We can drop the special option from genhtml since it's using the same lcovrc file --- .gitlab-ci.yml | 6 ++++-- .gitlab-ci/coverage-docker.sh | 1 - .lcovrc | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 533b2c31c..3c5e5b19d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -194,9 +194,11 @@ fedora-x86_64: _build - meson compile -C _build - mkdir -p _coverage - - lcov --config-file .lcovrc --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov" + - lcov --config-file .lcovrc --directory _build --capture --initial + --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov" - .gitlab-ci/run-tests.sh - - lcov --config-file .lcovrc --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov" + - lcov --config-file .lcovrc --directory _build --capture + --output-file "_coverage/${CI_JOB_NAME}.lcov" # Copy the built documentation to an artifact directory. The build for docs.gtk.org # can then pull it from there — see https://gitlab.gnome.org/GNOME/gtk/-/blob/docs-gtk-org/README.md - mkdir -p _reference/ diff --git a/.gitlab-ci/coverage-docker.sh b/.gitlab-ci/coverage-docker.sh index 6367f5e14..53a14a283 100755 --- a/.gitlab-ci/coverage-docker.sh +++ b/.gitlab-ci/coverage-docker.sh @@ -27,7 +27,6 @@ for path in _coverage/*.lcov; do done genhtml \ - --ignore-errors=source \ --config-file .lcovrc \ _coverage/*.lcov \ -o _coverage/coverage diff --git a/.lcovrc b/.lcovrc index 9107da270..cbed5ba13 100644 --- a/.lcovrc +++ b/.lcovrc @@ -13,4 +13,7 @@ lcov_branch_coverage = 1 lcov_excl_br_line = LCOV_EXCL_BR_LINE|g_return_if_fail|g_return_val_if_fail|g_assert|g_assert_|g_clear_ # Similarly for unreachable assertions. -lcov_excl_line = LCOV_EXCL_LINE|g_return_if_reached|g_return_val_if_reached|g_assert_not_reached \ No newline at end of file +lcov_excl_line = LCOV_EXCL_LINE|g_return_if_reached|g_return_val_if_reached|g_assert_not_reached + +# When using dtrace some temporary files may be leaked as source files +ignore_errors = source