1
0
mirror of https://gitlab.gnome.org/GNOME/glib.git synced 2026-10-24 00:49:00 +03:00

33544 Commits

Author SHA1 Message Date
Philip Withnall
4b1a2f7b65 Merge branch 'win32-fsmonitor-rename-leak' into 'main'
Win32 file monitor: 'renamed_file' leaks on every reported rename

See merge request GNOME/glib!5427
2026-10-23 11:36:24 +00:00
Philip Withnall
56bf507a5b Merge branch 'getexecpath' into 'main'
Implement g_get_process_executable_dir() on OpenBSD

See merge request GNOME/glib!5428
2026-10-23 10:20:55 +00:00
Antoine Jacoutot
4d050db642 Implement g_get_process_executable_dir() on OpenBSD 2026-10-23 10:20:55 +00:00
Philip Withnall
47fba69865 Merge branch 'wip/pwithnall/get-process-executable-dir-freebsd' into 'main'
gutils: Implement g_get_process_executable_dir() on FreeBSD

Closes #4073

See merge request GNOME/glib!5406
2026-10-23 08:54:45 +00:00
t00mietum
8bd4d6c207 win32: Fix leak of the new name in file monitor renames
g_win32_fs_monitor_handle_event() converts the new name of a rename
to UTF-8 and passes it to g_file_monitor_source_handle_event(), which
takes it as const and copies what it keeps. Nothing freed it, so every
reported rename leaked the string.
2026-10-22 09:19:24 -07:00
Philip Withnall
925978f96f gutils: Implement g_get_process_executable_dir() on FreeBSD
I have no idea what I’m doing, and I don’t have access to a FreeBSD
system except via CI.

This implementation is based off the information on
https://frasertweedale.github.io/blog-fp/posts/2021-01-01-fixing-getExecutablePath-FreeBSD.html.

It’s possible that this implementation will work fine on other BSDs, but
since we only have a *Free*BSD CI box to test against, that’s the
platform which I’ve conditionalised this on for now.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Fixes: #4073
2026-10-22 16:34:38 +01:00
Emmanuele Bassi
8bdc9a73a4 Merge branch 'variant-docs-floating' into 'main'
gvariant: Fix transfer annotations for floating values

See merge request GNOME/glib!5407
2026-10-22 14:13:32 +01:00
Emmanuele Bassi
510d76e2da Merge branch 'log-leak-suppression-again' into 'main'
glib.supp: Mark a TLS variable as not really a leak again

See merge request GNOME/glib!5403
2026-10-22 14:13:20 +01:00
Emmanuele Bassi
23380cbf90 Merge branch 'localfile-coverage' into 'main'
glocalfile: Move file system types to a const array

See merge request GNOME/glib!5424
2026-10-22 14:13:09 +01:00
Philip Withnall
f51c1ff659 Merge branch 'update-translation-sl-from-main-bcd4a6cc-cde4-11f1-a750-0a580a830110' into 'main'
Update Slovenian translation

See merge request GNOME/glib!5425
2026-10-22 10:06:39 +00:00
Martin
bafb4ca039 Update Slovenian translation 2026-10-22 06:49:53 +00:00
Philip Withnall
03601a174c glocalfile: Move file system types to a const array
Rather than looking up the file system type with a 100-element `switch`
block, use `bsearch()`. At higher optimisation levels, modern GCC can
unwrap libc’s `bsearch()` and inline the comparison function, reducing
about 400 comparison/jump instructions to less than 30 implementing the
binary search.

See https://godbolt.org/z/cn88aado5

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2026-10-21 23:59:39 +01:00
Philip Withnall
b683d23e85 Merge branch 'gdesktopappinfo-fixes' into 'main'
Minor fixes to GDesktopAppInfo

See merge request GNOME/glib!5416
2026-10-21 18:44:43 +00:00
Ignacy Kuchciński
f310caad7a gdesktopappinfo: Handle minimal app infos when saving
Currently `g_desktop_app_info_ensure_saved()` assumes that if the object
does not have a filename, it was created with
`g_app_info_create_from_commandline()`, and therefore assumes
`info->exec`, `info->name` and `info->comment` are not NULL.

However, app info could have been also created with
`g_desktop_app_info_new_from_keyfile()`, which does not guarantee any of
those values. This results in failed assertions and broken resulting
filename, if these keys are not set in the key file.

The Name key is required by the Desktop Entry Specification, so make
`g_desktop_app_info_new_from_keyfile()` error out when the name is
missing, and check the remaining values in
`g_desktop_app_info_ensure_saved()`.
2026-10-21 14:43:08 +02:00
Philip Withnall
5c3688863c Merge branch 'main' into 'main'
Do not use recvmmsg and sendmmsg on AIX and IBM i

See merge request GNOME/glib!5419
2026-10-21 12:01:22 +00:00
Thomas Sayen
3ab1d3bd64 Do not use recvmmsg and sendmmsg on AIX and IBM i
On AIX and IBM i, `recvmmsg()` and `sendmmsg()` aren't properly exposed by
system headers: they are declared (under an `#ifdef _KERNEL` guard) but not
defined in the public symbol tables.

OpenSSL had the same issue:
https://github.com/openssl/openssl/issues/30806 and was forced not to use those
functions on these platforms (commit
4a5a074943).

Update `meson.build` to check more carefully for whether these two functions are
usable, rather than just scanning for declarations in the headers.
2026-10-21 12:01:22 +00:00
Philip Withnall
668554c414 Merge branch 'wip/otte/4049' into 'main'
Handle g_inet_address_new_from_string() returning NULL

Closes #4049

See merge request GNOME/glib!5422
2026-10-21 11:49:53 +00:00
Benjamin Otte
e0fe82f583 socks5: Handle g_inet_address_new_from_string() returning NULL
This should only happen in rare corner cases, but it can happen.

Related: #4049
2026-10-21 13:33:13 +02:00
Benjamin Otte
5965f5562d socks4: Handle g_inet_address_new_from_string() returning NULL
Related: #4049
2026-10-21 13:33:13 +02:00
Benjamin Otte
ca86751d8f docs: Improve docs for g_hostname_is_ip_address()
Mention that tis function does not guarantee
gio_inet_address_new_from_string() will succeed.

glib itself is assuming that currently.

Related: #4049
2026-10-21 13:33:13 +02:00
Philip Withnall
f8b40c1016 Merge branch 'cm/disable-fatal-gir-warnings' into 'main'
girepository: Disable fatal warnings for some g-ir-scanner calls

See merge request GNOME/glib!5420
2026-10-21 11:21:19 +00:00
correctmost
a6ff8fea9b girepository: Disable fatal warnings for some g-ir-scanner calls
The upcoming meson 1.13.0 release will make g-ir-scanner warnings
fatal when `meson setup --werror` is used. This commit sets
`fatal_warnings: false` for steps with existing introspection
warnings so --werror can continue to be used for compiler warnings.

Bug #3251 tracks the work needed to enable fatal_warnings for
girepository.
2026-10-21 11:21:19 +00:00
Philip Withnall
4b2c9a77ec glib.supp: Mark a TLS variable as not really a leak again
This is like commit ec84e18b27, but for
`calloc()` not `malloc()`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2026-10-21 12:04:44 +01:00
Philip Withnall
a435190591 Merge branch 'fix/action-query-nullable' into 'main'
gactiongroup: Annotate nullable query outputs

See merge request GNOME/glib!5421
2026-10-21 10:55:32 +00:00
Eugenio Depalo
7f104fcf95 gactiongroup: Annotate nullable query outputs
g_action_group_query_action() sets parameter_type to NULL for actions
without a parameter, state_type and state to NULL for stateless
actions, and state_hint to NULL when there is no hint. The matching
g_action_group_get_action_*() getters already mark these results as
nullable.
2026-10-20 17:18:40 +02:00
Philip Withnall
62966a3b3a Merge branch 'fix/file-enumerator-nullable' into 'main'
gfileenumerator: Annotate nullable iteration outputs

See merge request GNOME/glib!5417
2026-10-19 12:28:49 +00:00
Eugenio Depalo
8c0a7279ba gfileenumerator: Annotate nullable iteration outputs
A successful g_file_enumerator_iterate() call returns NULL outputs at
exhaustion. Optional output locations and borrowed result lifetimes
remain unchanged.
2026-10-16 21:25:25 +02:00
Ignacy Kuchciński
692e2f56f5 gdesktopappinfo: Remove unused error code path
Currently `g_desktop_app_info_set_as_default_for_type()` and
`g_desktop_app_info_set_as_last_used_for_type()` check if application's
ID is NULL, and error out accordingly.

This is because back when this mechanism was introduced in
229234111c,
app infos created with `g_desktop_app_info_new_from_filename()` would not
have application's ID set. However, since
c0af442909
and then
f065497acf
the application's ID is expected not to be empty. Moreover,
`g_desktop_app_info_ensure_saved()` guarantees it's set if it returns
true, so the error can never be returned.

Drop the unused check and error in those cases.
2026-10-15 21:37:34 +02:00
Luca Bacci
ae8632bab1 Merge branch 'win32-require-runtimeobject' into 'main'
win32: require Windows 10+ and deprecate UWP-only apps

See merge request GNOME/glib!5415
2026-10-15 10:51:54 +02:00
Philip Withnall
24f56bdafc Merge branch 'update-translation-pt-from-main-cb44043a-c7d8-11f1-b606-0a580a800050' into 'main'
Update Portuguese translation

See merge request GNOME/glib!5414
2026-10-14 21:37:04 +00:00
otaxhu
6ac3f4cf3b win32: require Windows 10+ and deprecate UWP-only apps 2026-10-14 15:31:31 -04:00
Hugo Carvalho
47832ce2d1 Update Portuguese translation
Co-authored-by: Cátia Silva <catias89@gmail.com>
Reviewed-by: Hugo Carvalho <hugokarvalho@hotmail.com>
2026-10-14 14:09:12 +00:00
Philip Withnall
41f45988ab Merge branch 'wip/chergert/ffi-call-plan-caching' into 'main'
Implement libffi ffi_call_plan caching

Closes #4002

See merge request GNOME/glib!5256
2026-10-14 12:29:24 +00:00
Philip Withnall
9c548ddbdc Merge branch 'bugaevc/hurd-get-exe' into 'main'
gutils: Implement g_get_process_executable_dir() on GNU Hurd

Closes #4074

See merge request GNOME/glib!5412
2026-10-14 12:20:13 +00:00
Sergey Bugaev
5b3b5a1a7f gutils: Implement g_get_process_executable_dir() on GNU Hurd
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2026-10-14 12:20:13 +00:00
Christian Hergert
30dfead61b gobject/gclosure: cache libffi plans for closures
If we are using libffi to trampoline then there is opportunity to cache
the ffi_call_plan introduced in newer libffi releases. A rather contrived
test introduced in the previous commit includes a basic performance test
that can compare between versions.

For my system, the average call time dropped from 200ns/call to 145ns/call
for cached GClosure. Since the previous version did no caching, the
uncached GClosure use was also just slightly slower around 205ns/call. For
the cached form (since it can reuse a global plan cache via GMutex) it
drops to 180ns/call. So that is 27.5% savings and a 10% savings in runtime
duration.

Closes: #4002
Co-authored-by: Philip Withnall <pwithnall@gnome.org>
2026-10-14 12:55:41 +02:00
Christian Hergert
c4d9e92e11 gobject/tests: add performance test for generic marshaller
The goal here is to get a baseline for upcoming performance work
to use the cached libffi plans rather than generating a new plan
on every pass through libffi.
2026-10-14 12:55:41 +02:00
Philip Withnall
f371eab5c0 Merge branch 'fix/value-reset-transfer' into 'main'
gvalue: Annotate reset result as borrowed

See merge request GNOME/glib!5410
2026-10-13 22:37:17 +00:00
Philip Withnall
42ae22073b Merge branch 'systemd-transient-scope' into 'main'
Port internal application spawning to async GTask

See merge request GNOME/glib!5350
2026-10-13 22:35:28 +00:00
John Cardullo
cd999447a0 tests: Add unit tests for g_app_info_launch_uris_async() via spawn path
Verify that g_app_info_launch_uris_async() succeeds, propagates errors,
and handles cancellation properly for spawned applications.
2026-10-13 12:32:08 -07:00
John Cardullo
7071e19ca3 gdesktopappinfo: Add g_desktop_app_info_launch_uris_with_spawn_async()
- Factor the core spawning logic into an internal helper.
- Add g_desktop_app_info_launch_uris_with_spawn_async() and _finish()
  to handle their own GTask lifecycle, cancellation, and D-Bus flushing.
- Retain g_desktop_app_info_launch_uris_with_spawn() as a synchronous wrapper
  for existing sync callers.
- Update launch_uris_bus_get_cb() to delegate to the async variant instead of
  calling the synchronous spawn function.
2026-10-13 12:32:08 -07:00
John Cardullo
f6fc9d478f gdesktopappinfo: Move session bus flush into g_desktop_app_info_launch_uris_with_spawn()
Instead of calling g_dbus_connection_flush() in callers such as
g_desktop_app_info_launch_uris_internal() and
g_desktop_app_info_launch_action(), move the flush into
g_desktop_app_info_launch_uris_with_spawn().

This makes g_desktop_app_info_launch_uris_with_spawn() self-contained
in flushing the startup notification D-Bus messages it emits.

The flush was originally added in commit d6954c78 specifically to ensure
that fire-and-forget D-Bus signals emitted for startup notification
(notify_desktop_launch()) were not dropped if the session bus connection
was unreffed immediately afterwards.

Because notify_desktop_launch() is only called in the spawn path, the
other callers do not emit startup notification signals. The D-Bus
activation paths (g_desktop_app_info_launch_uris_with_dbus() and
g_desktop_app_info_launch_action()) use method calls whose lifecycle is
managed by GTask (which holds a reference to the connection until
complete), so they do not require an explicit flush.
2026-10-13 12:32:08 -07:00
Philip Withnall
6b75321559 Merge branch 'update-translation-ka-from-main-77bb2a44-c71c-11f1-8b01-0a580a800050' into 'main'
Update Georgian translation

See merge request GNOME/glib!5408
2026-10-13 16:08:10 +00:00
Eugenio Depalo
4c7b3f488f gvalue: Annotate reset result as borrowed
g_value_reset() returns the GValue passed in, so ownership of the
storage stays with the caller. Annotate the return value as borrowed
to prevent introspection consumers from treating it as newly owned.
2026-10-13 18:02:23 +02:00
Ekaterine Papava
bc520a4ac5 Update Georgian translation 2026-10-13 15:41:04 +00:00
Philip Withnall
255b816ae7 Merge branch '4072-notification-leak' into 'main'
gfdonotificationbackend: Fix leak of a GVariant

Closes #4072

See merge request GNOME/glib!5405
2026-10-13 13:57:35 +00:00
Philip Withnall
b0d4902687 gvariant: Fix transfer annotations for floating values
`(transfer floating)` is an alias for `(transfer none)`, so most of
these changes are no-ops. But they will allow the introspection data to
be more correct when gobject-introspection eventually gains full support
for floating values.

In the case of `g_variant_new()` and `g_variant_new_va()`, this is an
introspection annotation change as previously they were implicitly
`(transfer full)`. That’s fine though as they’re both already marked as
`(skip)` so this won’t affect bindings in practical terms.

Spotted in !5405.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2026-10-13 14:46:05 +01:00
Philip Withnall
a4c0fcdf32 gfdonotificationbackend: Fix leak of a GVariant
`g_variant_builder_end()` returns a new floating reference. We don’t
want to pass a floating reference into the `before_emit()` and
`after_emit()` vfuncs, in case they sink it, so let’s sink it first and
then unref later to avoid the leak.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Fixes: #4072
2026-10-13 14:44:53 +01:00
Philip Withnall
77ca8eac89 Merge branch 'fix-get-exec-dir-win32' into 'main'
win32: Fix g_get_process_executable_dir() path resolution

See merge request GNOME/glib!5400
2026-10-12 14:43:28 +00:00
otaxhu
b7b9036bcc win32: Fix g_get_process_executable_dir() path resolution
The previous implementation incorrectly relied on
g_win32_get_package_installation_directory_of_module(), which is
designed to find the package root prefix (stripping subdirectories
like `bin/` or `lib/`).
2026-10-12 10:31:59 -04:00