Commit Graph

8949 Commits

Author SHA1 Message Date
Michael Catanzaro
55fbcb21d9 Merge branch 'autorelease-urlspec' into 'main'
Use autorelease pool to manage cocoa memory.

Closes #3568

See merge request GNOME/glib!4448
2024-12-22 00:49:56 +00:00
John Ralls
d3705ecdcf g_osx_appinfo_launch: Use autorelease pool to manage cocoa memory.
Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/3568
2024-12-21 13:12:41 -08:00
Philip Withnall
fbe324086e Merge branch 'unix-mounts-docs' into 'main'
gunixmounts: Clarify GUnixMountMonitor documentation and convert to gi-docgen linking syntax

Closes #3569

See merge request GNOME/glib!4447
2024-12-20 18:40:04 +00:00
Philip Withnall
46160f9aad
gunixmounts: Convert docs to gi-docgen linking syntax
Improve formatting while I’m there, and try and ensure all the docs in
these two files matches the
[guidelines](https://developer.gnome.org/documentation/guidelines/devel-docs.html#writing-api-references).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3250
2024-12-20 15:11:41 +00:00
Philip Withnall
12f969eb79
gunixmounts: Consistently capitalise Unix in the documentation
Let’s not go with SHOUTY UNIX or quiet unix, let’s just call it what
Wikipedia calls it (https://en.wikipedia.org/wiki/Unix).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-20 12:42:58 +00:00
Philip Withnall
05afb30510
gunixmounts: Document caveats with *_changed_since() APIs
They need a `GUnixMountMonitor` to give valid timestamps, and if you
have one of those then you might as well listen to its signals anyway.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #3569
2024-12-20 12:34:12 +00:00
Philip Withnall
2f010f5618
gunixmounts: Fix typo in deprecation documentation
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-20 12:25:22 +00:00
Philip Withnall
5029f3aae9
gio: Fix a link to a specifications document
If only someone would go ahead and invent a whole section of the list of
HTTP status codes which could be used to inform a client of where a
document has been moved to.

For the sake of argument, let’s say it could be status codes 300–399,
since they appear to be completely unused at the moment.

😩

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-19 23:09:17 +00:00
FeRD (Frank Dana)
9f016e5de4 Fix pointer-to-paramref syntax in docs
The documentation for GLib and Gio contains a number of documentation
comment blocks where a parameter reference (e.g. `@err`) is also
discussed in its dereferenced pointer form, which is generally
annotated as `*@err`. This inevitably confuses the MarkDown parser,
which sees the `*` as the beginning of an italicized text span.

To avoid this, replace all `*@foo` with <code>`*foo`</code>, which
loses the `@`-sigil linking it to the `@foo` parameter, but formats
correctly in the rendered documentation. (`@foo` is automatically
formatted like <code>`foo`</code>, so the resulting appearance in
the docs is as intended.)
2024-12-15 18:51:26 -05:00
Simon McVittie
a4d084e975 gio, gobject: Improve reproducibility of enumtypes headers
`@filename@` expands to the (absolute or relative) path from the
build directory to the source directory, which can be rather verbose.
In practice Meson usually (always?) generates a relative path, but
even so, the resulting installed header is not necessarily reproducible
if using different build directories outside the source directory.

We don't really need a full path here anyway: the basename is enough
of a hint to point a reader towards the file where the underlying
enum was defined.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-13 23:40:32 +00:00
fbrouille
d9844472a8 Add nullable annotations for GVfsFileLookupFunc
Add the nullable annotation on the parameter 'user_data'
and fix the description.
Add the nullable annotation on the return value.

Fixes #3561
2024-12-12 21:52:32 +00:00
Philip Withnall
cfa36f5e96 Merge branch '3559-revert-dbus-method-invocation-refcounting' into 'main'
Revert "gdbus: Fix leak of method invocation when registering an object with closures"

Closes #3559

See merge request GNOME/glib!4427
2024-12-11 12:41:16 +00:00
Sophie Herold
8be0a9af5b gdbus: Add nullable annotations for fd list outs 2024-12-10 22:23:56 +01:00
Philip Withnall
2442b370b4
gdbusconnection: Document existing refcount semantics of closures
As per the previous few commits, explicitly document the established
reference counting semantics of the method call closure for
`g_dbus_connection_register_object_with_closures()`.

This isn’t ideal, but
`g_dbus_connection_register_object_with_closures()` has had these
semantics for 10 years now, and it’s a bit late to change them to
something neater.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3559
2024-12-10 16:59:33 +00:00
Philip Withnall
25cbde1e16
gdbusconnection: Add a comment explaining why an invocation is ‘leaked’
It’s not leaked, it’s transferred forwards to the eventual
`g_dbus_method_invocation_return_*()` call.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3559
2024-12-10 15:59:04 +00:00
Philip Withnall
4641535596
Revert "gdbus: Fix leak of method invocation when registering an object with closures"
This reverts commit 092fedd5f0.

This was not the right change to make, and I shouldn’t have accepted the
MR. The situation is laid out in this comment:
https://gitlab.gnome.org/GNOME/glib/-/issues/2600#note_1385050

tl;dr: The reference on the `GDBusMethodInvocation` which is transferred
in to the `GDBusInterfaceMethodCallFunc` is balanced by a reference
transferred to `g_dbus_method_invocation_return_*()`. This is how the
refcounting has always worked for these functions, and even if we’d
probably arrange things differently if the code was written now, we
can’t change those semantics without breaking API.

In particular, bindings have various bits of custom code to account for
these reference tranfers (since they can’t be represented using
gobject-introspection annotations), so changing the semantics will break
bindings.

Fixes: #3559
2024-12-10 15:53:54 +00:00
Philip Withnall
8c3fda5c8d
tests: Skip unsupported dbus-appinfo test on GNU/Hurd for the moment
Parts of the `dbus-appinfo` test need support for converting an FD to a
path, and Hurd doesn’t currently allow that (see
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4396#note_2279923).

Since there’s no fix for that visible in the medium term (new kernel
APIs will need to be added), skip parts of the `dbus-appinfo` test which
require that functionality for now.

This prevents the whole test from failing, and means we can usefully get
results from the parts of it which don’t depend on converting FDs to
paths.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3538
2024-12-10 11:47:43 +00:00
Michael Catanzaro
c5f9eb51a2 Merge branch 'gio-tool-mount-docs' into 'main'
gio-tool: Clarify that `gio mount -l` only lists user-interesting things

See merge request GNOME/glib!4423
2024-12-09 14:32:21 +00:00
Philip Withnall
fa33e232d2
gio-tool: Clarify that gio mount -l only lists user-interesting things
It doesn’t list all mounts, only the ones you’d expect to see in a file
chooser sidebar.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3555
2024-12-08 23:03:07 +00:00
Martin Domig
70fe6839a5 Fix typo in test_extended_schema
Signed-off-by: Martin Domig <martin.domig@wolfvision.net>
2024-12-08 22:15:03 +01:00
Martin Domig
d63d27b195 Add test for g_settings_schema_has_key on extended schema
The test checks that the keys of the base schema do all exist in the
extended schema.

Signed-off-by: Martin Domig <martin.domig@wolfvision.net>
2024-12-08 22:13:51 +01:00
Johannes Marte
58f9667def GSettingsSchema: fix g_settings_schema_has_key()
A settings schema that extends another schema should return TRUE for
all keys that are present in the extended schema. The list of keys
returned by list_keys() already includes these,
so it makes sense to include them in has_key().

Signed-off-by: Johannes Marte <johannes.marte@wolfvision.net>
2024-12-06 08:06:18 +01:00
Philip Withnall
f3a82ba866 Merge branch 'gdbus-missing-nullable' into 'main'
gdbus: Add a few missing `(nullable)` annotations to GDBus method invocation related functions

See merge request GNOME/glib!4414
2024-12-04 08:37:40 +00:00
Sebastian Dröge
f5678377c0 gdbus: Add a few missing (nullable) annotations to GDBus method invocation related functions
Sender can be NULL if not specified by the caller, e.g. on peer-to-peer
connections.

Interface name can be NULL on method calls if it was not specified by
the sender.

Both is explicitly allowed by the DBus specification.
2024-12-03 06:22:52 +00:00
Sebastian Dröge
092fedd5f0 gdbus: Fix leak of method invocation when registering an object with closures
The invocation passed in is owned by the callback.
2024-12-02 16:46:17 +00:00
Philip Withnall
c64f82fa79 Merge branch 'wip/pwithnall/procfs-refactor' into 'main'
tests: Factor out a function to convert FD to path

See merge request GNOME/glib!4396
2024-11-26 12:06:28 +00:00
tytan652
9335698b87 gdbusconnection: Allow creating connection with cross-namespace 2024-11-25 17:42:27 +01:00
Philip Withnall
2b155f86dd Merge branch 'update-macos-min' into 'main'
Raise minimum supported macOS version to 10.13 (High Sierra)

Closes #3441

See merge request GNOME/glib!4405
2024-11-21 11:13:04 +00:00
John Ralls
9bbb1acd7d Raise minimum supported macOS version to 10.13 (High Sierra).
Allows removing all macOS version ifdefs.

Closes https://gitlab.gnome.org/GNOME/glib/-/issues/3441
2024-11-20 18:15:34 -08:00
Philip Withnall
ccee4c2342 Merge branch 'feature/gresource-static-validate-args' into 'main'
gio/gresource: validate args of g_static_resource_init

Closes #3517

See merge request GNOME/glib!4372
2024-11-19 18:10:18 +00:00
Philip Withnall
dfe252429c Merge branch 'uninstalled_variables' into 'main'
meson: Add variables to -uninstalled.pc files

See merge request GNOME/glib!4399
2024-11-19 12:01:06 +00:00
Philip Withnall
0a48bfe79a
tests: Factor out a function to convert FD to path
This could potentially eventually become a public GLib API, but there
doesn’t seem to be a huge need for it right now (e.g. this file contains
the only use of `/proc/self/fd/%d` in GLib), so let’s keep it private
for now and avoid committing to API stability just yet.

This gives time for other platforms to add their platform-specific
implementations for it too, if they need. I’ve added a couple of
pointers to what I *think* the right APIs might be, from my research,
but I have not prototyped those implementations.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-11-19 11:54:25 +00:00
Sebastian Geiger
ccf4403e39 gio/gresource: validate args of g_static_resource_init
Signed-off-by: Sebastian Geiger <sbastig@gmx.net>
2024-11-17 13:18:06 +01:00
Benjamin Otte
33b9338fb0 converteroutputstream: Raise error for data at end
When a conversion is finished, the code would return 0 from its write
vfunc. This is disallowed by the API of g_output_stream_write() and
causes g_output_stream_splice() as used by g_converter_convert_bytes()
to turn into an infinite loop.

Instead, raise a G_IO_ERROR_MESSAGE_TOO_LARGE error so that the calling
code can decide how to deal with it.

Testcase included.

Closes #3532
2024-11-16 07:46:24 +00:00
Xavier Claessens
0b776bc20c meson: Add variables to -uninstalled.pc files
This allows building a glib project within glib's devenv. Otherwise
Meson won't find glib tools.
2024-11-13 11:07:12 -05:00
Philip Withnall
7dacfa7799 Merge branch 'wip/hadess/test-warning-fix' into 'main'
appmonitor: Fix warning building test

See merge request GNOME/glib!4395
2024-11-13 13:40:45 +00:00
Gleb Popov
6d67568da3 Replace procfs linuxism with kinfo freebsdism 2024-11-13 13:29:01 +00:00
Bastien Nocera
48b980ca7d appmonitor: Fix warning building test
gio/tests/appmonitor.c: In function ‘timeout_cb’:
gio/tests/appmonitor.c:95:14: warning: null pointer dereference [-Wnull-dereference]
   95 |   *timed_out = TRUE;
2024-11-13 14:24:50 +01:00
Arjan Molenaar
6e4b70e062 macos: content-type tests should succeed 2024-11-09 13:42:47 +01:00
Arjan Molenaar
bc8b7041a9 macos: Add extra content type tests 2024-11-08 22:34:38 +00:00
Philip Withnall
dbb42933f8 Merge branch 'faccessat-bsd' into 'main'
glocalfile: Disable faccessat()-based query_exists on FreeBSD

See merge request GNOME/glib!4366
2024-11-06 13:13:01 +00:00
Sid
9e29968183 gtask: Fix comment for auto task naming via 'g_task_set_source_tag()' 2024-11-06 11:34:09 +00:00
Arjan Molenaar
6cb13b153c macos: Remove extraous space from type identifier 2024-11-04 16:31:36 +00:00
Emmanuele Bassi
7abfef8e06 Merge branch 'wip/pwithnall/fix-unix-mounts-tests-deprecations' into 'main'
tests: Fix calls to deprecated API in unix-mounts tests

See merge request GNOME/glib!4367
2024-11-04 16:27:12 +00:00
correctmost
5b2da7ecb3 gio: Fix GFileEnumerator leaks in gio tools 2024-11-03 12:22:01 -05:00
Gleb Popov
02172bda73 Enable GNetworkMonitorNetlink on FreeBSD 2024-10-29 21:18:36 +03:00
Philip Withnall
c14810e08f
tests: Fix calls to deprecated API in unix-mounts tests
This fixes commit aac56f1618 — I missed
this while reviewing it, but the unit tests were partially changed to
call the new APIs, without being fully changed. This caused the build to
succeed on Linux, but fail on macOS due to using a deprecated API.

Actually, a better approach for the unit tests would be to consistently
call the *old* APIs, as they all immediately call the new APIs. Then we
get coverage of both old and new for free, at the cost of putting
`G_GNUC_BEGIN_IGNORE_DEPRECATIONS` at the top of the test file.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3492
2024-10-22 16:15:18 +01:00
Philip Withnall
e795c715b5 Merge branch 'fix-namespace-UnixMountEntry' into 'main'
UnixMountEntry: Deprecate g_unix_mount_* API in favor of g_unix_mount_entry_* API for GUnixMountEntry methods

Closes #3492

See merge request GNOME/glib!4337
2024-10-22 14:48:12 +00:00
Jialu Zhou
aac56f1618 UnixMountEntry: Deprecate g_unix_mount_* API in favor of g_unix_mount_entry_*
This issue arises because the g_unix_mount_* naming convention does not match
the GUnixMountEntry instance type, confusing the introspection generator.

To resolve this, we are deprecating the g_unix_mount_* API functions that take
a GUnixMountEntry parameter and introducing equivalent g_unix_mount_entry_*
functions that correctly associate with the GUnixMountEntry instance. This change
ensures that introspection data correctly treats these as instance methods and
that documentation reflects proper ownership of returned data.

(Some minor tweaks by Philip Withnall.)

Fixes: #3492
2024-10-22 15:31:52 +01:00
Philip Withnall
ad67d4e833
glocalfile: Disable faccessat()-based query_exists on FreeBSD
It appears not to work, and nobody interested in FreeBSD has picked it
up to investigate yet.

Rather than have a completely broken implementation of
`g_file_query_exists()` on FreeBSD, let’s settle for using the old one.
It’s slightly slower than the new one, but has worked fine for people
for years.

This essentially reverts commit 65ad41d8a4
on FreeBSD. This commit can be reverted when a FreeBSD person
investigates what’s going wrong with the `faccessat()`-based
implementation.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3495
2024-10-22 13:37:55 +01:00