Commit Graph

30401 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
5ca20f7dc0 girepository: Always use currently built GLib to run g-ir-scanner
If we use the system libraries we can't really debug it, so ensure we're
using the currently built libraries for it too.

We're doing it globally to ensure that we're testing the result that
this version of the libraries are building
2024-05-24 15:27:53 +02:00
Marco Trevisan (Treviño)
5d607e148e ci: Add ASAN sanitizer job that runs on schedules
In this job we also want to test that just running `meson test` just
works without having to build the test dependencies manually

Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/3356
2024-05-24 13:27:15 +02:00
Marco Trevisan (Treviño)
36ad38062b ci/fedora.Dockerfile: Add libtsan depedencies
It's needed for thread sanitizer tests
2024-05-23 19:34:21 +02:00
Marco Trevisan (Treviño)
80e747c170 ci/fedora.Dockerfile: Add libasan and libubsan depedencies
They allow address sanitizer tests
2024-05-23 19:34:21 +02:00
Marco Trevisan (Treviño)
78701e91ac gio/gsocket: Ignore GCancellableSource leak
As per issue #2309 the cancellable source may not be ever released,
making this code to fail in address sanitizer, so mark the location as a
leaking one to prevent tests using it to fail
2024-05-23 19:34:21 +02:00
Marco Trevisan (Treviño)
e07f8a807a meson: Preload sanitizer libraries before than any other library
In some test cases (but not only) GLib needs to preload libraries when
launching executables, however this doesn't work well with ASAN because
libasan needs to be the first library to be loaded in such case.

We've been ignoring the error so far, using verify_asan_link_order=false
ASAN option, but this is not the correct way because it implies that
we don't check any pre-loaded library, as we instead should.

So in the platforms we know, get the proper sanitizer libraries paths
and pre-load them when required.

We don't do it for installed tests since the full paths may change in
the target system, so ignoring the error is safer.

This meson code has been used for various years now in fprintd project
to run tests in CI in both fedora and debian-based systems with no
issues, so I consider it reliable.

In case no preload variables are found the default ignore mode is used
2024-05-23 19:34:21 +02:00
Marco Trevisan (Treviño)
8a9e510d4c build/tests: Automatically set ASAN_OPTIONS if preloading is required
If preloading a library is required asan doesn't work properly because
it requires to be the first loaded library to test everything, however
the behavior can be worked around using an ASAN_OPTIONS variable, so do
this to prevent the tests to fail completely

But instead of having to do it at test level, manage this at wider scope
2024-05-23 18:53:46 +02:00
Marco Trevisan (Treviño)
ab2e68cf75 build: Define the preload variable name and separator globally
We may need this in multiple tests, so let's share the value
2024-05-23 18:53:45 +02:00
Marco Trevisan (Treviño)
0e97aade66 build: Add quotes to installed test variables
The value may contain spaces, so we need to quote them or we may
consider values as arguments
2024-05-22 19:18:24 +02:00
Marco Trevisan (Treviño)
e59f777a80 gio/tests/gsocketclient-slow: Do not hard code the pre-loaded library name
Get the values from meson instead of doing all this manually
2024-05-22 19:18:24 +02:00
Marco Trevisan (Treviño)
419e5b971b glib, gio tests: Apply the same rules to both gcc and clang when appropriate 2024-05-22 19:18:24 +02:00
Marco Trevisan (Treviño)
0dec04c504 build: Add variable to check if a GNU C compiler is used
This applies to both gcc and clang, without having to repeat the same
check multiple times and involving strings
2024-05-22 19:18:24 +02:00
Philip Withnall
dc24e78286 Merge branch 'gobject_fix_links_to_param_name_rules' into 'main'
gobject: fix broken links to parameters and signals naming rules

See merge request GNOME/glib!4083
2024-05-21 22:32:21 +00:00
gwillems
d6e0cf9884 gobject: fix broken links to parameters and signals naming rules 2024-05-21 22:32:20 +00:00
Philip Withnall
317739c8e2 Merge branch 'ebassi/revert-bool-constants' into 'main'
Revert "Alias TRUE and FALSE to C99's true and false"

See merge request GNOME/glib!4089
2024-05-21 22:31:14 +00:00
Emmanuele Bassi
db419ffbde Revert "Alias TRUE and FALSE to C99's true and false"
This reverts commit 67d89a5a87.

Turns out that C++ doesn't like it when stuff goes from an integer to a
boolean.

See: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/merge_requests/2900
2024-05-21 21:56:04 +01:00
Emmanuele Bassi
af7c7c0495 Merge branch '3369-dead-links' into 'main'
docs: Fix broken links in gdbus-codegen documentation

Closes #3369

See merge request GNOME/glib!4086
2024-05-21 10:27:29 +00:00
Philip Withnall
38d21dcbfa Merge branch 'wip/pwithnall/musl-systemtap' into 'main'
ci: Disable systemtap on musl CI build

See merge request GNOME/glib!4087
2024-05-21 10:09:55 +00:00
Philip Withnall
9e8b0f6730
ci: Disable systemtap on musl CI build
It’s not needed, and is now failing with:
```
meson.build:2578:36: ERROR: Feature systemtap cannot be enabled: Cannot enable systemtap because dtrace feature is disabled
A full log can be found at /builds/GNOME/glib/_build/meson-logs/meson-log.txt
```

See https://gitlab.gnome.org/GNOME/glib/-/jobs/3901860

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-05-21 10:44:50 +01:00
Andre Klapper
9dae1dc62f DOAP: Link to GitLab Issues instead of New Issue URL
When not logged in, the New Issue URL only redirects to an unhelpful
login page while the Issues page allows you to search for existing
issues and still offers a "New Issue" button.
2024-05-20 17:36:29 +02:00
Philip Withnall
3472a51dc6 Merge branch 'wip/jtojnar/strfunc-docs' into 'main'
docs: Improve g_strescape & g_strcompress descriptions

See merge request GNOME/glib!4084
2024-05-20 15:16:07 +00:00
Philip Withnall
f5322fdfa8 Merge branch 'ebassi/issue-3372' into 'main'
build: Add docs.c to the GLib GIR

Closes #3372

See merge request GNOME/glib!4085
2024-05-20 15:06:59 +00:00
Philip Withnall
066a2cd8cc
docs: Fix broken links in gdbus-codegen documentation
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #3369
2024-05-20 13:50:46 +01:00
Emmanuele Bassi
e7ef715883 build: Add docs.c to the GLib GIR
For historical reasons, some doc blocks are included in an ancillary
file. Add it to the list of sources parsed by g-ir-scanner, to increase
the coverage of various macros.

Fixes: #3372
2024-05-20 13:34:19 +01:00
Jan Tojnar
c068c1cd74 docs: Remove hex escape mention in gvariant-text-format bytestring
bytestring_parse does not actually support hexadecimal escape sequences.
2024-05-20 13:31:03 +01:00
Balázs Úr
974b89e707 Update Hungarian translation 2024-05-19 10:19:18 +00:00
Jan Tojnar
460a9c299c docs: Adjust gvariant-text-format reference on bytestring escapes
- Do not refer to people’s expectation, they can wildly differ.
- Do not link to `strcompress`, that confusingly does not support `\a`. Link Wikipedia instead.
- Reiterate the C escape sequences from string section, they are not that many.
- Mention escaping newline and other characters (also copied from string section).
- Mention Unicode escapes not being supported to contrast with strings.
2024-05-19 00:55:45 +02:00
Jan Tojnar
32b8a8400d docs: Link Wikipedia on C escapes in gvariant-text-format for strings
Unlike in the bytestring section there is no link to explanation.
2024-05-19 00:55:45 +02:00
Jan Tojnar
56d8f14ab2 docs: Correct octal format in gvariant-text-format
There is no o or 0 prefix, just one to three octal numbers.
2024-05-19 00:31:25 +02:00
Jan Tojnar
701412530b gstrfuncs: Remove g_strescape docs from the header
They are not visible in the API reference with gi-docgen.
2024-05-18 23:34:20 +02:00
Jan Tojnar
c167562b38 docs: Describe g_strcompress processing
GVariant Text Format section on bytestrings links to `g_strcompress`
but what it does was only briefly described in the header file,
which is not visible in the gi-docgen-built reference. To really
find out one would have to guess to continue through the rabbit hole
to `g_strescape`.

Let’s merge the description from the header and elaborate on it a bit.
2024-05-18 23:31:59 +02:00
Jan Tojnar
4acedc8669 docs: Improve g_strescape description wording
Saying that it inserts a backslash before special character is incorrect
for anything but a double quote and backslash itself. Instead, it replaces
the special characters with a C escape sequence.

Let’s fix that and also make it less C focused by using Unicode names
of the characters instead of assuming everyone knows C escape sequences
by heart.
2024-05-18 23:00:21 +02:00
Jan Tojnar
275330009a docs: Fix g_strescape rendering escape sequences
In the gi-docgen Markdown flavour, \' will just prevent the apostrophe
from turning into a curly single quote.
2024-05-18 22:55:58 +02:00
Michael Catanzaro
c88cbd06de Merge branch 'mcatanzaro/#3354' into 'main'
Convert dtrace and systemtap to feature option type, and fix sysprof option

Closes #3354

See merge request GNOME/glib!4076
2024-05-17 20:38:17 +00:00
Michael Catanzaro
329a69e558 Change sysprof build option default value to 'auto'
Now sysprof can be enabled by default in distros that use
-Dauto_features=enabled or for developers who already have sysprof
installed, while it's still disabled for developers who do not have
sysprof installed. See #3354
2024-05-17 15:22:41 -05:00
Michael Catanzaro
153cda6669 Convert systemtap from bool to feature option type
Now systemtap can be enabled by default in distros that use
-Dauto_features=enabled or for developers who already have systemtap
installed, while it's still disabled for developers who do not have
systemtap installed. See #3354
2024-05-17 15:22:41 -05:00
Michael Catanzaro
ed020a688a Convert dtrace from bool to feature option type
Now dtrace can be enabled by default in distros that use
-Dauto_features=enabled or for developers who already have dtrace
installed, while it's still disabled for developers who do not have
dtrace installed. See #3354
2024-05-17 15:22:41 -05:00
Philip Withnall
04de380f74 Merge branch 'wip/smcv/gdbusconn-comment' into 'main'
gdbusconnection: Fix a misleading comment

See merge request GNOME/glib!4063
2024-05-16 23:42:06 +00:00
Philip Withnall
5b1817c07b Merge branch 'wip/smcv/more-gdbus-constants' into 'main'
gdbus: Make more use of symbolic constants for various aspects of the D-Bus protocol

See merge request GNOME/glib!4069
2024-05-16 23:27:02 +00:00
Philip Withnall
04a6ee3e9b Merge branch 'wip/3v1n0/gi-repository-leak-fixes' into 'main'
girepository/build: Actually use our compiler to generate GLib typelibs and fix parser leaks

See merge request GNOME/glib!4064
2024-05-16 23:15:16 +00:00
Philip Withnall
52e850d54c Merge branch 'ebassi/i18n-docs' into 'main'
Document the magic gettext macros in gi18n.h

Closes #3361

See merge request GNOME/glib!4071
2024-05-16 22:27:48 +00:00
Philip Withnall
5433bb23a0 Merge branch '3303-girepository-typelib-determinicity' into 'main'
girepository: Keep an ordered list of the loaded typelibs

Closes #3303

See merge request GNOME/glib!4033
2024-05-16 22:27:01 +00:00
Simon McVittie
434c105bbe gdbusconnection: Fix a misleading comment
While backporting CVE-2024-34397 fixes I noticed that this comment
claimed that the reference count is immutable after construction, which
is clearly not true. In fact the reference count is the only
mutable field.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-16 22:53:11 +01:00
Simon McVittie
510d0716be gdbus: Use symbolic constants for the most common D-Bus error names
To avoid adding a large block of macros to gdbusprivate.h, I've only
added a subset of the well-known error names. I chose to draw the
line by adding constants for the errors emitted via their string names
in GDBusConnection, but not for error names that are only mentioned
in `gdbuserror.c` or in tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-16 22:52:23 +01:00
Simon McVittie
7c609f8142 gdbus: Use symbolic constants for interfaces from dbus-specification
Most D-Bus interfaces are domain-specific, but these interfaces from the
D-Bus Specification are intended to be commonly used in any context for
which they are found to be appropriate.

Most of these use `gdbusprivate.h`. One exception is that
`gio/tests/gdbus-example-*` redefine the constants locally: due to these
files' dual role as part of the unit tests and as sample code, it seems
desirable to ensure that they can still be compiled outside GLib.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-16 22:52:23 +01:00
Simon McVittie
b4f8d4a5d5 gdbus: Use symbolic constants for the reserved Local path and interface
These are reserved by the D-Bus Specification.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-16 22:52:23 +01:00
Simon McVittie
7401577074 gdbus: Move protocol constants from gdbusdaemon into gdbusprivate.h
These well-known flags and replies are part of the D-Bus Specification,
and also exist with the same names in libdbus header files.
Moving them into a private header means that unit tests like
gdbus-proxy-threads and gdbus-subscribe don't have to reinvent them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-16 22:52:23 +01:00
Simon McVittie
b0e8612a3b gdbusdaemon: Use shared constants for message bus name, path, interface
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-16 22:52:23 +01:00
Simon McVittie
131a061aca gdbus: Use symbolic constants for various references to the message bus
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-16 22:52:23 +01:00
Simon McVittie
19223803f5 gdbus: Use symbolic constants to subscribe to message bus signals
Unlike the various functions to call D-Bus methods, these sort their
arguments in a non-obvious order (bus name, interface, signal, path),
presumably aiming to sort the most-likely-to-be-used arguments first.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-16 22:52:23 +01:00