Commit Graph

30414 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
409deb0935 ci: Ignore lcov errors on source missing
When using dtrace some temporary files may be leaked as source files and
this may lead to build issues such as

  geninfo: ERROR: unable to open
    /builds/GNOME/glib/_build/.dtrace-temp.ed1c5ba9.c:
    No such file or directory

AFAIK there's no way to keep these temporary files around, so the only
thing we can do is making lcov less strict about missing files
2024-05-24 18:09:04 +02:00
Marco Trevisan (Treviño)
b55b83a5d3 ci: Add a thread sanitizer scheduled job
Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/3356
2024-05-24 17:29:22 +02:00
Marco Trevisan (Treviño)
5e03156639 build: Mark all the failing and flacky tests with thread sanitizer
Sadly many tests don't pass with thread sanitizer, but better to
mark them as such to try to fix them in the future

See also: https://gitlab.gnome.org/GNOME/glib/-/issues/1672
2024-05-24 17:29:22 +02:00
Marco Trevisan (Treviño)
0df50bb32e glib/glib-private: Mark the dynamic LSAN checks as unlikely
It's not normal to run programs with leak sanitizer enabled, so let's
mark those checks as such, in case the compiler can optimize them
2024-05-24 17:29:22 +02:00
Marco Trevisan (Treviño)
57a90fa4bc gcharset: Mark cached data as known leak
The charset data is never freed but it's something stored per thread
so we can safely ignore the leak
2024-05-24 17:29:22 +02:00
Marco Trevisan (Treviño)
468160f387 gthread: Mark data allocated with g_private_set_alloc0 as leaking
This is what we already ignored with valgrind and it's something that
we should always ignore since it's leaked by design.

So do explicitly mark it as such.
2024-05-24 17:29:22 +02:00
Marco Trevisan (Treviño)
e643126281 girepository/tests: Add tests for basic inspector operations
We don't really check the behavior here, but we do want to perform
memory tests when using sanitizers
2024-05-24 17:26:56 +02:00
Marco Trevisan (Treviño)
4689be71ea girepository/tests: Add tests for the compiler when using sanitizers
When using sanitizers we want to be able to test the compiler memory
management, so let's add some explicit tests for that.
2024-05-24 17:18:40 +02:00
Marco Trevisan (Treviño)
319c57219f girepository/tests: Add tests on compiler open/write failures 2024-05-24 17:04:07 +02:00
Marco Trevisan (Treviño)
7c9a604eb2 girepository/parser: Clarify ownership of nodetype nodes
We may had free'd a list of items without freeing the items in there.
So now, properly steal the data instead and free everything.
2024-05-24 17:01:25 +02:00
Marco Trevisan (Treviño)
bfb62e9095 girepository/compiler: Cleanup the parser error on failure 2024-05-24 17:00:33 +02:00
Marco Trevisan (Treviño)
debbf9d2d9 girepository/compiler: Cleanup the parser on write failures 2024-05-24 17:00:20 +02:00
Marco Trevisan (Treviño)
fb5a50900e girepository: Disable ASAN when building our typelib
We don't care about memory issues during this phase while we should test
this separately
2024-05-24 15:30:42 +02:00
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