Commit Graph

30644 Commits

Author SHA1 Message Date
Philip Withnall
f09a8e2be4
gioerror: Map EADDRNOTAVAIL to G_IO_ERROR_CONNECTION_REFUSED
Previously it was mapped (as a default) to `G_IO_ERROR_FAILED`.

It’s the error that macOS returns when trying to connect to a socket which
is bound but not listened to. Linux returns `ECONNREFUSED` in this case.
It’s helpful if they both map to the same `GIOError` value.

This should fix the `/socket-client/connection-fail` test on macOS,
which is currently
[failing](https://gitlab.gnome.org/GNOME/glib/-/jobs/3970547) with:
```
 # GLib-GIO-DEBUG: GSocketClient: Starting TCP connection attempt
 # GLib-GIO-DEBUG: GSocketClient: Connection attempt failed: Can't assign requested address
 # GLib-GIO-DEBUG: GSocketClient: Starting new address enumeration
 # GLib-GIO-DEBUG: GSocketClient: Address enumeration completed (out of addresses)
 # GLib-GIO-DEBUG: GSocketClient: Address enumeration failed: (null)
 # GLib-GIO-DEBUG: GSocketClient: Connection failed: Could not connect to localhost: Can't assign requested address
not ok /socket-client/connection-fail - GLib-GIO:ERROR:../gio/tests/gsocketclient-slow.c:231:test_connection_failed: assertion failed (local_error == (g-io-error-quark, 39)): Could not connect to localhost: Can't assign requested address (g-io-error-quark, 0)
Bail out!
```

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

See: #3184
Fixes: #3394
2024-06-13 20:00:12 +01:00
Philip Withnall
9b5f41c71b Merge branch 'wip/djz/factor-out-untranslatable-err-msgs' into 'main'
gdbus: factor out untranslatable parts of error messages

Closes #3363

See merge request GNOME/glib!4103
2024-06-13 18:30:58 +00:00
José Guilherme
efe2c24757 gdbus: factor out untranslatable parts of error messages 2024-06-13 18:30:58 +00:00
Philip Withnall
9261c03c59 Merge branch 'options' into 'main'
build: Rename meson_options.txt to meson.options

See merge request GNOME/glib!4108
2024-06-13 13:37:38 +00:00
Benjamin Gilbert
3e00a88e19 build: Rename meson_options.txt to meson.options
The new name is a bit cleaner and is supported by all versions of Meson
that we support.
2024-06-13 04:50:04 -05:00
Philip Withnall
ea58dcb538
Revert "ci: Disable dtrace/systemtap on FreeBSD CI"
This reverts commit b7a93a7ddb.

Accidentally pushed to `origin/main` without review because I typoed the
switch branch command and didn’t notice.
2024-06-10 11:03:34 +01:00
Philip Withnall
b7a93a7ddb
ci: Disable dtrace/systemtap on FreeBSD CI
It seems to have been accidentally enabled by the switch to making
dtrace a Meson feature. This has only just been caught because the
FreeBSD CI runner has been offline for several weeks (see
https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/1503).

With dtrace enabled, the FreeBSD CI build fails with:
```
[8/1601] Generating 'gobject/libgobject-2.0.so.0.8100.0.p/gobject_probes.o'
FAILED: gobject/libgobject-2.0.so.0.8100.0.p/gobject_probes.o
/usr/sbin/dtrace -G -s ../gobject/gobject_probes.d -o gobject/libgobject-2.0.so.0.8100.0.p/gobject_probes.o
dtrace: failed to link script ../gobject/gobject_probes.d: No probe sites found for declared provider
[9/1601] Generating 'glib/libglib-2.0.so.0.8100.0.p/glib_probes.h' (wrapped by meson because command contains newlines)
[10/1601] Generating 'glib/libglib-2.0.so.0.8100.0.p/glib_probes.o'
FAILED: glib/libglib-2.0.so.0.8100.0.p/glib_probes.o
/usr/sbin/dtrace -G -s ../glib/glib_probes.d -o glib/libglib-2.0.so.0.8100.0.p/glib_probes.o
dtrace: failed to link script ../glib/glib_probes.d: No probe sites found for declared provider
```
(see https://gitlab.gnome.org/GNOME/glib/-/jobs/3961782)

I have no idea how to fix that, and it’s presumably not been working for
a long time.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-06-10 11:00:31 +01:00
Philip Withnall
d5de81e440 Merge branch 'gcontenttype-win32-add-intro' into 'main'
gcontenttype-win32: Copy documetation comment from gcontenttype

Closes gobject-introspection#509

See merge request GNOME/glib!4106
2024-06-10 09:21:06 +00:00
Biswapriyo Nath
7e69f88480 gcontenttype-win32: Copy documetation comment from gcontenttype
Fixes https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/509
2024-06-09 14:30:03 +00:00
Philip Withnall
601b8b45fb Merge branch '3184-socket-client-leak-with-unit-test' into 'main'
gsocketclient: Unit test for "Fix a leak of the task data on an error path"

Closes #3184

See merge request GNOME/glib!4104
2024-06-05 12:08:33 +00:00
Johan Sternerup
61e006e16c gsocketclient: Add unit test for leak of task data in error path
The unit test cover the error path that causes the leak described in
https://gitlab.gnome.org/GNOME/glib/-/issues/3184.
2024-06-05 12:54:15 +01:00
Philip Withnall
234871f1f9
gsocketclient: Fix a leak of the task data on an error path
Once the task is completed (and `g_task_return_*()` has been called),
the task is no longer needed. It would make more sense to unref it in
`complete_connection_with_error()`, where `g_task_return_*()` is called,
but that complicates other call sites significantly, so I didn’t do it.

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

Fixes: #3184
2024-06-05 12:54:05 +01:00
Philip Withnall
2ab34d97f7 Merge branch 'wip/smcv/type-signedness-followup' into 'main'
Improve handling of standard types' signedness

See merge request GNOME/glib!4095
2024-06-04 16:45:35 +00:00
Philip Withnall
c2e7b2f3b0
girepository: Fix type of precondition return values
This fixes a compiler warning (`-Wnon-literal-null-conversion`) on
clang 13 on macOS.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-06-04 17:27:28 +01:00
Simon McVittie
7efb96d29b glib-init: Statically assert that types have appropriate signedness
Some of these are properties of a Standard C or POSIX platform that
are true by definition and checked for completeness (for example intptr_t
is defined to be signed, and uintptr_t unsigned), while others are
checking that GLib's type detection has been done correctly.

Signed-off-by: Simon McVittie <smcv@debian.org>
2024-06-04 16:57:18 +01:00
Simon McVittie
a0ed94a11d Provide private G_SIGNEDNESS_OF macro in glib-private.h
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-06-04 16:57:18 +01:00
Simon McVittie
7c41a6529b girparser: Use INTEGER_ALIAS to reduce repetition
As a special case, keep the historical behaviour of treating gchar
as being signed, both on platforms where it is genuinely signed (for
example x86 Linux) and where it is unsigned (for example ARM, s390x
and PowerPC Linux). Changing gchar to use INTEGER_ALIAS would have a
regression risk, so if we want to do that, it should be as a separate
change.

No functional change intended.

Signed-off-by: Simon McVittie <smcv@debian.org>
2024-06-04 16:57:18 +01:00
Philip Withnall
d02f5816bf Merge branch 'wip/pwithnall/gdump-tests' into 'main'
tests: Add basic tests for gdump.c in libgirepository

See merge request GNOME/glib!4102
2024-06-04 15:17:03 +00:00
Philip Withnall
5b26ef2e46
tests: Add basic tests for gdump.c in libgirepository
It’s currently completely untested. Let’s add a few basic tests so that
adding more tests in future is easier.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-06-04 15:52:05 +01:00
Philip Withnall
b1e09794f4 Merge branch 'gi_relocation' into 'main'
girepository: add support for relocations

See merge request GNOME/glib!4088
2024-06-04 14:43:02 +00:00
Philip Withnall
04697b4a95 Merge branch 'bilelmoussaoui/g-i' into 'main'
gio/g-i: Mark Application:action-group property as deprecated

See merge request GNOME/glib!4101
2024-06-04 14:38:03 +00:00
Bilal Elmoussaoui
b845d04918 gio/g-i: Mark Application:action-group property as deprecated
To avoid bindings making use of it
2024-06-04 14:38:02 +00:00
Andoni Morales Alastruey
c93c4d41e8 girepository: add default search paths tests for relocations 2024-06-04 13:00:45 +02:00
Andoni Morales Alastruey
9d0988ca62 girepository: fix find_by_type tests in macOS 2024-06-04 13:00:45 +02:00
Andoni Morales Alastruey
99382cfb4b girepository: fix autoptr tests build
In macOS compilation fails with the following error:
```
In file included from ../girepository/tests/autoptr.c:23:
../girepository/girffi.h:30:10: fatal error: 'ffi.h' file not found
```
2024-06-04 13:00:45 +02:00
Andoni Morales Alastruey
62fb5eb6d4 girepository: add support for relocations
Relocation is a common scenario in macOS applications and frameworks.
This commit provides a mechanism to support relocations by inferring
the typelib dir from the path of the loaded image libgirepository-1.0.dylib.
2024-06-04 13:00:42 +02:00
Philip Withnall
2b7678b41b Merge branch 'ebassi/pointer-types' into 'main'
Dump pointer types in the introspection blob

See merge request GNOME/glib!4098
2024-06-03 10:58:41 +00:00
Philip Withnall
5bcc6ad458 Merge branch 'glib-compile-schemas-docs-1' into 'main'
docs: Mention XDG_DATA_HOME in glib-compile-schemas manual

See merge request GNOME/glib!4100
2024-06-03 10:56:41 +00:00
Philip Withnall
24dd331c2c Merge branch 'ebassi/issue-2896' into 'main'
Build HTML versions of the man pages

Closes #2896

See merge request GNOME/glib!4090
2024-06-02 15:15:31 +00:00
Emmanuele Bassi
10fd218666 Build HTML versions of the man pages
And install them in the same directory as the API reference, so it's
possible to link them.

Fixes: #2896
2024-06-02 15:15:31 +00:00
Sebastian Dröge
59fd9b84e2 Merge branch 'fix-finish-func-annotations' into 'main'
gfile: Fix finish-func annotations

See merge request GNOME/glib!4099
2024-06-02 07:52:10 +00:00
Keyu Tao
b27e6b1a43 docs: Mention XDG_DATA_HOME in glib-compile-schemas manual
glib-compile-schemas considers XDG_DATA_HOME in addition to
XDG_DATA_DIRS since GLib 2.53.2, but this is not mentioned in its manual
and might bring confusion to readers.
2024-06-02 03:12:15 +08:00
Maximiliano Sandoval
a7557f125e
gfile: Fix finish-func annotations
The finish-func should not contain the library_class prefix.
2024-06-01 16:49:34 +02:00
Emmanuele Bassi
d242bad64e Dump pointer types in the introspection blob
Instead of skipping types that inherit from G_TYPE_POINTER, add a new
ancillary element into the raw dump that gets processed by g-ir-scanner.

See: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/470
2024-05-31 18:40:21 +01:00
Philip Withnall
2bb2595eb9 Merge branch 'docs-gtype-pointer-conversion' into 'main'
docs: Improve conversion-macros formatting and add GTYPE_TO_POINTER/GPOINTER_TO_TYPE

See merge request GNOME/glib!4092
2024-05-28 13:00:43 +00:00
Philip Withnall
ce71681f57 Merge branch 'fix-docs' into 'main'
docs: Fix docs reference to main-loop

See merge request GNOME/glib!4097
2024-05-28 09:42:56 +00:00
Tanmay Patil
37333d63d6 docs: Fix docs reference to main-loop
Signed-off-by: Tanmay Patil <tanmaynpatil105@gmail.com>
2024-05-28 14:27:43 +05:30
Matthijs Velsink
c260521056 docs: Add and use anchors in conversion-macros
The documented conversion macros don't have their own page, so can't be
linked to directly.

Instead, introduce and use anchors for them.
2024-05-27 23:31:15 +02:00
Matthijs Velsink
f2df7c3115 docs: Add GTYPE_TO_POINTER/GPOINTER_TO_TYPE
Commit d0e03f09 introduced GTYPE_TO_POINTER/GPOINTER_TO_TYPE, on which
work started before the move of conversion macros to Markdown. It did
get merged after that move, but the macros never made it into the docs.

Let's do so now.
2024-05-27 23:24:42 +02:00
Jordi Mas i Hernandez
7cf878df83 Update Catalan translation
(cherry picked from commit 0043895879)
2024-05-27 14:56:38 +00:00
Philip Withnall
c02f50f0ba Merge branch 'clear-pointer-doc' into 'main'
gmem.c: Update g_clear_pointer() documentation

See merge request GNOME/glib!4093
2024-05-24 10:16:51 +00:00
Chun-wei Fan
3f11a55983 gmem.c: Update g_clear_pointer() documentation 2024-05-24 10:16:51 +00:00
Simon McVittie
2032d150b0 Merge branch 'wip/pwithnall/macos-symlink' into 'main'
tests: Fix compilation failure on macOS due to missing include

See merge request GNOME/glib!4094
2024-05-24 09:38:08 +00:00
Philip Withnall
6187d40a0f
tests: Fix compilation failure on macOS due to missing include
It’s needed for the `symlink()` function.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-05-24 09:52:55 +01:00
Philip Withnall
60845fce0a Merge branch 'dont-rm-rf-root' into 'main'
gtestutils: Don't follow symlinks when deleting tests' tempdir

Closes #3290

See merge request GNOME/glib!4018
2024-05-23 23:08:39 +00:00
Will Thompson
56c6e28c68 Test that isolate-dirs doesn't follow symlinks during cleanup 2024-05-23 23:01:32 +01:00
Will Thompson
dc97423ead Test cleaning up unreadable temporary test directory
Neither the new nftw()-based rm_rf() implementation, nor the fallback
implementation, should fail the test if there is an error during cleanup
of the directory tree. And the output on stderr that the nftw()-based
implementation emits should not interfere with Meson parsing the TAP
stream on stdout.

The test is run in a subprocess so that we can clean up after ourselves.
2024-05-23 23:01:32 +01:00
Philip Withnall
31c85d3985 Merge branch 'gpattern-docs' into 'main'
gpattern: Port the docs to gi-docgen syntax

See merge request GNOME/glib!4081
2024-05-23 09:55:32 +00:00
Philip Withnall
d6abaf7921
gpattern: Port the docs to gi-docgen syntax
And make a few formatting fixes.

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

Helps: #3250
2024-05-23 10:36:50 +01:00
Philip Withnall
4fde1a6cfc Merge branch 'ebassi/override-test-c_args' into 'main'
build: Use C89 for the standard version check

See merge request GNOME/glib!4091
2024-05-23 08:53:00 +00:00