Commit Graph

31199 Commits

Author SHA1 Message Date
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
bfeca8c13a Merge branch '3562-bytes-null' into 'main'
gbytes: Squash data to `NULL` if length is zero

Closes #3562

See merge request GNOME/glib!4445
2024-12-18 17:40:46 +00:00
Philip Withnall
d0c9c080b8
gbytes: Squash data to NULL if length is zero
This used to happen consistently before !4290, but that MR changed it so
that `data` could be non-`NULL` if `size == 0` if the new inline code
path is taken.

While users of `GBytes` shouldn’t be dereferencing the data if the
bytes’ length is zero, it’s definitely safer to make sure the data is
`NULL` in that case.

This shouldn’t break the expectations of any third party code because
it’s restoring the behaviour from before !4290.

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

Fixes: #3562
2024-12-17 17:39:23 +00:00
Philip Withnall
629733ff87 Merge branch 'work-around-meson-bugs' into 'main'
Don't define test setups unless we're testing

See merge request GNOME/glib!4442
2024-12-17 13:59:06 +00:00
Matthias Clasen
547edc4c3c Don't mark test setups as default in subprojects
This is problematic since meson is defective when it comes to
default test setups. It only allows a single such across all
(sub)projects.

See https://github.com/mesonbuild/meson/issues/12700
2024-12-17 08:18:29 -05:00
Philip Withnall
988cfb5ff1 Merge branch 'build-introspection-yield' into 'main'
build: Make the introspection feature yield

See merge request GNOME/glib!4443
2024-12-16 15:11:08 +00:00
Philip Withnall
2e48a3ffc7 Merge branch 'wip/smcv/issue3564' into 'main'
girepository: Correct --c-include arguments for GIO Unix/Windows headers

Closes #3564

See merge request GNOME/glib!4439
2024-12-16 13:44:24 +00:00
Philip Withnall
4ee1e25655 Merge branch 'pointer-param-docs' into 'main'
Fix pointer-to-paramref syntax in docs

See merge request GNOME/glib!4444
2024-12-16 12:43:05 +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
ce991fc930 Merge branch 'drop-redundant-paragraph' into 'main'
gstrfuncs: Drop a redundant paragraph

See merge request GNOME/glib!4441
2024-12-14 18:33:16 +00:00
Matthias Clasen
826bbf5b57 build: Make the introspection feature yield
This is expected by other projects who use glib as a subproject,
and there is little point in making the option a feature unless
you inherit it.
2024-12-14 12:30:49 -05:00
Emmanuele Bassi
8cf01c8f81 Merge branch 'wip/smcv/reproducible-enumtypes' into 'main'
gio, gobject: Improve reproducibility of enumtypes headers

See merge request GNOME/glib!4440
2024-12-14 15:26:54 +00:00
Adrien Plazas
c777b55d1a gstrfuncs: Drop a redundant paragraph
Signed-off-by: Adrien Plazas <aplazas@gnome.org>
2024-12-14 11:44:39 +01: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
Simon McVittie
feca93e51e girepository: Correct --c-include arguments for GIO Unix/Windows headers
The deprecated construct '@0@'.format(h) (where h is a file object)
expanded to the filename relative to the project root, which in this
particular case happens to be what we wanted:
`--c-include=gio/gunixmounts.h` resulted in a recommendation to
`#include <gio/gunixmounts.h>` and so on. Replacing it with
h.full_path() resulted in GIR XML and documentation that recommended
constructs like `#include </home/me/src/glib/gio/gunixmounts.h>`,
which is not what was intended (and caused new differences between
different architectures' Gio-2.0.gir on multiarch systems, which is
how I discovered this).

Hard-coding `gio/` and appending the basename of the header seems like
the simplest non-deprecated spelling that will do what we wanted.

Fixes: 51e3e7d9 "build: Bump Meson dependency to 1.4.0"
Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/3564
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-13 23:34:10 +00:00
Philip Withnall
bc56578a08 Merge branch 'fix_GVfsFileLookupFunc' into 'main'
Add nullable annotations for GVfsFileLookupFunc

Closes #3561

See merge request GNOME/glib!4438
2024-12-13 15:20:24 +00:00
Philip Withnall
7ac156401d Merge branch 'win32-clear-com' into 'main'
GWin32: Add g_win32_com_clear()

See merge request GNOME/glib!4392
2024-12-13 09:49:03 +00:00
Chun-wei Fan
2af6baad08 tests: Add more tests for COM refcounts
As suggested by Luca Bacci, so that we keep track of things more clearly
in terms of COM.
2024-12-13 11:09:03 +08:00
Chun-wei Fan
4ab7977a4d gwin32.h: Make g_win32_clear_com() static inline
...for C++ implementations, as suggested by Luca Bacci.

Make things safer in terms of avoiding ODR violations[1].

[1]: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4392#note_2296862
2024-12-13 11:03:32 +08:00
Chun-wei Fan
a3a95c2a0b glib/tests: Add C++ test for g_win32_clear_com()
This tests the C++ version of g_win32_clear_com() as there are some
COM interfaces that are only available in C++, such as DirectWrite from
the headers shipped with the Windows SDK.

This mimicks the test for the same function in glib/tests/win32.c but
done in a C++ fashion.
2024-12-13 10:45:09 +08:00
Chun-wei Fan
5642331603 GLib tests: Add test for g_win32_clear_com()
This mimicks the test for g_clear_object() in gobject/tests/reference.c.

We use the system's wincodec library for our sample here.
2024-12-13 10:45:09 +08:00
Chun-wei Fan
aff6b930a1 gwin32: Add g_win32_clear_com()
This is quite similar in concept to what g_clear_object() does, except
that is meant to deal with Windows COM objects. Note that there is a
separate C++ version available for this as there are COM interfaces that
are available in C++ only, such as DirectWrite that is shipped with the
Windows SDK (albeit a C interface is provided with the mingw-w64
toolchain.

This will call `->Release()` on the non-NULL COM object referenced by its
pointer  and sets the COM object to NULL; if the pointer refers to a
NULL COM object, this is a no-op.
2024-12-13 10:45:09 +08: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
Emmanuele Bassi
be72b8cc4a Merge branch 'macros-docs-escaping' into 'main'
docs: Fix some backslash escaping issues in doc comments

See merge request GNOME/glib!4437
2024-12-12 14:27:10 +00:00
Philip Withnall
553b026aa5
docs: Fix some backslash escaping issues in doc comments
None of these comments have been ported to gi-docgen format properly
yet, but let’s at least fix the backslash escaping so that
`G_DIR_SEPARATOR_S` can be documented usefully.

A full port of this file to gi-docgen format can happen in future.

Spotted on
https://discourse.gnome.org/t/escaped-char-in-glib-dir-separator-s-doc/25607.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-12 13:52:11 +00:00
Philip Withnall
ad3e0a6597 Merge branch 'tintou/gdbus-codegen-doc' into 'main'
docs: Add --generate-md to the gdbus-codegen documentation

See merge request GNOME/glib!4436
2024-12-12 11:51:49 +00:00
Corentin Noël
2021e20a8a docs: Add --generate-md to the gdbus-codegen documentation
Add it to the documentation the same way it is done for reStructured and docbook.
2024-12-12 11:51:49 +00:00
Philip Withnall
67b5a37f2b
2.83.2
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-11 17:19:24 +00:00
Philip Withnall
27426ab345 Merge branch 'wip/pwithnall/dist-faff' into 'main'
ci: Enable -Dintrospection for dist builds

See merge request GNOME/glib!4433
2024-12-11 17:15:45 +00:00
Philip Withnall
f582a0dd9c
ci: Fix output paths for docs tarballs in dist-job
Otherwise they’re not picked up as artifacts, and hence are basically
lost.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-11 15:39:40 +00:00
Philip Withnall
fe1ff50e5c
ci: Run dist-job on a schedule as well as on tags
This will allow us to test that it actually still works, which is
important for being able to make releases, because once we push a tag,
there’s no going back. The release can’t happen if `dist-job` then fails
on that tag.

Sigh.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-11 15:38:46 +00:00
Philip Withnall
cc627ea0df
ci: Clear dependencies for dist-job
Otherwise it never executes, because it’s waiting patiently for zero
dependencies to complete. 🤦

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-11 15:37:52 +00:00
Philip Withnall
e9670d3c3c
docs: Warn if building documentation without enable_gir
If `-Ddocumentation=true` is specified without
`-Dintrospection=enabled`, warn the user. They might expect the
documentation to be built, but it won’t.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-11 15:36:50 +00:00
Philip Withnall
67fb5a94b6
ci: Enable -Dintrospection for dist builds
This means that the documentation can actually be generated, which was
broken before. Building the documentation requires `enable_gir`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-11 15:36:00 +00:00
Philip Withnall
322d74b141
2.83.1
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-11 14:51:36 +00:00
Philip Withnall
ce8fb573cb Merge branch 'alatiera/add-relase-service' into 'main'
ci: Add release component to automate tarball publishing

See merge request GNOME/glib!4432
2024-12-11 14:42:47 +00:00
Philip Withnall
7b5ee8cb75
ci: Slightly improve quoting of variables
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-11 14:26:50 +00:00
Jordan Petridis
b7abe843e4
ci: Add release component to automate tarball publishing
Publishing the dist tarball to download.gnome.org is now automated.

See [1]

[1] https://gitlab.gnome.org/Teams/Websites/handbook.gnome.org/-/merge_requests/83/
2024-12-11 15:42:44 +02: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
Philip Withnall
5c63da2f9c Merge branch 'ewlsh/expose-pkg-config-gi-tools' into 'main'
girepository: Expose gi-compile-repository and gi-* tools in pkg-config

See merge request GNOME/glib!4428
2024-12-11 12:39:18 +00:00
Marco Trevisan
8447052fe3 Merge branch 'wip/sophie-h/fd-list-nullable' into 'main'
gdbus: Add nullable annotations for fd list outs

See merge request GNOME/glib!4429
2024-12-10 21:41:00 +00:00
Sophie Herold
8be0a9af5b gdbus: Add nullable annotations for fd list outs 2024-12-10 22:23:56 +01:00
Evan Welsh
bb0dd59a6b
girepository: Expose gi-compile-repository in pkg-config
Expose the binary path to gi-compile-repository similar to how
glib-compile-resources is exposed so meson and other external
tools can locate it.
2024-12-10 17:58:41 +00: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
Michael Catanzaro
a5f68ba494 Merge branch '3538-dbus-appinfo-hurd' into 'main'
tests: Skip unsupported dbus-appinfo test on GNU/Hurd for the moment

See merge request GNOME/glib!4425
2024-12-10 14:24:52 +00:00