From f3bf7887c7e173742ad2c6ecfbc6c9ff76e29e2b Mon Sep 17 00:00:00 2001 From: SpidFightFR Date: Thu, 19 Sep 2024 14:12:14 +0200 Subject: [PATCH] ostree: fix flatpak error fixes https://github.com/void-linux/void-packages/issues/52273 --- srcpkgs/flatpak/template | 2 +- .../ostree/patches/fix-ostree-flatpak.patch | 39 +++++++++++++++++++ srcpkgs/ostree/template | 2 +- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/ostree/patches/fix-ostree-flatpak.patch diff --git a/srcpkgs/flatpak/template b/srcpkgs/flatpak/template index 068bd960e86baf..e44fc580d6c640 100644 --- a/srcpkgs/flatpak/template +++ b/srcpkgs/flatpak/template @@ -1,7 +1,7 @@ # Template file for 'flatpak' pkgname=flatpak version=1.15.10 -revision=1 +revision=2 build_style=meson build_helper="gir" configure_args=" diff --git a/srcpkgs/ostree/patches/fix-ostree-flatpak.patch b/srcpkgs/ostree/patches/fix-ostree-flatpak.patch new file mode 100644 index 00000000000000..5ce31f59368f2a --- /dev/null +++ b/srcpkgs/ostree/patches/fix-ostree-flatpak.patch @@ -0,0 +1,39 @@ +diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c +index e9b9672..26ba6ca 100644 +--- a/src/libostree/ostree-fetcher-curl.c ++++ b/src/libostree/ostree-fetcher-curl.c +@@ -78,6 +78,7 @@ struct OstreeFetcher + struct curl_slist *extra_headers; + int tmpdir_dfd; + bool force_anonymous; ++ bool finalizing; // Set if we're in the process of teardown + char *custom_user_agent; + guint32 opt_low_speed_limit; + guint32 opt_low_speed_time; +@@ -180,6 +181,15 @@ _ostree_fetcher_finalize (GObject *object) + { + OstreeFetcher *self = OSTREE_FETCHER (object); + ++ // Because curl_multi_cleanup may invoke callbacks, we effectively have ++ // some circular references going on here. See discussion in ++ // https://github.com/curl/curl/issues/14860 ++ // Basically what we do is make most callbacks libcurl may invoke into no-ops when ++ // we detect we're finalizing. The data structures are owned by this object and ++ // not by the callbacks, and will be destroyed below. Note that ++ // e.g. g_hash_table_unref() may itself invoke callbacks, which is where ++ // some data is cleaned up. ++ self->finalizing = true; + curl_multi_cleanup (self->multi); + g_free (self->remote_name); + g_free (self->tls_ca_db_path); +@@ -528,6 +538,10 @@ sock_cb (CURL *easy, curl_socket_t s, int what, void *cbp, void *sockp) + OstreeFetcher *fetcher = cbp; + SockInfo *fdp = (SockInfo *)sockp; + ++ // We do nothing if we're in the process of teardown; see below. ++ if (fetcher->finalizing) ++ return 0; ++ + if (what == CURL_POLL_REMOVE) + { + if (!g_hash_table_remove (fetcher->sockets, fdp)) diff --git a/srcpkgs/ostree/template b/srcpkgs/ostree/template index 257d7820cb1f5e..8281e402290801 100644 --- a/srcpkgs/ostree/template +++ b/srcpkgs/ostree/template @@ -1,7 +1,7 @@ # Template file for 'ostree' pkgname=ostree version=2024.3 -revision=1 +revision=2 build_style=gnu-configure build_helper="gir" configure_args="