Commit Graph

28953 Commits

Author SHA1 Message Date
Alexander Slobodeniuk
e862f34dd8 gmessages: introduce g_log_writer_default_set_debug_domains()
The problem is that resetting the environment of a
proccess is not safe, this is mentioned in the man
pages of the setenv, and also by the concept:
when we get a constant string returned by the getenv,
we need to be guaranteed that this string will exist
during all that time we are using it. While setting
the same env var to another value destroys this string
inside of libc.

Now looking at the should_drop_message(), we can see
that it just gets the environment on every call. Getting
the environment is safe, but however there's no safe way
to switch the logging domains selection: setenv can't be
used because of the reasons listed above.

That is why g_log_writer_default_set_debug_domains() is
needed: it's just a safe replacement for the setenv in this case.

Now should_drop_message() still reads the environment, but
does so only on the first call, after that the domains are
stored internally, and can only be changed by
g_log_writer_default_set_debug_domains().

This also means that now resetting G_MESSAGES_DEBUG env
var in runtime has no effect. But in any case this is not
what the user should do, because resetting the environment
in runtime is not correct.
2023-11-21 20:49:37 +01:00
Philip Withnall
8f37874f90 Merge branch 'cmph-test-asserts' into 'main'
tests: Improve build of cmph tests in girepository

See merge request GNOME/glib!3716
2023-11-21 16:49:33 +00:00
Philip Withnall
059618956b Merge branch 'muslc-ci' into 'main'
add muslc ci

See merge request GNOME/glib!3524
2023-11-21 14:55:29 +00:00
Philip Withnall
2a7ff62417 tests: Improve build of cmph tests in girepository
They were still failing with `-Dglib_assert=false` because
`G_DISABLE_ASSERT` wasn’t being explicitly un-defined for the test.

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

Also while we’re there, take the opportunity to correctly set the test
suite, protocol and environment.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-21 14:21:07 +00:00
Philip Withnall
ee94074463 Merge branch 'wip/smcv/goption-unknown' into 'main'
goption: Fix a typo

See merge request GNOME/glib!3715
2023-11-21 13:37:48 +00:00
Philip Withnall
f2d7e6af22 Merge branch 'migrate-to-gi-docgen11' into 'main'
Switch to using gi-docgen for docs (batch 11)

See merge request GNOME/glib!3712
2023-11-21 12:56:04 +00:00
Simon McVittie
c4a6ff6821 goption: Fix a typo
We presumably want the fallback string used when we cannot determine
the program name to contain balanced angle brackets, as it did before
commit 7098250e.

Fixes: 7098250e "gutils: avoid race setting prgname from g_option_context_parse()/g_application_run()"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-11-21 12:55:55 +00:00
Philip Withnall
69b83a830c Merge branch 'hmac-introspection' into 'main'
ghmac: Add a boxed type for GHmac and fix introspection build accordingly

See merge request GNOME/glib!3711
2023-11-21 12:55:30 +00:00
Philip Withnall
74d786e8bf Merge branch 'fix_3303' into 'main'
mkenums: Allow , in a character literal

Closes #3103

See merge request GNOME/glib!3676
2023-11-21 11:54:43 +00:00
Lukáš Tyrychtr
a473d5aea0 mkenums: Allow , in a character literal
This required adding a higher precedence character literal choice.

Fixes #3103
2023-11-21 11:54:42 +00:00
Philip Withnall
6d2f63ecf1 giotypes: Drop redundant duplicate documentation blocks
This fixes a load of warnings about ‘multiple comment blocks documenting
<something> identifier’.

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

Helps: #3037
2023-11-15 12:37:12 +00:00
Philip Withnall
6e4d50fa5c docs: Move the gunixmounts SECTION
Move it to a separate page.

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

Helps: #3037
2023-11-15 11:48:23 +00:00
Philip Withnall
9c414d437e docs: Move the gpollableutils SECTION
Move it to a separate page.

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

Helps: #3037
2023-11-15 11:48:23 +00:00
Philip Withnall
708de2fc12 docs: Move the gnetworking SECTION
Move it to a separate page.

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

Helps: #3037
2023-11-15 11:48:23 +00:00
Philip Withnall
de8e39b344 docs: Move the gmenumodel SECTION
Move it to a separate page, since it doesn’t quite make sense to
incorporate into the `GDBusConnection` docs.

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

Helps: #3037
2023-11-15 11:48:23 +00:00
Philip Withnall
ef049cbaca docs: Move the GIOScheduler SECTION
Move it to a separate page, as there isn’t a `GIOScheduler` struct.
Ensure that all its functions/methods/types are correctly marked as
deprecated. Fix a few broken links about I/O priority which pointed to
it.

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

Helps: #3037
2023-11-15 11:48:23 +00:00
Philip Withnall
4ef365e5d0 ghmac: Add a boxed type so it can be introspected properly
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-15 11:09:39 +00:00
Philip Withnall
e594321ca4 docs: Move the GIOChannel SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-15 11:09:39 +00:00
Philip Withnall
08f914b290 gobject: Ensure gobject from builddir is used when generating GLib-2.0.gir
Otherwise the installed one will be used, which will mean that new API
will not be available when linking.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-15 11:09:39 +00:00
Philip Withnall
7d5b6e1a85 docs: Move the GHmac SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-15 11:09:39 +00:00
Philip Withnall
09b728b2da Merge branch 'migrate-to-gi-docgen10' into 'main'
Switch to using gi-docgen for docs (batch 10)

See merge request GNOME/glib!3709
2023-11-14 15:46:30 +00:00
Philip Withnall
de56743bf6 docs: Move the GTask SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 15:17:22 +00:00
Philip Withnall
3d8f1dc203 docs: Move the GUnixFDMessage SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 15:12:53 +00:00
Philip Withnall
a84a704dc6 docs: Move the GVfs SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 15:12:53 +00:00
Philip Withnall
924e164a73 docs: Move the GRelation SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:47:53 +00:00
Philip Withnall
3981c1c704 docs: Move the GCompletion SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:47:53 +00:00
Philip Withnall
a11d3604c2 docs: Move the GCache SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:47:53 +00:00
Philip Withnall
e42bfcb9ae docs: Move the GSocketConnectable SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
b480a733c0 docs: Move the GSubprocess SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
7f6a126f39 docs: Move the GSocketControlMessage SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
8af86abefb docs: Move the GTlsConnection SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
2abbaac589 docs: Move the GIOModule and GIOExtensionPoint SECTIONs
Move them to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
fe8785862a docs: Move the GIOError SECTION
Move it to a separate page as there’s no struct documentation to hang it
off.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
d00a53416f docs: Move the GFileIOStream SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
172bb52e3f docs: Move the GFile SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
70881dbabe docs: Move the GDBusObjectSkeleton SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
108f7e4c65 docs: Move the GDBusObjectManagerServer SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
74735d878f docs: Move the dbusutils SECTION
Move it to a separate page as there’s no struct to hang the
documentation off.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
3205b03df6 docs: Move the GDBusProxy SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
e4de0868ee docs: Move the GDBusObjectManager SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
6492dd7054 docs: Move the GDBus name watching SECTION
Move it to a separate content page as there’s no struct to hang the docs
off.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
beb56279ef docs: Move the GDBus name owning SECTION
Move it to a separate content page as there’s no struct to hang the docs
off.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
f25ede6d1c docs: Move the GDBusMenuModel SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
c7e21d2f59 docs: Move the GDBusIntrospection SECTION
Move it to a separate content page as there is no `GDBusIntrospection`
type to hang the rest of the documentation off.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
84bed2f6ae docs: Move the GDBusError SECTION
Adding it all to the docs for the `GDBusError` enum seemed a bit much,
so I moved it to its own content page.

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

Helps: #3037
2023-11-14 14:32:19 +00:00
Philip Withnall
00f836b11a Merge branch 'leak-fixes' into 'main'
Fix various leaks in cmph-bdz-test and gutils

See merge request GNOME/glib!3708
2023-11-14 13:59:58 +00:00
Philip Withnall
0dd712a07c Merge branch 'gir-disable-asserts' into 'main'
girepository: Ignore set-but-not-used warnings with G_DISABLE_ASSERT

See merge request GNOME/glib!3707
2023-11-14 13:59:42 +00:00
Philip Withnall
89b0c1b304 glib.supp: Allow definite leaks of util dir paths
These are one-time leaks, and happen if the util dir paths are built via
these code paths, and then subsequently overwritten using
`g_set_user_dirs()` (typically as part of a unit test).

The additions to `glib.supp` correspond to the `g_ignore_leak()` calls
in `gutils.c`. Unfortunately `g_ignore_leak()` only affects asan, not
valgrind.

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

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-14 11:01:04 +00:00
Philip Withnall
1a979ab494 gutils: Fix an unlikely minor leak in g_build_user_data_dir()
A leak can happen if the `data_dir` is the empty string.

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

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-14 11:00:21 +00:00
Philip Withnall
aed9098530 girepository: Fix various leaks in cmph-bdz-test
See https://gitlab.gnome.org/GNOME/glib/-/jobs/3294034

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-14 11:00:01 +00:00