Commit Graph

24650 Commits

Author SHA1 Message Date
Philip Withnall
cd9ed612a7 gdebugcontrollerdbus: Mark a variable as G_GNUC_UNUSED
It’s not used when compiling with `G_DISABLE_ASSERT`. This fixes the CI
build failure here: https://gitlab.gnome.org/GNOME/glib/-/jobs/1843082
```
[461/1229] Compiling C object 'gio/6ae6c9e@@gio-2.0@sha/gdebugcontrollerdbus.c.o'.
FAILED: gio/6ae6c9e@@gio-2.0@sha/gdebugcontrollerdbus.c.o
cc -Igio/6ae6c9e@@gio-2.0@sha -Igio -I../gio -I. -I../ -Iglib -I../glib -Igobject -I../gobject -Igmodule -I../gmodule -I/usr/include/libmount -I/usr/include/blkid -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=gnu99 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_ENABLE_DEBUG -DG_DISABLE_ASSERT -Wduplicated-branches -Wimplicit-fallthrough -Wmisleading-indentation -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Wstrict-prototypes -Wno-bad-function-cast -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=missing-prototypes -fPIC '-DG_LOG_DOMAIN="GLib-GIO"' -DGIO_COMPILATION '-DGIO_MODULE_DIR="/usr/local/lib64/gio/modules"' '-DLOCALSTATEDIR="/usr/local/var"' -fvisibility=hidden -MD -MQ 'gio/6ae6c9e@@gio-2.0@sha/gdebugcontrollerdbus.c.o' -MF 'gio/6ae6c9e@@gio-2.0@sha/gdebugcontrollerdbus.c.o.d' -o 'gio/6ae6c9e@@gio-2.0@sha/gdebugcontrollerdbus.c.o' -c ../gio/gdebugcontrollerdbus.c
../gio/gdebugcontrollerdbus.c: In function ‘authorize_cb’:
../gio/gdebugcontrollerdbus.c:345:32: error: unused variable ‘priv’ [-Werror=unused-variable]
  345 |   GDebugControllerDBusPrivate *priv = g_debug_controller_dbus_get_instance_private (self);
      |                                ^~~~
cc1: all warnings being treated as errors
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-22 09:35:40 +00:00
Philip Withnall
7cef814b7d Merge branch 'wip/smcv/no-nanoseconds-for-you' into 'main'
glocalfileinfo: Always define _g_stat_mtim_nsec, etc.

See merge request GNOME/glib!2516
2022-02-22 09:00:56 +00:00
Philip Withnall
60bbf27c45 Merge branch 'cleanup-warnings-split-4' into 'main'
Cleanup warnings split 4

See merge request GNOME/glib!2493
2022-02-22 08:40:04 +00:00
Simon McVittie
6517bbfbc3 glocalfileinfo: Always define _g_stat_mtim_nsec, etc.
If these struct members aren't available, we can be more like an
abstraction layer by falling back to yielding 0.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-21 16:58:08 +00:00
Nirbheek Chauhan
94f3bb7074 Merge branch 'wip/pwithnall/ci-cleanups' into 'main'
ci: Various cleanups and moving Android API 21 and FreeBSD 12 to scheduled run

See merge request GNOME/glib!2514
2022-02-21 15:31:41 +00:00
Emin Tufan Çetin
60e8b48be9 Update Turkish translation 2022-02-21 13:49:28 +00:00
Simon McVittie
3c12ddce81 Merge branch '1929-dbus-auth-locking' into 'main'
gdbusauthmechanismsha1: Don’t delete a stale lock file if it’s changed

Closes #1929

See merge request GNOME/glib!2511
2022-02-21 13:48:54 +00:00
Loic Le Page
d15e6f7c9c Fix global variable name hidden by local variables in glib/tests/dataset.c 2022-02-21 12:42:23 +01:00
Loic Le Page
becce7742c Fix global variable name hidden by local variables in glib/tests/hash.c 2022-02-21 12:42:23 +01:00
Loic Le Page
479fcb40c0 Fix redefinition of local variable in glib/tests/logging.c 2022-02-21 12:42:23 +01:00
Loic Le Page
c53f24ba53 Fix global variable name hidden by local variables in glib/tests/mainloop.c 2022-02-21 12:42:22 +01:00
Loic Le Page
64760f1028 Refactor glib/tests/node.c
Replace C2P and P2C macros with standard GINT_TO_POINTER and
GPOINTER_TO_INT macros.
2022-02-21 12:42:22 +01:00
Loic Le Page
2885cbd737 Fix global variable name hidden by local variables in glib/tests/option-context.c 2022-02-21 12:42:22 +01:00
Loic Le Page
fb939a0029 Fix redefinition of local variable in glib/tests/sequence.c 2022-02-21 12:42:22 +01:00
Loic Le Page
5804fa1680 Fix global variable name hidden by local variables in glib/tests/spawn-multithreaded.c 2022-02-21 12:42:22 +01:00
Loic Le Page
22b7182d2a Fix redefinition of local variable in glib/tests/strfuncs.c 2022-02-21 12:42:15 +01:00
Loïc Le Page
cbc3d65f6d Fix global variable name hidden by local variables in glib/tests/utf8-validate.c 2022-02-21 12:38:11 +01:00
Philip Withnall
5d40604fa7 ci: Drop Android API 21 build jobs
API version 21 was used for Android 5.0
(https://developer.android.com/studio/releases/platforms#5.0), which is
no longer supported
(https://en.wikipedia.org/wiki/Android_version_history).

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 14:16:11 +00:00
Aurimas Černius
8f241c46b9 Updated Lithuanian translation 2022-02-20 15:07:02 +02:00
Philip Withnall
916e7f3cf9 ci: Run the Android API 21 and FreeBSD 12 jobs on a schedule
Rather than running them on each commit on `main`. This saves resources.

Given that Android API 28 and FreeBSD 13 jobs continue to be run on each
commit on `main`, this seems like an acceptable tradeoff. It’s very
unlikely that a regression will happen which affects the older systems
and *not* the newer systems. If it does, it will be caught within a week
by the scheduled job.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 12:50:34 +00:00
Philip Withnall
a9fef02be4 ci: Factor out a template for jobs which run only on the origin repo
This clarifies the intent of the `branches@GNOME/glib` selector. It
introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 12:50:34 +00:00
Philip Withnall
0a14b091e0 ci: Split .only-default out of .build-linux
As with a previous commit, `.only-default` does things which are
orthogonal to what `.build-linux` does, so it’s clearer and more
extensible for CI jobs to specify both in their top-level `extends`
statements, rather than relying on `.build-linux` to pull
`.only-default` in.

This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 12:50:34 +00:00
Philip Withnall
02da6e8171 ci: Rename .cross-template to .cross-build-linux
This makes the name a bit more descriptive, and makes it match the rest
of the naming scheme.

This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 12:50:34 +00:00
Philip Withnall
0366f100ca ci: Rename .build template to .build-linux
This name is more specific to what the template actually does.

This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 12:50:34 +00:00
Philip Withnall
c44abdc7a2 ci: Replace .build-only-schedules template with multiple extension
`.build` and `.only-schedules` are orthogonal, and I want to use
`.only-schedules` together with `.cross-template` in future, which would
require creating more cross-product templates.

Avoid that by splitting `extends: .build-only-schedules` into
```
extends:
  - .build
  - .only-schedules
```

Multiple extends are supported by GitLab: https://docs.gitlab.com/ee/ci/yaml/#extends

This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 12:50:34 +00:00
Philip Withnall
32aa9b7349 ci: Port from YAML anchors to GitLab extends
See https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#use-extends-to-reuse-configuration-sections

Since we’re already using `extends` in other places in the configuration
file, it seems simpler to use it everywhere.

This should introduce no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 12:50:34 +00:00
Philip Withnall
ae903744ee Merge branch 'environment-test-fixes' into 'main'
tests: Fix various small memory leaks

See merge request GNOME/glib!2509
2022-02-20 12:09:00 +00:00
Sebastian Dröge
53dc7e2d53 Merge branch 'document-main-priorities' into 'main'
gmain: Expand documentation about GSource priorities a little

See merge request GNOME/glib!2513
2022-02-20 12:06:24 +00:00
Philip Withnall
9ee583a387 gmain: Expand documentation about GSource priorities a little
Prompted by https://stackoverflow.com/q/71173668/2931197

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 11:44:09 +00:00
Philip Withnall
2bc1036f80 tests: Fix a memory leak in the mainloop test
The source needs to be removed from the `GMainContext` before being
unreffed, otherwise the main context and main loop will be kept around.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 10:43:26 +00:00
Philip Withnall
ba556e6d34 tests: Fix a memory leak in the keyfile test
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 10:43:26 +00:00
Philip Withnall
a389227fb9 tests: Fix a memory leak in the fileutils test
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 10:43:26 +00:00
Philip Withnall
c60a0a45de tests: Fix a memory leak in the tls-certificate test
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 10:43:26 +00:00
Philip Withnall
a4ce8399cd tests: Fix memory leaks in the g-file-info-filesystem-readonly test
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 10:43:26 +00:00
Philip Withnall
d007fdb079 tests: Fix a memory leak in the resources test
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 10:43:26 +00:00
Philip Withnall
9434e4a40c tests: Use g_assert_*() rather than g_assert() in resources.c
`g_assert()` is compiled out with `G_DISABLE_ASSERT`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 10:43:26 +00:00
Philip Withnall
12a4fcdbed tests: Fix a leak in environment.c with undefined behaviour tests on
`g_environ_setenv()` and `g_environ_unsetenv()` were correctly returning
`NULL` when their preconditions failed (as the test is supposed to be
exercising). That overwrote the value of `env` without freeing it,
resulting in a leak.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 10:43:26 +00:00
Philip Withnall
cb18e6b969 Merge branch 'empty-argv' into 'main'
Various minor fixes for empty argv handling

See merge request GNOME/glib!2466
2022-02-20 09:36:41 +00:00
Jordi Mas
f61187428e Update Catalan translation 2022-02-20 08:58:58 +01:00
Emmanuele Bassi
056d0dc7f3 Merge branch 'doc-declare' into 'main'
doc: Extend a bit G_DECLARE_* documentation example

See merge request GNOME/glib!2512
2022-02-19 20:52:21 +00:00
Xavier Claessens
893ff61176 doc: Extend a bit G_DECLARE_* documentation example 2022-02-19 14:23:37 -05:00
Christian Kirbach
bccc99b5ac Update German translation
(cherry picked from commit 6fb1aaccbd)
2022-02-19 13:48:26 +00:00
Daniel Șerbănescu
ed51073305 Update Romanian translation
(cherry picked from commit 9df5e573a2)
2022-02-19 13:42:36 +00:00
Aleksandr Melman
99ac2634a6 Update Russian translation 2022-02-18 19:30:44 +00:00
Philip Withnall
01a432d6ff glocalfileinfo: Add missing _g_stat_*() methods for win32
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-18 13:50:19 +00:00
Philip Withnall
a57c33fc1d Merge branch 'cleanup-warnings-split-3' into 'main'
Cleanup warnings split 3

See merge request GNOME/glib!2492
2022-02-18 13:45:42 +00:00
Philip Withnall
5ac86e21b3 Merge branch 'cleanup-warnings-split-2' into 'main'
Cleanup warnings split 2

See merge request GNOME/glib!2491
2022-02-18 13:39:25 +00:00
Philip Withnall
648f9efce0 tests: Remove extra debugging from gdbus-connection-flush
Having compared the debug output, it doesn’t show anything unusual
happening that can’t already be seen from other output, for this test.

This is a partial revert of 8fd71dccc5. The debugging output it added to
other tests may still be useful.

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

Helps: #1929
2022-02-18 13:24:13 +00:00
Philip Withnall
693e4efeba tests: Use g_assert_*() rather than g_assert() in gdbus-connection-flush.c
`g_assert()` is compiled out with `G_DISABLE_ASSERT`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-18 13:22:16 +00:00
Philip Withnall
dc0eb5e49a gdbusauthmechanismsha1: Don’t delete a stale lock file if it’s changed
The retry loop for acquiring the lock for the authentication cookie file
currently tries to acquire the lock for 0.5s, then gives up, assumes the
lock file is stale, and deletes it.

That’s great if the lock file *is* stale because it’s been left there by
a crashed process.

It’s not so great if the lock file just happens to have been there every
time this process checked, because the cookie file is highly contested
while (for example) running lots of parallel unit tests.

Check for that situation by comparing the mtime of the lock file and
continuing to retry if it’s changed.

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

Fixes: #1929
2022-02-18 13:17:19 +00:00