From 1265b456d1abefb06b6c13bf75df16d49dd0ad5d Mon Sep 17 00:00:00 2001 From: Luca Bacci Date: Fri, 23 Aug 2024 10:34:29 +0200 Subject: [PATCH 1/2] CI/msys2-mingw32: Set G_DEBUGGER environment variable This enables us to catch access violation errors in CI and get meaningful stacktraces with gdb. Helps #3042 See https://docs.gtk.org/glib/running.html#environment-variables --- .gitlab-ci.yml | 2 ++ .gitlab-ci/test-msys2.sh | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cbb29c8eb..08bf2ad1f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -521,6 +521,7 @@ msys2-mingw32: CHERE_INVOKING: "yes" CFLAGS: -coverage -ftest-coverage -fprofile-arcs PYTHONUTF8: "1" + G_DEBUGGER: 'gdb.exe -batch -ex "set logging enabled on" -ex "attach %p" -ex "signal-event %e" -ex "c" -ex "thread apply all bt full" -ex "k"' script: - C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20 - C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh @@ -535,6 +536,7 @@ msys2-mingw32: expire_in: 1 week paths: - _build/meson-logs + - _build/gdb.txt - _coverage/ - _reference/ diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2.sh index e2700f7a6..d8fdc66b7 100755 --- a/.gitlab-ci/test-msys2.sh +++ b/.gitlab-ci/test-msys2.sh @@ -21,7 +21,8 @@ pacman --noconfirm -S --needed \ "${MINGW_PACKAGE_PREFIX}"-python-pip \ "${MINGW_PACKAGE_PREFIX}"-toolchain \ "${MINGW_PACKAGE_PREFIX}"-zlib \ - "${MINGW_PACKAGE_PREFIX}"-libelf + "${MINGW_PACKAGE_PREFIX}"-libelf \ + "${MINGW_PACKAGE_PREFIX}"-gdb mkdir -p _coverage mkdir -p _ccache @@ -75,4 +76,4 @@ fi # can then pull it from there — see https://gitlab.gnome.org/GNOME/gtk/-/blob/docs-gtk-org/README.md mkdir -p _reference/ mv _build/docs/reference/glib/glib-win32-2.0/ _reference/glib-win32/ -mv _build/docs/reference/gio/gio-win32-2.0/ _reference/gio-win32/ \ No newline at end of file +mv _build/docs/reference/gio/gio-win32-2.0/ _reference/gio-win32/ From 84c2d6443618fa5416e0582aba2d0a4fc7955a5a Mon Sep 17 00:00:00 2001 From: Luca Bacci Date: Fri, 23 Aug 2024 15:44:13 +0200 Subject: [PATCH 2/2] docs: Don't reference Unix-only method GLib.Source.add_unix_fd gi-docgen won't find the method on Windows --- glib/gmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glib/gmain.c b/glib/gmain.c index 1a6e7d82c..3010b7984 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -1435,7 +1435,7 @@ g_source_get_context (GSource *source) * * Using this API forces the linear scanning of event sources on each * main loop iteration. Newly-written event sources should try to use - * [method@GLib.Source.add_unix_fd] instead of this API. + * `g_source_add_unix_fd` instead of this API. **/ void g_source_add_poll (GSource *source, @@ -4668,7 +4668,7 @@ g_main_context_poll_unlocked (GMainContext *context, * * Adds a file descriptor to the set of file descriptors polled for * this context. This will very seldom be used directly. Instead - * a typical event source will use [method@GLib.Source.add_unix_fd] instead. + * a typical event source will use `g_source_add_unix_fd` instead. **/ void g_main_context_add_poll (GMainContext *context,