Commit Graph

29368 Commits

Author SHA1 Message Date
Philip Withnall
68d5a0bef2 Merge branch '3037-log-docs' into 'main'
gmessages: Port all doc comments to gi-docgen

See merge request GNOME/glib!3801
2024-01-16 08:59:32 +00:00
Marco Trevisan
554eb407de Merge branch 'array-test-cheri' into 'main'
array-test: Don't assume sizeof(void*)==sizeof(gsize)

See merge request GNOME/glib!3827
2024-01-16 02:38:05 +00:00
Marco Trevisan
ecd67ac5fd Merge branch 'wip/pwithnall/freebsd-ci-on-main' into 'main'
ci: Re-enable and fix FreeBSD CI

See merge request GNOME/glib!3800
2024-01-16 02:37:11 +00:00
Alex Richardson
81332ab903 array-test: Don't assume sizeof(void*)==sizeof(gsize)
Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
2024-01-15 16:30:47 -08:00
Philip Withnall
35fe0d0bba Merge branch 'girrepository-cleanups' into 'main'
girepository: Misc cleanups

See merge request GNOME/glib!3823
2024-01-15 22:25:03 +00:00
Philip Withnall
2784028552 Merge branch 'brz-guintptr' into 'main'
brz.c: Use uintptr_t instead of a hardcoded list of 64-bit arches

See merge request GNOME/glib!3812
2024-01-15 22:16:00 +00:00
Philip Withnall
39f0b74a66 Merge branch 'syslog' into 'main'
gmessages: add syslog support

Closes #3207

See merge request GNOME/glib!3791
2024-01-15 21:59:19 +00:00
Marco Trevisan (Treviño)
2ee2088f4a girrepository: Drop trailing new line on GMessages 2024-01-15 21:26:53 +00:00
Marco Trevisan (Treviño)
d78b6c55bc girepository/tests: Add further checks on GObject methods infos 2024-01-15 21:26:42 +00:00
Marco Trevisan (Treviño)
18d0b0eb40 girepository: Move cmph-bdz test to tests subfolder
We can avoid to maintain the special case and still works fine
2024-01-15 21:26:40 +00:00
Alex Richardson
dd2a42cad2 brz.c: Use uintptr_t instead of a hardcoded list of 64-bit arches
This also fixes the build for AArch64 since cmph_uint32 is not big
enough to hold a pointer there. I found this while building for CHERI
since the compiler errors there when casting from a non-inptr_t integer.
This also fixes warnings when building for AArch64 with clang.
2024-01-15 13:10:32 -08:00
Philip Withnall
166f04a57f Merge branch 'gvariant-parse-detail' into 'main'
gvariant-parser: Mention annotated types

See merge request GNOME/glib!3811
2024-01-15 17:24:53 +00:00
Marco Trevisan (Treviño)
8a4755106d girepository: Add gthash test to tests and run it 2024-01-15 18:16:56 +01:00
Philip Withnall
0c9fe8156a Merge branch 'improve-set_str-documentation' into 'main'
gstrfuncs: Improve and port g_set_str() docs to gi-docgen

See merge request GNOME/glib!3810
2024-01-15 17:09:17 +00:00
Philip Withnall
c804bd781c Merge branch 'girepository-api-tweaks' into 'main'
girepository: Various small API cleanups

See merge request GNOME/glib!3805
2024-01-15 16:37:18 +00:00
Philip Withnall
12373227d1 Merge branch 'gmoduleopen_docs_clarify' into 'main'
docs: Clarify >=2.76 changes to g_module_open()

See merge request GNOME/glib!3818
2024-01-15 16:17:54 +00:00
Philip Withnall
048afc5923 Merge branch 'wip/smcv/issue3226' into 'main'
tests: Don't test --external-data with toolchains that can't do the setup

Closes #3226

See merge request GNOME/glib!3819
2024-01-15 15:41:44 +00:00
Philip Withnall
cbb29a54c3 Merge branch 'socket-test-leak' into 'main'
tests: Fix a minor leak in the socket test

See merge request GNOME/glib!3821
2024-01-15 15:32:01 +00:00
Philip Withnall
6900e0450f Merge branch '3093-gdbus-header-validation' into 'main'
gdbusmessage: Validate the types of all known message headers

Closes #3093

See merge request GNOME/glib!3748
2024-01-15 15:21:44 +00:00
Philip Withnall
dea4cc66bd Merge branch 'realloc-ub' into 'main'
gsignal.c: drop an optimization that is undefined behaviour

See merge request GNOME/glib!3806
2024-01-15 15:16:05 +00:00
Guido Günther
13a2ea7dd8 gvariant-parser: Fix links to gvariant-format doc
Also escape some function names
2024-01-15 14:39:46 +00:00
Guido Günther
d025a7f5b3 gvariant-parser: Mention annotated types
g_variant_parse() supports g_variant_printf()s type annotations which
can be needed e.g. in detailed action names.

Reference: https://gitlab.gnome.org/GNOME/gtk/-/issues/6303#note_1958300
2024-01-15 14:39:17 +00:00
Philip Withnall
528dd834a9 Merge branch 'wip/smcv/issue3225' into 'main'
gdatetime: Ignore %E modifier on 64-bit big-endian for the moment

Closes #3225

See merge request GNOME/glib!3820
2024-01-15 14:18:40 +00:00
Simon McVittie
6de98cc255 gdatetime: Ignore %E modifier on 64-bit big-endian for the moment
This doesn't appear to work reliably on s390x and ppc64, returning
the results that were expected without %E or intermittently crashing.
It seems that on little-endian 64-bit, the intptr_t returned by the
undocumented _NL_TIME_ERA_NUM_ENTRIES correctly has the number of entries
in its low-order half (at the time of writing, 0x0000'0000'0000'000b for
Japan), but on big-endian 64-bit, it has the number of entries in its
high-order half instead (for example 0x0000'000b'0000'0000 for Japan),
with the low-order half being all-zero or possibly uninitialized.

Making this reliable will require some sort of defined API from glibc.

Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/3225
Bug-Debian: https://bugs.debian.org/1060735
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-15 14:18:40 +00:00
Philip Withnall
c7ace595e8 tests: Fix a minor leak in the socket test
As seen in [CI](https://gitlab.gnome.org/GNOME/glib/-/jobs/3436216):
```
==13767== 144 (40 direct, 104 indirect) bytes in 1 blocks are definitely lost in loss record 528 of 562
==13767==    at 0x4A18B2C: g_type_create_instance (gtype.c:1928)
==13767==    by 0x49F92FF: g_object_new_internal (gobject.c:2235)
==13767==    by 0x49FA247: g_object_new_valist (gobject.c:2574)
==13767==    by 0x49F8D81: g_object_new (gobject.c:2047)
==13767==    by 0x4AE2337: g_inet_socket_address_new (ginetsocketaddress.c:387)
==13767==    by 0x4B1DB94: g_socket_address_new_from_native (gsocketaddress.c:230)
==13767==    by 0x4B16CC2: g_socket_get_local_address (gsocket.c:2071)
==13767==    by 0x40E102: test_receive_bytes_from (socket.c:2469)
==13767==    by 0x4901E78: test_case_run (gtestutils.c:2974)
==13767==    by 0x49022B2: g_test_run_suite_internal (gtestutils.c:3069)
==13767==    by 0x490241A: g_test_run_suite_internal (gtestutils.c:3088)
==13767==    by 0x4902690: g_test_run_suite (gtestutils.c:3168)
==13767==    by 0x4900C8F: g_test_run (gtestutils.c:2275)
==13767==    by 0x40EE8A: main (socket.c:2614)
```

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3220
2024-01-15 14:16:21 +00:00
Philip Withnall
1964c4f833 Merge branch 'ebassi/thread-gir' into 'main'
gir: Hide pthread types in deprecated GThread structures

Closes #3222

See merge request GNOME/glib!3815
2024-01-15 12:39:36 +00:00
Emmanuele Bassi
88251e63bb gir: Hide pthread types in deprecated GThread structures
We only care about the introspection data for documentation purposes;
the GStaticMutex and GStaticRecMutex types are long since deprecated,
and they cannot be used from language bindings anyway, so their size is
immaterial.

Fixes: #3222
2024-01-15 12:39:36 +00:00
Simon McVittie
fb5dd18f21 tests: Don't test --external-data with toolchains that can't do the setup
There are several reasons why we might not be able to do the test setup
for --external-data: non-Linux platform, missing ld or objcopy,
objcopy doesn't support --add-symbol, or the CPU family is MIPS
(on which cc -r does not necessarily emit the specific MIPS ABI flavour
that we are targeting, for example different functionality levels or
different NaN encodings).

If we can't link in the test data, then obviously this test is not going
to pass. It was already skipped on non-Linux, but not on platforms that
hit one of the other reasons for the test setup to fail.

In particular, this test failed on Debian mips64el since commit 81059169,
which stopped linking the necessary resource on MIPS platforms, but
continued to assert that the resource is present at runtime.

Fixes: 81059169 "GIO/tests: skip test_resources_binary on MIPS platform"
Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/3226
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-01-13 19:54:28 +00:00
Simon McVittie
4ba14ff28d Merge branch 'wip/smcv/manpages-but-no-gi-docgen' into 'main'
docs: Allow building man pages without the reference documentation

See merge request GNOME/glib!3817
2024-01-12 16:13:18 +00:00
Logan Rathbone
f45a58569f docs: Clarify >=2.76 changes to g_module_open() 2024-01-11 16:39:12 -05:00
Simon McVittie
aa28326b87 docs: Allow building man pages without the reference documentation
Now that the reference documentation uses gi-docgen, it's more
troublesome to generate in less standard build scenarios like
cross-compiling.

In distributions like Debian, reference documentation is generally
packaged separately (in libglib2.0-doc in Debian's case), but man pages
are generally packaged alongside the executables themselves (in the
libglib2.0-bin and libglib2.0-dev-bin packages, in Debian's case). We
can exclude the reference documentation when cross-compiling, but ideally
we would like the man pages to still be built, so that a cross-compiled
libglib2.0-bin or libglib2.0-dev-bin package has the same content as a
native build.

Signed-off-by: Simon McVittie <smcv@debian.org>
2024-01-11 15:41:34 +00:00
Marco Trevisan
38f5ba3c2f Merge branch 'docs-typo-fix' into 'main'
Fix typo in GPOINTER_TO_SIZE documentation

See merge request GNOME/glib!3814
2024-01-10 13:37:39 +00:00
Alex Richardson
7ed0fa2120 Fix typo in GPOINTER_TO_SIZE documentation 2024-01-09 08:55:32 -08:00
velsinki
51fc82a567 gstrfuncs: Improve and port g_set_str() docs to gi-docgen
Fixes link and code block and includes code syntax.

Improves documentation to be more in line with the developer guidelines.
2024-01-09 16:37:51 +01:00
Emmanuele Bassi
f09bd17e32 Merge branch 'alatiera/skip-deprecated-gthread' into 'main'
glib/deprecated: Skip all the deprecated gthread api

See merge request GNOME/glib!3808
2024-01-08 15:08:49 +00:00
Jordan Petridis
d2e6892996 glib/deprecated: Skip all the deprecated gthread api
Previously, the girs and typelibs generated from gobject-introspection
ommited the deprecated apis, however we want them annotated for
documentation purposes.

Skip the deprecated gthead api so they do not make it into the
typelibs which caused problems as not all the symbols exist.

See https://gitlab.gnome.org/GNOME/gjs/-/issues/595
2024-01-08 12:01:41 +02:00
Ekaterine Papava
7d19892f66 Update Georgian translation 2024-01-08 04:29:20 +00:00
Artur S0
ee58781c22 Update Russian translation 2024-01-07 07:55:52 +00:00
Alex Richardson
9769cd0d24 gsignal.c: drop an optimization that is undefined behaviour
Comparing reallocated pointers is UB, but this happens to work for now
on most compilers. However, for CHERI systems if g_bsearch_array_insert()
reallocs in-place then the new `hlbsa` pointer may have larger bounds
than `o` and using the old pointer with the smaller bounds can result
in a bounds error. I don't think this code is performance critical, so
removing the optimization and inserting unconditionally should be fine.

Currently, this realloc() UB rarely causes issues, but newer versions of
GCC with _FORTIFY_SOURCE=3 might also be able to observe the valid
memory range (assuming sufficient inlining).
See https://developers.redhat.com/articles/2022/09/17/gccs-new-fortification-level
2024-01-05 16:46:29 -08:00
Yegor Yefremov
c8437611f0 gmessages: add syslog support
Introduce g_log_writer_syslog() that is suitable for use as a
GLogWriterFunc and sends the log message to the syslog daemon.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2024-01-05 21:39:25 +01:00
Philip Withnall
dcf1884790 gicallableinfo: Drop const qualifier from out-args of invoke()
Not sure what it was doing there — these arguments get written to as
part of the invocation. The in-args should be `const` qualified, but not
the out-args.

This is an API break in libgirepository, but since it’s not been in a
stable release yet, that’s fine.

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

Helps: #3155
2024-01-05 13:58:37 +00:00
Philip Withnall
e49ec6d7d8 gicallableinfo: Remove unnecessary arguments from invoke()
The whole point of a `GICallableInfo` struct is to contain information
about how a function is callable, and that includes information about
whether it’s a method and whether it throws a `GError`. The caller
shouldn’t need to specify those things separately.

So drop those arguments.

This is an API break in libgirepository, but since it’s not been in a
stable release yet, that’s fine.

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

Helps: #3155
2024-01-05 13:58:37 +00:00
Philip Withnall
8e5ff50dd4 ginvoke: Fix signedness of variable in closure marshaller
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3155
2024-01-05 13:58:37 +00:00
Philip Withnall
5a56518852 girffi: Fix signedness of argument in internal helper function
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3155
2024-01-05 13:51:32 +00:00
Philip Withnall
513e178144 gitypelib: Rename gi_typelib_check_sanity() to gi_typelib_check_format()
It’s more descriptive and less offensive.

This is not an API break as it’s not a public API.

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

Helps: #3155
2024-01-05 13:51:28 +00:00
Philip Withnall
0910e2f6ad girepository: Drop outdated/unused GIInfoType member
It was deprecated since before libgirepository was moved into this
repository. Take the opportunity now to remove it entirely, as it’s a
bit confusing to have it in the public API.

This should not affect the binary typelib format, as it still has its
`BLOB_TYPE_INVALID_0` member, and that will remain in place until the
binary format next breaks compatibility (no plans to do that).

This is an API break in libgirepository, but since it’s not been in a
stable release yet, that’s fine.

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

Helps: #3155
2024-01-05 13:51:23 +00:00
Philip Withnall
64725d8cae girepository: Make gi_repository_get_shared_library() return an array
And rename it to `gi_repository_get_shared_libraries()`. Previously it
returned a comma-separated string, which wasn’t particularly typesafe or
machine-friendly. Now it returns the same data as an array.

This is an API break in libgirepository, but since it’s not been in a
stable release yet, that’s fine.

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

Helps: #3155
2024-01-05 13:51:18 +00:00
Philip Withnall
bbe9046ade girepository: Make gi_repository_get_info() not nullable
Having it be nullable means the type system forces the caller to check
the result for nullability every time, even though it’s straightforward
for the caller to check the index argument in advance and guarantee a
non-`NULL` result.

Change `gi_repository_get_info()` to never return `NULL` to tidy this
up. This also brings it inline with other `gi_*_get_info()` functions,
which are not nullable.

This is an API break in libgirepository, but since it’s not been in a
stable release yet, that’s fine.

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

Helps: #3155
2024-01-05 13:51:13 +00:00
Philip Withnall
f9e54fc991 Merge branch 'th/g-object-priv' into 'main'
[th/g-object-priv] add private data to GObject and use per-object locking

See merge request GNOME/glib!3774
2024-01-04 17:43:07 +00:00
Thomas Haller
e05623001b gobject: fix deadlock with g_weak_ref_set()
In general, we must not call out to external, unknown code while holding
a lock. That is prone to dead lock.

g_object_ref() can emit a toggle notification. In g_weak_ref_set(), we
must not do that while holding the lock.
2024-01-04 16:42:59 +01:00