Commit Graph

27766 Commits

Author SHA1 Message Date
Simon McVittie
71d44e8d71 testutils: Use prctl PR_SET_DUMPABLE to silence core dumps on Linux
Otherwise, crashing tests like assert-msg-test will still report to
pipe-based crash reporting frameworks like systemd-coredump, even though
the RLIMIT_CORE limit is zero.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-07-26 15:42:06 +01:00
Simon McVittie
be2c9220d6 testutils: Factor out g_test_disable_crash_reporting()
We're already repeating this in 4 places, and in a subsequent commit
I'll extend it to do more.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-07-26 15:41:47 +01:00
Eric van Gyzen
6b4b4cd889 Fix build race between gio subdirs and gversionmacros.h
I made the kqueue failure 100% reliable with `samu -j1` on FreeBSD,
and therefore confirmed this fixes that problem.  Issue #2929 is
an identical failure on win32, so I assume this fixes that, too,
but I haven't confirmed.

Fixes: #2929
2023-07-25 20:28:20 -05:00
Philip Withnall
e051f4abaf Merge branch 'win32' into 'main'
build-sys: drop -mms-bitfields GCC flag

See merge request GNOME/glib!3509
2023-07-24 15:52:10 +00:00
Marc-André Lureau
252bbcd207 build-sys: drop -mms-bitfields GCC flag
This flag is problematic for some usages, and is no longer needed since
~2012 GCC 4.7 (https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=a6c467624ade35128)

It is dropped from MINGW since:
https://github.com/msys2/MINGW-packages/pull/12891

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-07-24 14:45:09 +04:00
Philip Withnall
9b80774ca7 Merge branch 'fileinfo-filepath' into 'main'
gfileinfo: add file_path methods for language bindings

See merge request GNOME/glib!3461
2023-07-22 05:27:12 +00:00
Philip Withnall
be6c9fc410 Merge branch 'wip/antoniof/transfer-full-strv' into 'main'
strfuncs: Add missing ownership annotations for returned string vectors

See merge request GNOME/glib!3499
2023-07-21 21:20:58 +00:00
Jason Francis
04b683c34f gfileinfo: add file_path methods for language bindings
Including some tests by Philip Withnall.
2023-07-21 21:24:50 +01:00
Philip Withnall
b4a6343a5c Merge branch 'mcatanzaro/closure-audit' into 'main'
Audit and fix incorrect use of (closure) in glib

See merge request GNOME/glib!3287
2023-07-21 19:20:07 +00:00
Michael Catanzaro
12e48719af Fix scope annotation on g_file_move_async()
Currently the callback is invalid after the call to g_file_move_async(),
before g_file_move_finish() is called. That is no bueno.
2023-07-21 19:04:37 +01:00
Michael Catanzaro
5d738ddcfe Audit and fix incorrect use of (closure) in glib
Following Emmanuele's instructions for use of introspection annotations:

https://www.bassi.io/articles/2023/02/20/bindable-api-2023/

I have audited all uses of the (closure) annotation in glib and
determined that only a handful are correct. This commit changes almost
all of our use of (closure) annotations to conform to Emmanuele's rules.
2023-07-21 19:03:57 +01:00
António Fernandes
28dd5f017d strfuncs: Add missing ownership annotations for returned string vectors 2023-07-21 18:47:52 +01:00
Allison Karlitskaya
55abdd5e4a GVariant: add probes for SystemTap
https://bugzilla.gnome.org/show_bug.cgi?id=662779
Fixes: #473
2023-07-21 18:40:13 +01:00
Philip Withnall
3ab16a0d18 Merge branch 'libintl_fallback' into 'main'
meson: Allow forcing fallback for libintl

Closes #3048

See merge request GNOME/glib!3497
2023-07-21 16:44:56 +00:00
Allison Karlitskaya
766663dafe GPrivate: eliminate a malloc for pthread_key_t on most platforms
We don't know how big a pthread_key_t is, so we malloc() a big enough
chunk of memory for it and store a pointer into the GPrivate struct.

It turns out, on Linux, pthread_key_t is just an int, so we could much
easier just store it directly into the struct.

https://bugzilla.gnome.org/show_bug.cgi?id=737445
Fixes: #931
2023-07-21 17:12:01 +01:00
Allison Karlitskaya
256b195ff1 GPrivate: change return type of internal function
g_private_get_impl() was returning a pointer to the pthread_key_t, but every
function using this was immediately dereferencing it.  Change it so that we
dereference the value in the helper function and return it by value.

https://bugzilla.gnome.org/show_bug.cgi?id=737445
2023-07-21 17:03:31 +01:00
Michael Catanzaro
a552bf5694 Merge branch 'revert3356' into 'main'
Revert "build/gmodule-2.0.pc: Move compiler flags from Libs to Cflags"

See merge request GNOME/glib!3504
2023-07-20 15:20:58 +00:00
Philip Withnall
9cb52d9f3b Merge branch '3045-multiarch-tests' into 'main'
tests: Fix pkg-config test for multiarch binaries on multiarch systems

Closes #3045

See merge request GNOME/glib!3506
2023-07-20 13:29:51 +00:00
Philip Withnall
2b391227e6 tests: Fix pkg-config test for multiarch binaries on multiarch systems
The test was passing fine when `bindir` was equal to `multiarch_bindir`,
but not when they differ.

For example, on a Debian system, `gio-querymodules` is installed to
`/usr/lib/x86_64-linux-gnu/glib-2.0/gio-querymodules` rather than
`/usr/bin/gio-querymodules` as it is on (say) Fedora.

This was causing the pkg-config tests to fail on Debian.

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

Fixes: #3045
2023-07-20 13:30:34 +01:00
Philip Withnall
04f81e167e Merge branch 'subprojects-dir' into 'main'
meson: help gobject-introspection locate source and build dirs

See merge request GNOME/glib!3505
2023-07-20 12:22:38 +00:00
Philip Withnall
b16e682112 Merge branch 'keyfile-regression-3047' into 'main'
gkeyfile: Fix regression #3047 (group comment)

Closes #3047

See merge request GNOME/glib!3498
2023-07-20 11:59:07 +00:00
Andoni Morales Alastruey
dc37ca70fe meson: help gobject-introspection locate source and build dirs
gobject-introspection is currently assuming glib subproject
is in unversioned, but gstreamer uses a versioned directory, eg:
subprojects/glib-2.74.1 instead of subprojects/glib
2023-07-20 10:49:26 +02:00
Harald van Dijk
6e29fbec2d
Revert "build/gmodule-2.0.pc: Move compiler flags from Libs to Cflags"
This reverts commit 004f48f4fc.

Per the discussion on #3356, this change was prompted by a
misunderstanding of ldflags/link_args, and it resulted in various other
packages using glib no longer getting symbols exported. This commit
restores the glib 2.76 behaviour.
2023-07-18 18:26:49 +01:00
Marco Trevisan
674f2a030c Merge branch '3054-context-return' into 'main'
gmain: Add a missing return on error path in g_main_context_release()

Closes #3054

See merge request GNOME/glib!3501
2023-07-18 10:57:32 +00:00
Philip Withnall
c67dd9d3fe gmain: Add a missing return on error path in g_main_context_release()
This should have been in commit
3926af723a.

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

Fixes: #3054
2023-07-18 11:31:01 +01:00
Philip Withnall
741a561c4d Merge branch 'supported-platforms-docs' into 'main'
docs: Expand supported platforms documentation a little

See merge request GNOME/glib!3485
2023-07-14 11:57:03 +00:00
Brendan Shanks
d0862c3692 meson: Allow forcing fallback for libintl
Closes #3048
2023-07-13 10:02:04 -07:00
Philip Withnall
5d6c044da4 Merge branch 'wip/corey/codegen-typecheck' into 'main'
gdbus-codegen: Error on invalid dbus types

See merge request GNOME/glib!3495
2023-07-13 10:06:08 +00:00
Gaël Bonithon
51dfb3c229 gkeyfile: Skip group comment when adding a new key to a group
An oversight in 86b4b045: since the comment of group N now consists of
the last null-key values of group N-1, these keys must obviously be
skipped when adding a new non-null key to group N-1.

Closes: #3047
Fixes: 86b4b0453e
2023-07-13 10:32:18 +02:00
Gaël Bonithon
c49502582f gkeyfile: Ensure we don't add extra blank line above new group
A forgotten edge case in 86b4b045: when the last value of the last group
has been added via g_key_file_set_value() and it contains line breaks.
The best we can do in this case is probably to do nothing.

Closes: #3047
Fixes: 86b4b0453e
2023-07-13 10:32:18 +02:00
Corey Berla
a1a00a3071 gdbus-codegen: Error on invalid dbus types
Introduce slightly modified (dbus specific) versions of
variant_is_signature and variant_type_string_scan in order to fail
early on bad type strings.
2023-07-12 15:33:22 -07:00
Philip Withnall
f4df750075 Merge branch 'ptr-array-sort' into 'main'
garray: Fix typo in doc comment of g_ptr_array_sort[_with_data]()

See merge request GNOME/glib!3496
2023-07-12 12:32:43 +00:00
Alynx Zhou
57b0e72c7b garray: Fix typo in doc comment of g_ptr_array_sort[_with_data]()
Although g_ptr_array_sort_with_data() could achieve the goal, the
wrapper functions should be expected there because that's the reason
why they are added.
2023-07-11 22:42:33 +08:00
Marco Trevisan
4aa63defdf Merge branch 'ci-fetch-submodules' into 'main'
ci: Manually fetch submodules for style-check CI jobs

See merge request GNOME/glib!3494
2023-07-07 09:55:37 +00:00
Philip Withnall
11a3b5dc44
2.77.0
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-07-07 00:16:29 +01:00
Philip Withnall
840d8c3457 ci: Manually fetch submodules for style-check CI jobs
This works around GitLab issue
https://gitlab.com/gitlab-org/gitlab/-/issues/391756, which manifests as
the error message:
```
Updating/initializing submodules...
Submodule 'subprojects/gvdb' (https://gitlab-ci-token:[MASKED]@gitlab.gnome.org/GNOME/gvdb.git) registered for path 'subprojects/gvdb'
Synchronizing submodule url for 'subprojects/gvdb'
fatal: not a git repository: subprojects/gvdb/../../.git/modules/subprojects/gvdb
```
on between 1/10 to 1/2 CI runs.

See the GitLab issue for a writeup.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-07-06 16:32:44 +01:00
Marco Trevisan
4cf6c78512 Merge branch 'codegen-docs' into 'main'
gdbus-codegen: Fix some minor typos in the documentation

See merge request GNOME/glib!3477
2023-07-05 11:58:20 +00:00
Philip Withnall
9dd477dd77 Merge branch '3039-android-statx' into 'main'
glocalfileinfo: Fix incorrect use of struct statx.st_mtimensec on Android

Closes #3039

See merge request GNOME/glib!3482
2023-07-04 16:14:33 +00:00
Bruce Cowan
95624caa6c Update British English translation
(cherry picked from commit 2d3bcc9401)
2023-07-02 20:09:22 +00:00
Philip Withnall
4ef693a457 Merge branch 'gdbus-marshallers' into 'main'
gdbus-codegen: Generate specific marshallers for each required type

Closes #3028

See merge request GNOME/glib!3491
2023-07-02 16:30:21 +00:00
Marco Trevisan (Treviño)
27b7559c91 gdbus-codegen: Define only one marshaller per signature reusing across interfaces
Avoid generating more code than needed, so other than continuing using
the generic glib marshallers when possible, define once the custom ones
we need for each file we generate.

The marshallers are then re-used across all the interfaces defined
without duplicating the code size.
2023-06-30 23:40:03 +02:00
Marco Trevisan (Treviño)
23180d433e gdbus-codegen: Try to reuse default glib marshallers for simpler signals marshallers
If a signal signautre is simple enough we can just reuse the default
marshallers by simply creating a wrapper marshaller
2023-06-30 22:59:37 +02:00
Marco Trevisan (Treviño)
c5d9004236 gdbus-codegen: Use direct-access GValue macros for marshallers and GValues
This is the same we're doing in code generated by glib-genmarshaller and
what gmarshal does internally.

Since the generated gdbus C code can be considered private too, this is
safe to do, and will allow faster access to GValue objects.
2023-06-30 22:59:37 +02:00
Marco Trevisan (Treviño)
8943ceae6c gdbus-codegen: Generate marshallers for method handlers signals
Get rid completely of the usage of the generic marshaller in gdbus
generated code, using instead specific marshallers.

Code is not yet optimized fully since we may still have duplicated
functions to be generated.

Closes: https://gitlab.gnome.org/GNOME/glib/-/issues/3028
2023-06-30 22:59:37 +02:00
Marco Trevisan (Treviño)
6de362fcae gdbus-test-codegen: Add test to check that fd lists can be passed
Add a simple implementation to check that fd-passing works when using
generated code, this is going to be useful to test special marshalling
case.
2023-06-30 22:59:37 +02:00
Marco Trevisan (Treviño)
3d313147f0 gio/test-codegen: use valid interface name for FdPassing test
So that it can be ran for real, not only tested for generation
2023-06-30 22:59:37 +02:00
Marco Trevisan (Treviño)
7b750972e8 meson/gio: Increase timeout for the codegen python tests
It's adding more stuff, let's ensure it wont timeout for no reason in
some platforms.

As per this mark also it as 'slow'
2023-06-30 22:59:25 +02:00
Marco Trevisan (Treviño)
1cd5c5678a gdbus-codegen: Generate signal marshallers for each interface signal
We relied on g_cclosure_marshal_generic() to easily generate signal
marshallers, but this relies on inspecting each parameter type with ffi
and this implies a performance hit, other than breaking the stack-frame
unwinder used by Linux perf and so by sysprof.

Given that we know the types we work on, it's easy enough to generate
the marshallers ourself.

Helps with: https://gitlab.gnome.org/GNOME/glib/-/issues/3028
2023-06-30 22:17:46 +02:00
Marco Trevisan (Treviño)
51c023f189 tests/codegen: Add checks for signal emission enums
These are checked to be correct by code compilation, but let's ensure we
also have some kind of forma check on the expected syntax.
2023-06-30 22:17:46 +02:00
Marco Trevisan (Treviño)
4b05e06e1c gdbus-codegen: Address more black cleanups 2023-06-30 22:17:46 +02:00