From: oreo639 <oreo639@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [WIP] glib: update to 2.80.0.
Date: Thu, 21 Mar 2024 22:04:56 +0100 [thread overview]
Message-ID: <20240321210456.2A1CC20281@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-49446@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]
There is an updated pull request by oreo639 against master on the void-packages repository
https://github.com/oreo639/void-packages glib
https://github.com/void-linux/void-packages/pull/49446
[WIP] glib: update to 2.80.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
glib 2.80.0 introduces libgirepository-2.0 and GIRepository-3.0, which unfortunately creates a build cycle between glib and gobject-introspection, although that is supposedly transitory.
https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701
https://gitlab.gnome.org/GNOME/glib/-/issues/2616
https://docs.gtk.org/girepository/migrating-gi.html
The bootstrap process, while not intentionally, mirrors the on used by gnome-buld-meta: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/master/elements/sdk/glib.bst
(While gobject-introspection technically doesn't need to be rebuilt I did so here due to issues with dependencies, e.g. glib-bootstrap vs glib)
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/49446.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glib-49446.patch --]
[-- Type: text/x-diff, Size: 31573 bytes --]
From 26fdfc0193597ff10d7e18cc34f446ccbfd3147e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:27:39 -0700
Subject: [PATCH 1/6] New package: glib-bootstrap-2.80.0
---
srcpkgs/glib-bootstrap/patches | 1 +
srcpkgs/glib-bootstrap/template | 47 +++++++++++++++++++++++++++++++++
srcpkgs/glib-bootstrap/update | 2 ++
3 files changed, 50 insertions(+)
create mode 120000 srcpkgs/glib-bootstrap/patches
create mode 100644 srcpkgs/glib-bootstrap/template
create mode 100644 srcpkgs/glib-bootstrap/update
diff --git a/srcpkgs/glib-bootstrap/patches b/srcpkgs/glib-bootstrap/patches
new file mode 120000
index 00000000000000..4beb39573cad4a
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/patches
@@ -0,0 +1 @@
+../glib/patches
\ No newline at end of file
diff --git a/srcpkgs/glib-bootstrap/template b/srcpkgs/glib-bootstrap/template
new file mode 100644
index 00000000000000..166194bb4fa1ff
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/template
@@ -0,0 +1,47 @@
+# Template file for 'glib-bootstrap'
+# keep in sync with glib
+#
+# This aloing with gobject-introspection-bootstrap is unfortunately necessary as a part of the
+# libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=glib-bootstrap
+version=2.80.0
+revision=1
+build_style=meson
+# static version is necessary for qemu-user-static;
+# also disable LTO, otherwise there are multiple failures when linking qemu
+configure_args="-Dman=true -Dselinux=disabled
+ --default-library=both -Db_lto=false -Dintrospection=disabled"
+hostmakedepends="gettext pkg-config libxslt docbook-xsl
+ python3-packaging python3-docutils"
+makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
+depends="${makedepends}"
+checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
+short_desc="GNU library of C routines"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GLib"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
+distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
+make_check_pre="dbus-run-session"
+
+repository=bootstrap
+conflicts="glib libglib-devel glib-devel"
+provides="glib-${version}_${revision}"
+
+post_patch() {
+ # Timer test is flaky on 32 bit (does float comparisons)
+ if [ "${XBPS_TARGET_WORDSIZE}" = "32" ]; then
+ vsed -e "s/'timer' : {},//" -i glib/tests/meson.build
+ fi
+}
+
+pre_check() {
+ # machine-id is a random, non-zero value
+ echo 'dcb30309cd6c8b7cc20383d85a5c7012' > /etc/machine-id
+}
+
+post_check() {
+ rm /etc/machine-id
+}
diff --git a/srcpkgs/glib-bootstrap/update b/srcpkgs/glib-bootstrap/update
new file mode 100644
index 00000000000000..4d29b9118be20b
--- /dev/null
+++ b/srcpkgs/glib-bootstrap/update
@@ -0,0 +1,2 @@
+pattern="glib-[0-9]+\.[0-9]*[02468]\.[0-9]+"
+pkgname="glib"
From 3624e95088bd254275f3aff5ccc4cc20481f2351 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:33:00 -0700
Subject: [PATCH 2/6] New package: gobject-introspection-bootstrap-1.80.0
---
.../files/g-ir-compiler-wrapper | 20 +++++
.../files/g-ir-scanner-lddwrapper | 2 +
.../files/g-ir-scanner-qemuwrapper | 9 +++
.../files/g-ir-scanner-wrapper | 18 +++++
.../gobject-introspection-bootstrap/patches | 1 +
.../gobject-introspection-bootstrap/template | 80 +++++++++++++++++++
.../gobject-introspection-bootstrap/update | 1 +
7 files changed, 131 insertions(+)
create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
create mode 100755 srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
create mode 120000 srcpkgs/gobject-introspection-bootstrap/patches
create mode 100644 srcpkgs/gobject-introspection-bootstrap/template
create mode 100644 srcpkgs/gobject-introspection-bootstrap/update
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
new file mode 100755
index 00000000000000..3b78fb9d1c3294
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-compiler-wrapper
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+ # wrapper for g-ir-compiler, which runs the target version of it through qemu.
+ # g-ir-compiler writes out the raw content of a C struct to disk, and therefore
+ # is architecture dependent.
+ if [ -x build/tools/g-ir-compiler ]; then
+ # We are compiling gobject-introspection.
+ # lets used the one we just compiled.
+ gir_bin=build/tools/g-ir-compiler
+ elif [ -x ${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped ]; then
+ # Lets use the g-ir-compiler from the target
+ gir_bin=${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler.wrapped
+ fi
+ exec /usr/bin/g-ir-scanner-qemuwrapper ${gir_bin} "$@"
+fi
+
+exec /usr/bin/g-ir-compiler.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
new file mode 100755
index 00000000000000..b969836b66422a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-lddwrapper
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/prelink-rtld --root=${XBPS_CROSS_BASE} "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
new file mode 100755
index 00000000000000..521fbda35b2a6a
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-qemuwrapper
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
+
+/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${GIR_EXTRA_OPTIONS} \
+ -L ${XBPS_CROSS_BASE} \
+ -E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
+ "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
new file mode 100755
index 00000000000000..d5c426d3cc2e2b
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/files/g-ir-scanner-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Check if we are running in an xbps-src environment and run the wrapper if that
+# is the case.
+if [ -n "$XBPS_CROSS_BASE" -a -n "$XBPS_TARGET_MACHINE" -a -n "$XBPS_VERSION" ]; then
+ # This prevents g-ir-scanner from writing cache data to $HOME
+ export GI_SCANNER_DISABLE_CACHE=1
+ # This prevents the native C compiler from using $XBPS_CROSS_BASE libraries
+ export GI_SCANNER_EXTRA_LD_LIBRARY_PATH=/usr/lib
+
+ exec /usr/bin/g-ir-scanner.wrapped \
+ --use-binary-wrapper=/usr/bin/g-ir-scanner-qemuwrapper \
+ --use-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper \
+ --add-include-path=${XBPS_CROSS_BASE}/usr/share/gir-1.0 \
+ --add-include-path=${XBPS_CROSS_BASE}/usr/lib/gir-1.0 \
+ "${@//-I\/usr\/include/-I${XBPS_CROSS_BASE}\/usr\/include}"
+fi
+
+exec /usr/bin/g-ir-scanner.wrapped "$@"
diff --git a/srcpkgs/gobject-introspection-bootstrap/patches b/srcpkgs/gobject-introspection-bootstrap/patches
new file mode 120000
index 00000000000000..cc2ee1c4a0e3b9
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/patches
@@ -0,0 +1 @@
+../gobject-introspection/patches
\ No newline at end of file
diff --git a/srcpkgs/gobject-introspection-bootstrap/template b/srcpkgs/gobject-introspection-bootstrap/template
new file mode 100644
index 00000000000000..d87deef32017ce
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/template
@@ -0,0 +1,80 @@
+# Template file for 'gobject-introspection-bootstrap'
+# keep in sync with gobject-introspection
+#
+# This aloing with glib-bootstrap is unfortunately necessary as a part of the
+# libgirepository-1.0 to libgirepository-2.0 migration.
+pkgname=gobject-introspection-bootstrap
+version=1.80.0
+revision=1
+build_style=meson
+configure_args="-Dbuild_introspection_data=false"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
+hostmakedepends="flex pkg-config"
+# We won't run tests with cairo to avoid cyclical deps.
+makedepends="libffi-devel glib-bootstrap python3-devel python3-Mako
+ python3-Markdown"
+depends="${makedepends}"
+short_desc="Introspection system for GObject-based libraries"
+maintainer="oreo639 <oreo6391@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
+python_version=3
+
+repository=bootstrap
+conflicts="libgirepository gobject-introspection"
+noverifyrdeps=yes
+
+if [ "$CROSS_BUILD" ]; then
+ hostmakedepends+=" gobject-introspection-bootstrap qemu-user-static prelink-cross"
+ configure_args+=" -Dgi_cross_use_prebuilt_gi=true
+ -Dgi_cross_binary_wrapper=/usr/bin/g-ir-scanner-qemuwrapper
+ -Dgi_cross_ldd_wrapper=/usr/bin/g-ir-scanner-lddwrapper
+ -Dgi_cross_pkgconfig_sysroot_path=${XBPS_CROSS_BASE}"
+fi
+
+post_install() {
+ rm ${DESTDIR}/usr/lib/gobject-introspection/giscanner/doctemplates/*/meson.build
+
+ # Install our wrappers system-wide, they are required for building all other
+ # gobject-based packages.
+ vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
+ vbin ${FILESDIR}/g-ir-scanner-lddwrapper
+
+ # Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
+ # we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
+ # like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
+ # find_program is also to blame.
+ mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
+ vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
+
+ # Same logic of g-ir-scanner applies here
+ mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
+ vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
+
+ # For cross builds copy the not installed tests subdirectory
+ if [ "$CROSS_BUILD" ]; then
+ vmkdir usr/share/gobject-introspection-1.0/tests
+ for f in scanner/annotation.? scanner/drawable.? scanner/foo.? \
+ scanner/regress.? scanner/utility.? scanner/warnlib.? \
+ gimarshallingtests.? gitestmacros.h; do
+ vcopy tests/$f usr/share/gobject-introspection-1.0/tests
+ done
+ fi
+
+ # modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
+ # meant to be called with 'pkg-config --variable'
+ vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
+ -e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
+ -e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
+ -e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
+ -e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
+ -e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
+ -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
+ -i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
+
+ # Fix the name of the python3 c bindings
+ mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
+ ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
+}
diff --git a/srcpkgs/gobject-introspection-bootstrap/update b/srcpkgs/gobject-introspection-bootstrap/update
new file mode 100644
index 00000000000000..8f89bb085398ec
--- /dev/null
+++ b/srcpkgs/gobject-introspection-bootstrap/update
@@ -0,0 +1 @@
+pattern="(?<=${pkgname}-)[0-9]+\.[0-9]*[02468]\.[0-9]+"
From 74aa309dcaeac68f34bd0a4ad567ee09b7c86392 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:53:54 -0700
Subject: [PATCH 3/6] glib: update to 2.80.0.
---
common/shlibs | 1 +
.../glib/patches/disable-broken-tests.patch | 67 --------
srcpkgs/glib/patches/fix-test-cxxcpp.patch | 26 ---
...er-Fix-race-between-source-callbacks.patch | 158 ------------------
srcpkgs/glib/template | 31 ++--
5 files changed, 19 insertions(+), 264 deletions(-)
delete mode 100644 srcpkgs/glib/patches/disable-broken-tests.patch
delete mode 100644 srcpkgs/glib/patches/fix-test-cxxcpp.patch
delete mode 100644 srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
diff --git a/common/shlibs b/common/shlibs
index 28be311b85ae4c..a574ca21f5921e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -102,6 +102,7 @@ libglib-2.0.so.0 glib-2.76.0_1
libgmodule-2.0.so.0 glib-2.76.0_1
libgio-2.0.so.0 glib-2.76.0_1
libgobject-2.0.so.0 glib-2.76.0_1
+libgrepository-2.0.so.0 glib-2.80.0_1
libwt.so.4.10.0 wt-4.10.0_1
libwtdbo.so.4.10.0 wt-4.10.0_1
libwtdbosqlite3.so.4.10.0 wt-4.10.0_1
diff --git a/srcpkgs/glib/patches/disable-broken-tests.patch b/srcpkgs/glib/patches/disable-broken-tests.patch
deleted file mode 100644
index f6e0328b214e76..00000000000000
--- a/srcpkgs/glib/patches/disable-broken-tests.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/gio/tests/meson.build
-+++ b/gio/tests/meson.build
-@@ -63,7 +63,6 @@ gio_tests = {
- # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
- 'can_fail' : host_system == 'darwin',
- },
-- 'converter-stream' : {},
- 'credentials' : {},
- 'data-input-stream' : {},
- 'data-output-stream' : {},
-@@ -227,7 +226,6 @@ endif
- # Test programs buildable on UNIX only
- if host_machine.system() != 'windows'
- gio_tests += {
-- 'file' : {},
- 'gdbus-peer-object-manager' : {},
- 'gdbus-sasl' : {},
- 'live-g-file' : {},
-@@ -951,13 +949,6 @@ if not meson.is_cross_build()
- test_resources_binary2,
- ]
- endif
--
-- gio_tests += {
-- 'resources' : {
-- 'extra_sources' : resources_extra_sources,
-- 'depends' : resource_plugin,
-- },
-- }
- endif
-
- test_extra_programs_targets = {}
-diff --git a/glib/tests/meson.build b/glib/tests/meson.build
-index d74617823..1de81a825 100644
---- a/glib/tests/meson.build
-+++ b/glib/tests/meson.build
-@@ -12,22 +12,14 @@ glib_tests = {
- 'cache' : {},
- 'charset' : {},
- 'checksum' : {},
-- 'collate' : {},
- 'completion' : {},
- 'cond' : {},
-- 'convert' : {},
- 'dataset' : {},
-- 'date' : {
-- # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
-- 'can_fail' : host_system == 'darwin',
-- },
- 'dir' : {},
- 'environment' : {
- # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
- 'can_fail' : host_system == 'darwin',
- },
-- 'error' : {},
-- 'fileutils' : {},
- 'gdatetime' : {
- 'suite' : ['slow'],
- 'can_fail' : host_system == 'windows',
-@@ -70,7 +62,6 @@ glib_tests = {
- 'node' : {},
- 'once' : {},
- 'onceinit' : {},
-- 'option-context' : {},
- 'option-argv0' : {},
- 'overflow' : {},
- 'overflow-fallback' : {
diff --git a/srcpkgs/glib/patches/fix-test-cxxcpp.patch b/srcpkgs/glib/patches/fix-test-cxxcpp.patch
deleted file mode 100644
index 2b1ad5b4e6adc7..00000000000000
--- a/srcpkgs/glib/patches/fix-test-cxxcpp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fails to build on musl.
-../glib/tests/cxx.cpp:509:15: error: missing sentinel in function call [-Werror=format=]
-g_test_init (&argc, &argv, NULL);
-
---- a/glib/tests/cxx.cpp
-+++ a/glib/tests/cxx.cpp
-@@ -505,7 +505,7 @@ test_string_free (void)
- int
- main (int argc, char *argv[])
- {
- #if G_CXX_STD_CHECK_VERSION (11)
-- g_test_init (&argc, &argv, NULL);
-+ g_test_init (&argc, &argv, nullptr);
- #else
- g_test_init (&argc, &argv, static_cast<void *>(NULL));
---- a/gio/tests/cxx.cpp
-+++ a/gio/tests/cxx.cpp
-@@ -59,7 +59,7 @@ int
- main (int argc, char **argv)
- {
- #if G_CXX_STD_CHECK_VERSION (11)
-- g_test_init (&argc, &argv, NULL);
-+ g_test_init (&argc, &argv, nullptr);
- #else
- g_test_init (&argc, &argv, static_cast<void *>(NULL));
- #endif
diff --git a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch b/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
deleted file mode 100644
index 17de85b15bdbbe..00000000000000
--- a/srcpkgs/glib/patches/gthreadedresolver-Fix-race-between-source-callbacks.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip@tecnocode.co.uk>
-Date: Mon, 11 Sep 2023 16:02:15 +0100
-Subject: [PATCH] gthreadedresolver: Fix race between source callbacks and
- finalize
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I had thought that because `g_source_destroy()` was called for the two
-sources (cancel and timeout) in the `GTask` finalize function for a
-threaded resolver operation, that it would be fine to use a plain
-pointer in the source callbacks to point to the `GTask`.
-
-That turns out to not be true: because the source callbacks are executed
-in the GLib worker thread, and the `GTask` can be finalized in another
-thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
-be scheduled in the worker thread, then for the `GTask` to be finalized,
-and then the source callback to continue execution and find itself
-doing a use-after-free.
-
-Fix that by using a weak ref to the `GTask` in the source callbacks,
-rather than a plain pointer.
-
-Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
-
-Fixes: #3105
----
- gio/gthreadedresolver.c | 43 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 37 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
-index 2d94531bfda3..c7a567549f28 100644
---- a/gio/gthreadedresolver.c
-+++ b/gio/gthreadedresolver.c
-@@ -1422,85 +1422,116 @@ lookup_records_finish (GResolver *resolver,
- static gboolean
- timeout_cb (gpointer user_data)
- {
-- GTask *task = G_TASK (user_data);
-- LookupData *data = g_task_get_task_data (task);
-+ GWeakRef *weak_task = user_data;
-+ GTask *task = NULL; /* (owned) */
-+ LookupData *data;
- gboolean should_return;
-
-+ task = g_weak_ref_get (weak_task);
-+ if (task == NULL)
-+ return G_SOURCE_REMOVE;
-+
-+ data = g_task_get_task_data (task);
-+
- g_mutex_lock (&data->lock);
-
- should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, TIMED_OUT);
- g_clear_pointer (&data->timeout_source, g_source_unref);
-
- g_mutex_unlock (&data->lock);
-
- if (should_return)
- g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
- _("Socket I/O timed out"));
-
- /* Signal completion of the task. */
- g_mutex_lock (&data->lock);
- data->has_returned = TRUE;
- g_cond_broadcast (&data->cond);
- g_mutex_unlock (&data->lock);
-
-+ g_object_unref (task);
-+
- return G_SOURCE_REMOVE;
- }
-
- /* Will be called in the GLib worker thread, so must lock all accesses to shared
- * data. */
- static gboolean
- cancelled_cb (GCancellable *cancellable,
- gpointer user_data)
- {
-- GTask *task = G_TASK (user_data);
-- LookupData *data = g_task_get_task_data (task);
-+ GWeakRef *weak_task = user_data;
-+ GTask *task = NULL; /* (owned) */
-+ LookupData *data;
- gboolean should_return;
-
-+ task = g_weak_ref_get (weak_task);
-+ if (task == NULL)
-+ return G_SOURCE_REMOVE;
-+
-+ data = g_task_get_task_data (task);
-+
- g_mutex_lock (&data->lock);
-
- g_assert (g_cancellable_is_cancelled (cancellable));
- should_return = g_atomic_int_compare_and_exchange (&data->will_return, NOT_YET, CANCELLED);
- g_clear_pointer (&data->cancellable_source, g_source_unref);
-
- g_mutex_unlock (&data->lock);
-
- if (should_return)
- g_task_return_error_if_cancelled (task);
-
- /* Signal completion of the task. */
- g_mutex_lock (&data->lock);
- data->has_returned = TRUE;
- g_cond_broadcast (&data->cond);
- g_mutex_unlock (&data->lock);
-
-+ g_object_unref (task);
-+
- return G_SOURCE_REMOVE;
- }
-
-+static void
-+weak_ref_clear_and_free (GWeakRef *weak_ref)
-+{
-+ g_weak_ref_clear (weak_ref);
-+ g_free (weak_ref);
-+}
-+
- static void
- run_task_in_thread_pool_async (GThreadedResolver *self,
- GTask *task)
- {
- LookupData *data = g_task_get_task_data (task);
- guint timeout_ms = g_resolver_get_timeout (G_RESOLVER (self));
- GCancellable *cancellable = g_task_get_cancellable (task);
-
- g_mutex_lock (&data->lock);
-
- g_thread_pool_push (self->thread_pool, g_object_ref (task), NULL);
-
- if (timeout_ms != 0)
- {
-+ GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+ g_weak_ref_set (weak_task, task);
-+
- data->timeout_source = g_timeout_source_new (timeout_ms);
- g_source_set_static_name (data->timeout_source, "[gio] threaded resolver timeout");
-- g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), task, NULL);
-+ g_source_set_callback (data->timeout_source, G_SOURCE_FUNC (timeout_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
- g_source_attach (data->timeout_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
- }
-
- if (cancellable != NULL)
- {
-+ GWeakRef *weak_task = g_new0 (GWeakRef, 1);
-+ g_weak_ref_set (weak_task, task);
-+
- data->cancellable_source = g_cancellable_source_new (cancellable);
- g_source_set_static_name (data->cancellable_source, "[gio] threaded resolver cancellable");
-- g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), task, NULL);
-+ g_source_set_callback (data->cancellable_source, G_SOURCE_FUNC (cancelled_cb), g_steal_pointer (&weak_task), (GDestroyNotify) weak_ref_clear_and_free);
- g_source_attach (data->cancellable_source, GLIB_PRIVATE_CALL (g_get_worker_context) ());
- }
-
diff --git a/srcpkgs/glib/template b/srcpkgs/glib/template
index 8cbde21cc6019b..7087cc4ae7628a 100644
--- a/srcpkgs/glib/template
+++ b/srcpkgs/glib/template
@@ -1,30 +1,35 @@
# Template file for 'glib'
+# keep in sync with glib-bootstrap
pkgname=glib
-version=2.78.0
-revision=3
+version=2.80.0
+revision=1
build_style=meson
+build_helper=qemu
# static version is necessary for qemu-user-static;
# also disable LTO, otherwise there are multiple failures when linking qemu
-configure_args="-Dman=true -Dselinux=disabled
- $(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
-hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
+configure_args="-Dman=true -Dselinux=disabled -Dintrospection=enabled
+ $(vopt_bool gtk_doc documentation) --default-library=both -Db_lto=false"
+hostmakedepends="gettext pkg-config gobject-introspection-bootstrap
+ libxslt docbook-xsl $(vopt_if gtk_doc gi-docgen) python3-packaging python3-docutils"
makedepends="zlib-devel pcre2-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
checkdepends="desktop-file-utils shared-mime-info dbus python3-pytest"
short_desc="GNU library of C routines"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://wiki.gnome.org/Projects/GLib"
-#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-78/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
-checksum=44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30
+checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
make_check_pre="dbus-run-session"
build_options="gtk_doc"
-desc_option_gtk_doc="Build GTK API docs"
+build_options_default="gtk_doc"
+desc_option_gtk_doc="Build Glib API docs"
-if [ -z "$CROSS_BUILD" ]; then
- build_options_default+=" gtk_doc"
+if [ "$CROSS_BUILD" ]; then
+ hostmakedepends+=" prelink-cross"
+ makedepends+=" gobject-introspection-bootstrap"
fi
post_patch() {
@@ -76,11 +81,11 @@ glib-devel_package() {
vmove usr/share/man/man1/gdbus-codegen.1
vmove usr/share/man/man1/glib-genmarshal.1
vmove usr/share/man/man1/gtester-report.1
- for f in aclocal glib-2.0 gdb; do
+ for f in aclocal glib-2.0 gir-1.0 gdb; do
vmove usr/share/${f}
done
- if [ -d $DESTDIR/usr/share/gtk-doc ]; then
- vmove usr/share/gtk-doc
+ if [ "$build_option_gtk_doc" ]; then
+ vmove usr/share/doc
fi
}
}
From e58e2f3b736e0bccc57e2b34dc674e2411167e5e Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:54:17 -0700
Subject: [PATCH 4/6] gobject-introspection: update to 1.80.0.
---
.../patches/fix-leaks.patch | 46 -------------------
srcpkgs/gobject-introspection/template | 13 +++---
2 files changed, 7 insertions(+), 52 deletions(-)
delete mode 100644 srcpkgs/gobject-introspection/patches/fix-leaks.patch
diff --git a/srcpkgs/gobject-introspection/patches/fix-leaks.patch b/srcpkgs/gobject-introspection/patches/fix-leaks.patch
deleted file mode 100644
index fa23ee74578897..00000000000000
--- a/srcpkgs/gobject-introspection/patches/fix-leaks.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bf96a92ef263820d40e233814a46932cae00db41 Mon Sep 17 00:00:00 2001
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Tue, 18 Jul 2023 11:07:59 -0400
-Subject: [PATCH] gdump: Fix leaked io streams
-
-This makes Meson unit test fail:
-https://github.com/mesonbuild/meson/issues/11754
----
-
-MR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
-
- girepository/gdump.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/girepository/gdump.c b/girepository/gdump.c
-index 055a8b8c1..449b260a4 100644
---- a/girepository/gdump.c
-+++ b/girepository/gdump.c
-@@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
- if (output == NULL)
- {
- g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
-+ g_object_unref (input);
- return FALSE;
- }
-
-@@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
- ioerror = NULL;
- else
- ioerror = error;
-- if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
-- return FALSE;
-- if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
-- return FALSE;
-+ caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
-+ caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
- }
-
-+ g_object_unref (in);
-+ g_object_unref (output);
-+
- return !caught_error;
- }
---
-GitLab
-
diff --git a/srcpkgs/gobject-introspection/template b/srcpkgs/gobject-introspection/template
index 356646ced3117f..81a26d58dde5f2 100644
--- a/srcpkgs/gobject-introspection/template
+++ b/srcpkgs/gobject-introspection/template
@@ -1,11 +1,12 @@
# Template file for 'gobject-introspection'
+# keep in sync with gobject-introspection-bootstrap
pkgname=gobject-introspection
-version=1.76.1
-revision=3
+version=1.80.0
+revision=1
build_style=meson
-pycompile_dirs="usr/lib/${pkgname}/giscanner"
+pycompile_dirs="usr/lib/gobject-introspection/giscanner"
hostmakedepends="flex pkg-config"
-# won't run tests with cairo to avoid cyclical deps
+# won't run tests with cairo to avoid cyclical deps.
makedepends="libffi-devel libglib-devel python3-devel python3-Mako
python3-Markdown"
depends="libgirepository-devel python3-Mako python3-Markdown python3-setuptools"
@@ -13,8 +14,8 @@ short_desc="Introspection system for GObject-based libraries"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.1-or-later"
homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
-distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=196178bf64345501dcdc4d8469b36aa6fe80489354efe71cb7cb8ab82a3738bf
+distfiles="${GNOME_SITE}/gobject-introspection/${version%.*}/gobject-introspection-${version}.tar.xz"
+checksum=54a90b4a3cb82fd6a3e8b8a7775178ebc954af3c2bc726ed5961e6503ce62636
python_version=3
if [ "$CROSS_BUILD" ]; then
From bfaec33cd94daf0ff80394294cbd6dcd465ccf20 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 12:59:31 -0700
Subject: [PATCH 5/6] glib-networking: update to 2.80.0.
---
srcpkgs/glib-networking/template | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/srcpkgs/glib-networking/template b/srcpkgs/glib-networking/template
index 680a064ffec5a9..7e9bcf0c9f267b 100644
--- a/srcpkgs/glib-networking/template
+++ b/srcpkgs/glib-networking/template
@@ -1,6 +1,6 @@
# Template file for 'glib-networking'
pkgname=glib-networking
-version=2.76.0
+version=2.80.0
revision=1
build_style=meson
configure_args="-Dinstalled_tests=false -Dgnutls=enabled -Dlibproxy=enabled
@@ -14,7 +14,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://gitlab.gnome.org/GNOME/glib-networking/"
changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/master/NEWS"
-#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-76/NEWS"
+#changelog="https://gitlab.gnome.org/GNOME/glib-networking/-/raw/glib-2-80/NEWS"
distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=149a05a179e629a538be25662aa324b499d7c4549c5151db5373e780a1bf1b9a
+checksum=d8f4f1aab213179ae3351617b59dab5de6bcc9e785021eee178998ebd4bb3acf
lib32disabled=yes
From feb8b619d029c35b8f4b49e0bdc7e621f15cba6f Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Thu, 21 Mar 2024 13:57:21 -0700
Subject: [PATCH 6/6] p11-kit: update to 0.25.3.
Fixes issue where the wrong C_GetInterface may get loaded.
https://github.com/p11-glue/p11-kit/pull/535
---
srcpkgs/p11-kit/template | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/srcpkgs/p11-kit/template b/srcpkgs/p11-kit/template
index 9fd614ba8603c3..0b06cc43329435 100644
--- a/srcpkgs/p11-kit/template
+++ b/srcpkgs/p11-kit/template
@@ -1,6 +1,6 @@
# Template file for 'p11-kit'
pkgname=p11-kit
-version=0.25.0
+version=0.25.3
revision=1
build_style=meson
build_helper="qemu"
@@ -16,7 +16,7 @@ license="BSD-3-Clause"
homepage="https://github.com/p11-glue/p11-kit"
changelog="https://raw.githubusercontent.com/p11-glue/p11-kit/master/NEWS"
distfiles="https://github.com/p11-glue/p11-kit/releases/download/${version}/p11-kit-${version}.tar.xz"
-checksum=d55583bcdde83d86579cabe3a8f7f2638675fef01d23cace733ff748fc354706
+checksum=d8ddce1bb7e898986f9d250ccae7c09ce14d82f1009046d202a0eb1b428b2adc
conf_files="/etc/pkcs11/pkcs11.conf"
if [ "$XBPS_CHECK_PKGS" ]; then
@@ -26,7 +26,6 @@ else
fi
build_options="gtk_doc"
-build_options_default=""
if [ -z "$CROSS_BUILD" ]; then
build_options_default+=" gtk_doc"
next prev parent reply other threads:[~2024-03-21 21:04 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-21 20:10 [PR PATCH] " oreo639
2024-03-21 20:22 ` [PR PATCH] [Updated] [WIP] " oreo639
2024-03-21 20:23 ` oreo639
2024-03-21 20:50 ` oreo639
2024-03-21 21:04 ` oreo639 [this message]
2024-03-21 21:08 ` chrysos349
2024-03-21 21:16 ` oreo639
2024-03-21 21:18 ` oreo639
2024-03-21 21:24 ` [PR PATCH] [Updated] " oreo639
2024-03-21 21:31 ` oreo639
2024-03-22 0:15 ` oreo639
2024-03-22 0:48 ` oreo639
2024-03-22 7:29 ` oreo639
2024-03-22 7:58 ` oreo639
2024-03-22 7:58 ` oreo639
2024-03-22 8:00 ` oreo639
2024-03-22 8:03 ` oreo639
2024-03-22 8:19 ` oreo639
2024-03-22 8:20 ` oreo639
2024-03-22 8:20 ` oreo639
2024-03-22 8:20 ` oreo639
2024-03-22 8:22 ` oreo639
2024-03-22 23:13 ` [PR PATCH] [Updated] " oreo639
2024-03-23 0:09 ` oreo639
2024-03-23 0:12 ` [PR PATCH] [Updated] " oreo639
2024-03-23 0:14 ` oreo639
2024-03-24 9:14 ` oreo639
2024-04-14 8:38 ` [PR PATCH] [Updated] " oreo639
2024-04-14 21:44 ` oreo639
2024-04-17 2:23 ` oreo639
2024-04-17 2:32 ` oreo639
2024-04-17 2:37 ` oreo639
2024-04-17 2:40 ` [PR PATCH] [Updated] " oreo639
2024-04-17 2:44 ` oreo639
2024-04-17 2:46 ` oreo639
2024-04-17 2:53 ` [PR PATCH] [Updated] " oreo639
2024-04-17 2:53 ` oreo639
2024-04-17 3:21 ` oreo639
2024-04-17 3:36 ` oreo639
2024-04-17 3:47 ` [PR PATCH] [Updated] " oreo639
2024-04-17 3:49 ` oreo639
2024-04-17 23:36 ` oreo639
2024-04-18 0:28 ` oreo639
2024-04-18 3:02 ` oreo639
2024-04-18 3:25 ` [PR PATCH] [Merged]: " oreo639
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240321210456.2A1CC20281@inbox.vuxu.org \
--to=oreo639@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).