Commit Graph

24691 Commits

Author SHA1 Message Date
Alexander Klauer
bc2ca9df20 Explain magic literals in G_VARIANT_*_INIT 2022-03-04 11:29:58 +00:00
Tim Sabsch
b109c2a210 Update German translation 2022-03-03 15:14:53 +00:00
Sebastian Dröge
420238e0c4 Merge branch 'debug-controller-unused' into 'main'
gdebugcontrollerdbus: Mark a variable as G_GNUC_UNUSED

See merge request GNOME/glib!2519
2022-03-03 14:54:28 +00:00
Sebastian Dröge
c3735c1bc6 Merge branch '517-collation-docs' into 'main'
gunicollate: Document that g_utf8_collate() can’t compare everything

Closes #517

See merge request GNOME/glib!2443
2022-03-03 14:53:58 +00:00
Sebastian Dröge
8091727b27 Merge branch 'wip/pwithnall/macos-tests' into 'main'
tests: Stop ignoring test failures on macOS

See merge request GNOME/glib!2505
2022-03-03 14:53:38 +00:00
Sebastian Dröge
b1f57806a7 Merge branch 'task-set-name-docs' into 'main'
gtask: Document that task name is set by g_task_set_source_tag()

See merge request GNOME/glib!2531
2022-03-03 14:01:12 +00:00
Philip Withnall
c1293acb27 gtask: Document that task name is set by g_task_set_source_tag()
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-03 12:42:28 +00:00
Philip Withnall
16057f78e8 Merge branch 'mwleeds/log-set-enabled-docs-2' into 'main'
gmessages: Clarify g_log_set_debug_enabled() behavior

Closes #2609

See merge request GNOME/glib!2530
2022-03-03 09:31:42 +00:00
Phaedrus Leeds
3a22c26e5c gmessages: Clarify g_log_set_debug_enabled() behavior
Fixes #2609
2022-03-02 18:58:13 -08:00
Goran Vidović
4d66b93310 Update Croatian translation 2022-03-02 12:41:33 +00:00
Goran Vidović
a9e97cc14b Update Croatian translation 2022-03-02 11:30:59 +00:00
Goran Vidović
223b1f31c8 Update Croatian translation 2022-03-02 11:30:02 +00:00
Changwoo Ryu
f87c915eb1 Update Korean translation 2022-03-02 10:41:11 +00:00
Philip Withnall
46d1329f06 Merge branch 'meson-devenv-gdb' into 'main'
meson: Add PYTHONPATH to load GDB helper module

See merge request GNOME/glib!2528
2022-03-01 11:24:21 +00:00
Alan Mortensen
df7f9a9f85 Updated Danish translation 2022-02-28 18:46:30 +01:00
Asier Sarasua Garmendia
888ca6e36f Update Basque translation 2022-02-27 08:04:14 +00:00
Xavier Claessens
2bd152bfeb meson: Add PYTHONPATH to load GDB helper module
Meson generates a gdbinit file that will automatically load glib and
gobject scripts. However that script uses a helper python module that
needs PYTHONPATH to be pointing into the right location in the source
tree to be able to find glib_gdb.py and gobject_gdb.py
2022-02-25 16:50:18 -05:00
Daniel Mustieles
b3311e82ee Updated Spanish translation 2022-02-24 12:52:04 +01:00
Philip Withnall
54849f2622 Merge branch 'remove_testgdateparser' into 'main'
Remove unused test tests/testgdateparser.c

See merge request GNOME/glib!2526
2022-02-24 11:05:38 +00:00
Emmanuel Fleury
78f6507196 Remove unused test tests/testgdateparser.c
Helps issue #1434
2022-02-23 18:34:44 +01:00
Philip Withnall
8b14c1559d Merge branch 'meson-gio-var-take2' into 'main'
meson: Add schemasdir and giomoduledir to gio dependency

See merge request GNOME/glib!2525
2022-02-23 16:12:29 +00:00
Xavier Claessens
218ac195df meson: Add schemasdir and giomoduledir to gio dependency
This allows applications to get their value regardless whether glib is a
subproject or pkgconfig:

  gio_dep = dependency('gio-2.0')
  giomoduledir = gio_dep.get_variable('giomoduledir')
  schemasdir = gio_dep.get_variable('schemasdir')
2022-02-23 08:24:00 -05:00
Philip Withnall
dbd11f3d3b Merge branch 'wip/pwithnall/revert-2517' into 'main'
Revert "meson: Add schemasdir and giomoduledir to gio dependency"

See merge request GNOME/glib!2524
2022-02-23 12:17:29 +00:00
Philip Withnall
7f8c09cd07 Merge branch 'wip/pwithnall/network-address-test-fixes' into 'main'
tests: Remove threads from mock-resolver/network-address test

See merge request GNOME/glib!2520
2022-02-23 12:03:28 +00:00
Philip Withnall
590a2c9af8 Revert "meson: Add schemasdir and giomoduledir to gio dependency"
This reverts commit 5aa03882ca.

It fails to compile on newer Meson versions with
`--fatal-meson-warnings` due to:
```
WARNING: Project targeting '>= 0.52.0' but tried to use feature introduced in '0.54.0': variables arg in declare_dependency.
gio/meson.build:833:0: ERROR: Fatal warnings enabled, aborting
```

That happens regardless of the fact that we’ve correctly limited the use
of the `variables` argument to only when building with Meson ≥ 0.56.
Unfortunately Meson can’t statically detect that the argument is
conditional.

Bumping GLib’s Meson dependency is too much work right now, so this MR
unfortunately has to be reverted.
2022-02-23 11:51:13 +00:00
Sebastian Dröge
b615afc0fa Merge branch 'null_arg_handling' into 'main'
Add handling of NULL time_t* pointer as argument

See merge request GNOME/glib!2523
2022-02-23 07:49:08 +00:00
Emmanuel Fleury
0a6d815f95 Add handling of NULL time_t* pointer as argument 2022-02-22 23:34:09 +01:00
Philip Withnall
199261a419 Merge branch 'remove_testglib.c' into 'main'
Remove old test file tests/testglib.c

See merge request GNOME/glib!2424
2022-02-22 18:48:02 +00:00
Emmanuel Fleury
16f0438bc6 Remove old test file tests/testglib.c 2022-02-22 18:48:01 +00:00
Philip Withnall
68dc5d5fbc Merge branch 'meson-gio-var' into 'main'
meson: Add schemasdir and giomoduledir to gio dependency

See merge request GNOME/glib!2517
2022-02-22 18:22:52 +00:00
Philip Withnall
b400943767 Merge branch 'mwleeds/log-set-enabled-docs' into 'main'
gmessages: Fix typo in docs

See merge request GNOME/glib!2515
2022-02-22 14:32:47 +00:00
Xavier Claessens
5aa03882ca meson: Add schemasdir and giomoduledir to gio dependency
This allows applications to get their value regardless whether glib is a
subproject or pkgconfig:

  gio_dep = dependency('gio-2.0')
  giomoduledir = gio_dep.get_variable('giomoduledir')
  schemasdir = gio_dep.get_variable('schemasdir')
2022-02-22 08:54:07 -05:00
Philip Withnall
00faa84f77 Merge branch 'giomodule' into 'main'
meson: Set GIO_EXTRA_MODULES in devenv

See merge request GNOME/glib!2518
2022-02-22 13:38:58 +00:00
Philip Withnall
13c4b9579b tests: Remove threads from mock-resolver/network-address test
`mock-resolver.c` is a mock implementation of `GResolver` used in the
`network-address` tests. It returns resolver results, and implements
timeouts, as directed by the test calling it.

In particular, it allows the IPv4 and IPv6 resolver results to be
returned using independent delays. This allows code paths which deal
with IPv4 and IPv6 results being returned at different times to be
tested, as the ‘Happy Eyeballs’ spec mandates various hard-coded
timeouts for returning the best results it can in a reasonable
timeframe.

Previously, `mock-resolver.c` implemented the timeouts by handling
`lookup_by_name()` in a `GTask` worker thread, and calling `g_usleep()`
for the timeout. This seemed to cause occasional CI failures, such as
https://gitlab.gnome.org/GNOME/glib/-/jobs/1843454, where a resolver
error would be returned rather than the expected results:
```
ok 52 /network-address/happy-eyeballs/ipv4-error-ipv6-first
\# GLib-GIO-DEBUG: IPv4 DNS error: IPv4 Broken
(/var/tmp/gitlab_runner/builds/Ff4WDDRj/0/GNOME/glib/_build/gio/tests/network-address:18428): GLib-GIO-DEBUG: 09:03:08.587: IPv4 DNS error: IPv4 Broken
Bail out! GLib-GIO:ERROR:../gio/tests/network-address.c:586:got_addr: assertion failed (error == NULL): IPv4 Broken (g-io-error-quark, 24)
stderr:
**
GLib-GIO:ERROR:../gio/tests/network-address.c:586:got_addr: assertion failed (error == NULL): IPv4 Broken (g-io-error-quark, 24)
```

While I’ve been unable to reproduce these failures locally, I suspect
they might be down to thread spawning occasionally taking long enough on
a CI runner to change the ordering of the timeouts, such that the ‘Happy
Eyeballs’ algorithm returns a different set of results from what the
test expects.

So, this commit rewrites part of `mock-resolver.c` to implement timeouts
in the main thread, rather than in a worker thread. That should
eliminate the delays in spawning threads, and should mean that the
timeout sources in `mock-resolver.c` are attached to the same
`GMainContext` as those from the ‘Happy Eyeballs’ algorithm which are
monitoring them, so a total order over the timeouts can be guaranteed.

Of course, I might be completely wrong since this is just a guess and I
can’t properly test it since I can’t reproduce the failure. Worth a try.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-22 11:25:21 +00:00
Philip Withnall
bb2d79e6a8 tests: Use g_assert_*() rather than g_assert() in network-address.c
`g_assert()` is compiled out with `G_DISABLE_ASSERT`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-22 11:25:21 +00:00
Philip Withnall
a57706887e tests: Fix memory leaks in network-address test
The test results weren’t being freed.

This makes the `network-address` test clean under memcheck for me.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-22 11:25:21 +00:00
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
Xavier Claessens
0071abc187 meson: Set GIO_EXTRA_MODULES in devenv
This makes GIO find the fam module within "meson devenv" without having
to install it on the system.
2022-02-21 13:22:54 -05: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