mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-05 12:20:13 +02:00
Merge branch 'wip/3v1n0/ci-really-use-fedora-39' into 'main'
ci: Ignore lcov errors on source missing, handle atomic writes and actually use Fedora 39 image Closes #3381 See merge request GNOME/glib!4096
This commit is contained in:
commit
ab616db01e
@ -11,11 +11,11 @@ cache:
|
|||||||
- _ccache/
|
- _ccache/
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v27"
|
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v39.1"
|
||||||
COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7"
|
COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7"
|
||||||
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v19"
|
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v19"
|
||||||
ALPINE_IMAGE: "registry.gitlab.gnome.org/gnome/glib/alpine:v3"
|
ALPINE_IMAGE: "registry.gitlab.gnome.org/gnome/glib/alpine:v3"
|
||||||
MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v16"
|
MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v39.1"
|
||||||
MESON_TEST_TIMEOUT_MULTIPLIER: 4
|
MESON_TEST_TIMEOUT_MULTIPLIER: 4
|
||||||
G_MESSAGES_DEBUG: all
|
G_MESSAGES_DEBUG: all
|
||||||
MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings"
|
MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings"
|
||||||
@ -174,7 +174,8 @@ fedora-x86_64:
|
|||||||
stage: build
|
stage: build
|
||||||
needs: []
|
needs: []
|
||||||
variables:
|
variables:
|
||||||
CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
|
CFLAGS: "--coverage -ftest-coverage -fprofile-arcs -fprofile-update=atomic"
|
||||||
|
CXXFLAGS: "--coverage -ftest-coverage -fprofile-arcs -fprofile-update=atomic"
|
||||||
before_script:
|
before_script:
|
||||||
- !reference [".build-linux", "before_script"]
|
- !reference [".build-linux", "before_script"]
|
||||||
- !reference [".with-git", "before_script"]
|
- !reference [".with-git", "before_script"]
|
||||||
@ -194,9 +195,11 @@ fedora-x86_64:
|
|||||||
_build
|
_build
|
||||||
- meson compile -C _build
|
- meson compile -C _build
|
||||||
- mkdir -p _coverage
|
- 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
|
- .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
|
# 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
|
# can then pull it from there — see https://gitlab.gnome.org/GNOME/gtk/-/blob/docs-gtk-org/README.md
|
||||||
- mkdir -p _reference/
|
- mkdir -p _reference/
|
||||||
|
@ -13,7 +13,7 @@ for path in _coverage/*.lcov; do
|
|||||||
# Remove coverage from the fuzz tests, since they are run on a separate CI system
|
# Remove coverage from the fuzz tests, since they are run on a separate CI system
|
||||||
lcov --config-file .lcovrc -r "${path}" "*/fuzzing/*" -o "$(pwd)/${path}"
|
lcov --config-file .lcovrc -r "${path}" "*/fuzzing/*" -o "$(pwd)/${path}"
|
||||||
# Remove coverage from copylibs and subprojects
|
# Remove coverage from copylibs and subprojects
|
||||||
for lib in xdgmime libcharset gnulib; do
|
for lib in xdgmime libcharset gnulib subprojects; do
|
||||||
lcov --config-file .lcovrc -r "${path}" "*/${lib}/*" -o "$(pwd)/${path}"
|
lcov --config-file .lcovrc -r "${path}" "*/${lib}/*" -o "$(pwd)/${path}"
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ for path in _coverage/*.lcov; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
genhtml \
|
genhtml \
|
||||||
--ignore-errors=source \
|
--prefix "$PWD" \
|
||||||
--config-file .lcovrc \
|
--config-file .lcovrc \
|
||||||
_coverage/*.lcov \
|
_coverage/*.lcov \
|
||||||
-o _coverage/coverage
|
-o _coverage/coverage
|
||||||
@ -46,4 +46,4 @@ cat >index.html <<EOL
|
|||||||
EOL
|
EOL
|
||||||
|
|
||||||
# Print a handy link to the coverage report
|
# Print a handy link to the coverage report
|
||||||
echo "Coverage report at: https://${CI_PROJECT_NAMESPACE}.pages.gitlab.gnome.org/-/${CI_PROJECT_NAME}/-/jobs/${CI_BUILD_ID}/artifacts/_coverage/coverage/index.html"
|
echo "Coverage report at: https://${CI_PROJECT_NAMESPACE}.pages.gitlab.gnome.org/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts/_coverage/coverage/index.html"
|
||||||
|
@ -13,6 +13,7 @@ def main(argv):
|
|||||||
print("cov-fixup:", path)
|
print("cov-fixup:", path)
|
||||||
text = io.open(path, "r", encoding="utf-8").read()
|
text = io.open(path, "r", encoding="utf-8").read()
|
||||||
text = text.replace("\\\\", "/")
|
text = text.replace("\\\\", "/")
|
||||||
|
text = text.replace("\\", "/")
|
||||||
old_root = re.search(":(.*?)/glib/.*?$", text, re.MULTILINE).group(1)
|
old_root = re.search(":(.*?)/glib/.*?$", text, re.MULTILINE).group(1)
|
||||||
new_root = os.path.dirname(os.getcwd())
|
new_root = os.path.dirname(os.getcwd())
|
||||||
if old_root != new_root:
|
if old_root != new_root:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM registry.gitlab.gnome.org/gnome/glib/fedora:v27
|
FROM registry.gitlab.gnome.org/gnome/glib/fedora:v39.1
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
@ -14,4 +14,4 @@ WORKDIR /opt
|
|||||||
COPY cross_file_mingw64.txt /opt
|
COPY cross_file_mingw64.txt /opt
|
||||||
|
|
||||||
USER user
|
USER user
|
||||||
WORKDIR /home/user
|
WORKDIR /home/user
|
||||||
|
18
.lcovrc
18
.lcovrc
@ -4,6 +4,10 @@
|
|||||||
# Always enable branch coverage
|
# Always enable branch coverage
|
||||||
lcov_branch_coverage = 1
|
lcov_branch_coverage = 1
|
||||||
|
|
||||||
|
# Disable exception branch for C++:
|
||||||
|
# https://github.com/linux-test-project/lcov/issues/209
|
||||||
|
no_exception_branch = 1
|
||||||
|
|
||||||
# Exclude precondition assertions, as we can never reasonably get full branch
|
# Exclude precondition assertions, as we can never reasonably get full branch
|
||||||
# coverage of them, as they should never normally fail.
|
# coverage of them, as they should never normally fail.
|
||||||
# Similarly exclude g_clear_*() functions (such as g_clear_object(),
|
# Similarly exclude g_clear_*() functions (such as g_clear_object(),
|
||||||
@ -13,4 +17,16 @@ 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_
|
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.
|
# Similarly for unreachable assertions.
|
||||||
lcov_excl_line = LCOV_EXCL_LINE|g_return_if_reached|g_return_val_if_reached|g_assert_not_reached
|
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
|
||||||
|
|
||||||
|
# Sometimes we may have negative counting despite using atomic profile update
|
||||||
|
ignore_errors = negative
|
||||||
|
|
||||||
|
# gnulib paths may not be used
|
||||||
|
ignore_errors = unused
|
||||||
|
|
||||||
|
# baseline lcov files may be empty
|
||||||
|
ignore_errors = empty
|
||||||
|
@ -664,7 +664,7 @@ cancellable_source_cancelled (GCancellable *cancellable,
|
|||||||
{
|
{
|
||||||
GSource *source = user_data;
|
GSource *source = user_data;
|
||||||
GCancellableSource *cancellable_source = (GCancellableSource *) source;
|
GCancellableSource *cancellable_source = (GCancellableSource *) source;
|
||||||
gboolean callback_was_not_called;
|
gboolean callback_was_not_called G_GNUC_UNUSED;
|
||||||
|
|
||||||
g_source_ref (source);
|
g_source_ref (source);
|
||||||
g_source_set_ready_time (source, 0);
|
g_source_set_ready_time (source, 0);
|
||||||
|
@ -103,14 +103,18 @@ test_closefrom (void)
|
|||||||
|
|
||||||
if (flags == -1)
|
if (flags == -1)
|
||||||
{
|
{
|
||||||
|
int exit_code = 100 + fds[i];
|
||||||
async_signal_safe_message ("fd should not have been closed");
|
async_signal_safe_message ("fd should not have been closed");
|
||||||
_exit (100 + fds[i]);
|
g_free (fds);
|
||||||
|
_exit (exit_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & FD_CLOEXEC)
|
if (flags & FD_CLOEXEC)
|
||||||
{
|
{
|
||||||
|
int exit_code = 100 + fds[i];
|
||||||
async_signal_safe_message ("fd should not have been close-on-exec yet");
|
async_signal_safe_message ("fd should not have been close-on-exec yet");
|
||||||
_exit (100 + fds[i]);
|
g_free (fds);
|
||||||
|
_exit (exit_code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,14 +126,18 @@ test_closefrom (void)
|
|||||||
|
|
||||||
if (flags == -1)
|
if (flags == -1)
|
||||||
{
|
{
|
||||||
|
int exit_code = 100 + fds[i];
|
||||||
async_signal_safe_message ("fd should not have been closed");
|
async_signal_safe_message ("fd should not have been closed");
|
||||||
_exit (100 + fds[i]);
|
g_free (fds);
|
||||||
|
_exit (exit_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & FD_CLOEXEC))
|
if (!(flags & FD_CLOEXEC))
|
||||||
{
|
{
|
||||||
|
int exit_code = 100 + fds[i];
|
||||||
async_signal_safe_message ("fd should have been close-on-exec");
|
async_signal_safe_message ("fd should have been close-on-exec");
|
||||||
_exit (100 + fds[i]);
|
g_free (fds);
|
||||||
|
_exit (exit_code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,12 +150,14 @@ test_closefrom (void)
|
|||||||
if (flags == -1)
|
if (flags == -1)
|
||||||
{
|
{
|
||||||
async_signal_safe_message ("fd should not have been closed");
|
async_signal_safe_message ("fd should not have been closed");
|
||||||
|
g_free (fds);
|
||||||
_exit (100 + fd);
|
_exit (100 + fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & FD_CLOEXEC)
|
if (flags & FD_CLOEXEC)
|
||||||
{
|
{
|
||||||
async_signal_safe_message ("fd should not have been close-on-exec");
|
async_signal_safe_message ("fd should not have been close-on-exec");
|
||||||
|
g_free (fds);
|
||||||
_exit (100 + fd);
|
_exit (100 + fd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -157,10 +167,12 @@ test_closefrom (void)
|
|||||||
if (fcntl (fds[i], F_GETFD) != -1 || errno != EBADF)
|
if (fcntl (fds[i], F_GETFD) != -1 || errno != EBADF)
|
||||||
{
|
{
|
||||||
async_signal_safe_message ("fd should have been closed");
|
async_signal_safe_message ("fd should have been closed");
|
||||||
|
g_free (fds);
|
||||||
_exit (100 + fds[i]);
|
_exit (100 + fds[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free (fds);
|
||||||
_exit (0);
|
_exit (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -821,7 +821,7 @@
|
|||||||
{
|
{
|
||||||
g_set_user_dirs_str
|
g_set_user_dirs_str
|
||||||
Memcheck:Leak
|
Memcheck:Leak
|
||||||
match-leak-kinds:definite,reachable
|
match-leak-kinds:definite,reachable,possible
|
||||||
fun:malloc
|
fun:malloc
|
||||||
...
|
...
|
||||||
fun:set_str_if_different
|
fun:set_str_if_different
|
||||||
@ -833,7 +833,7 @@
|
|||||||
{
|
{
|
||||||
g_set_user_dirs_strv
|
g_set_user_dirs_strv
|
||||||
Memcheck:Leak
|
Memcheck:Leak
|
||||||
match-leak-kinds:definite,reachable
|
match-leak-kinds:definite,reachable,possible
|
||||||
fun:malloc
|
fun:malloc
|
||||||
...
|
...
|
||||||
fun:set_strv_if_different
|
fun:set_strv_if_different
|
||||||
@ -1322,3 +1322,13 @@
|
|||||||
fun:g_rw_lock_writer_lock
|
fun:g_rw_lock_writer_lock
|
||||||
fun:g_log_writer_default_set_debug_domains
|
fun:g_log_writer_default_set_debug_domains
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# This can be removed when versions of valgrind including the fix are widely used.
|
||||||
|
# See https://gitlab.gnome.org/GNOME/glib/-/issues/3292
|
||||||
|
{
|
||||||
|
g_utf8_collate_key wcsxfrm false-positive
|
||||||
|
Memcheck:Addr32
|
||||||
|
...
|
||||||
|
fun:wcsxfrm*
|
||||||
|
fun:g_utf8_collate_key
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user