30192 Commits

Author SHA1 Message Date
Philip Withnall
8aab7da95c Merge branch 'glib-2-80' into 'glib-2-80'
Update Bulgarian translation

See merge request GNOME/glib!4250
2024-09-09 10:15:06 +00:00
twlvnn kraftwerk
64cab19b64 Update Bulgarian translation
Proof-read via D-L.
2024-09-07 16:40:40 +02:00
Philip Withnall
2177e1ff38 Merge branch 'glib-2-80' into 'glib-2-80'
Update German translation

See merge request GNOME/glib!4228
2024-09-01 17:22:09 +00:00
Tim Sabsch
53b9470dba Update German translation
Proof-read via D-L.
2024-08-31 09:25:48 +02:00
Philip Withnall
6e92ab8445
2.80.5
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2.80.5
2024-08-26 11:15:22 +01:00
Philip Withnall
1e66eae5fc Merge branch 'glib-2-80' into 'glib-2-80'
Updated translations for Hindi for glib 2.80 branch.

See merge request GNOME/glib!4201
2024-08-21 11:17:53 +00:00
Karunakar Guntupalli
ccd491ea06 Updated translations for Hindi for glib 2.80 branch.
Please refer to veritimus workflow - https://l10n.gnome.org/vertimus/glib/glib-2-80/po/hi/
2024-08-21 08:23:41 +00:00
Philip Withnall
17d1bf3c49 Merge branch 'romanian-updates' into 'glib-2-80'
po: Updated Romanian Translation for the glib-2-80 branch

See merge request GNOME/glib!4191
2024-08-15 09:30:06 +00:00
Daniel Șerbănescu
40fb8e42fe po: Updated Romanian translation 2024-08-14 19:28:26 +02:00
Michael Catanzaro
5706816a44 Merge branch 'backport-4159-win-pc-file-glib-2-80' into 'glib-2-80'
Backport !4159 “introspection: Correct GIO-Windows pkg-config name” to glib-2-80

See merge request GNOME/glib!4160
2024-07-19 05:08:51 +00:00
Chun-wei Fan
2c7a6de280 introspection: Correct GIO-Windows pkg-config name
It's gio-windows-2.0.pc, not gio-win32-2.0.pc.

Otherwise, we get warnings/errors where the package cannot be located
but since we are linking to the same GIO library file, this did not
manifest itself.
2024-07-18 21:56:42 +02:00
Philip Withnall
6e8bb55020 Merge branch 'wip/pwithnall/backport-4152-resolver-parsing-bsd-glib-2-80' into 'glib-2-80'
Backport !4152 “tests: Fix compilation of resolver-parsing test on FreeBSD” to glib-2-80

See merge request GNOME/glib!4153
2024-07-10 09:03:51 +00:00
Michael Catanzaro
31c1807f78 Merge branch 'backport-4130-socketclient-test-fix-glib-2-80' into 'glib-2-80'
Backport !4130 “Fix gsocketclient-slow test on FreeBSD” to glib-2-80

See merge request GNOME/glib!4134
2024-07-09 21:13:42 +00:00
Philip Withnall
0901b03bbe
tests: Fix compilation of resolver-parsing test on FreeBSD
This fixes commit cdcb1798085902c0342ead65d16b5733357e48c1.

`dn_comp()` is needed to build fake DNS records for most of the tests in
this file. The new ownership test is no exception.

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

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-07-09 21:46:32 +01:00
Michael Catanzaro
99ce02b284 Merge branch 'backport-4150-lsan-cygwin-glib-2-80' into 'glib-2-80'
Backport !4150 “glib-private: fix build under Cygwin” to glib-2-80

See merge request GNOME/glib!4151
2024-07-09 20:22:42 +00:00
Christoph Reiter
61c9204df4 glib-private: fix build under Cygwin
fb58d55187dfe1565d10c0c0ffdbaa85376cf0b8 added weak linking for ASAN,
skipping it for MinGW because weak symbols are broken there.
The same is true for Cygwin, so skip things there too.

This fixes the following build error under MSYS2:

/usr/lib/gcc/x86_64-pc-msys/13.3.0/../../../../x86_64-pc-msys/bin/ld:
    glib/msys-glib-2.0-0.dll.p/gutils.c.o:gutils.c:
        (.rdata$.refptr.__lsan_enable[.refptr.__lsan_enable]+0x0): undefined reference to `__lsan_enable'
2024-07-09 20:28:21 +01:00
Philip Withnall
1048fcc017
tests: Make an error check less specific in gsocketclient-slow
On Linux the error will be `G_IO_ERROR_CONNECTION_REFUSED`, but on macOS
it will be `G_IO_ERROR_TIMED_OUT`. Both errors seem reasonable to me, so
let’s not specifically require one of them.

See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4104#note_2161451

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-07-09 20:21:18 +01:00
Philip Withnall
0e1647c0cb
2.80.4
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2.80.4
2024-07-08 15:03:15 +01:00
Michael Catanzaro
3b22daf758 Merge branch 'backport-4110-dns-ref-glib-2-80' into 'glib-2-80'
Backport !4110 “gthreadedresolver: ref-sink returned records in lookup_records()” to glib-2-80

See merge request GNOME/glib!4141
2024-07-05 12:18:18 +00:00
Andy Holmes
bf7a270970 tests: ensure DNS records are full-reference variants
For each test expected to return valid DNS records, test that the
record variants are not floating references.

Also add an test which checks this explicitly for a simple TXT record.
2024-07-05 07:28:48 +01:00
Andy Holmes
b8aaa10a91 gthreadedresolver: ref-sink returned records in lookup_records()
The return value to `lookup_records()` methods is set as `transfer full`
but the code path in `g_resolver_records_from_res_query()` doesn't
sink the GVariant.

Add the `g_variant_ref_sink()` call when prepending the record, so
the list hold a full reference on each records.

closes #3393
2024-07-05 07:28:48 +01:00
Gleb Popov
295b200e17 Fix gsocketclient-slow test on FreeBSD
The "port" variable ends up being 0 even after successful g_socket_bind.
Use g_socket_get_local_address() to actually get a correct port number.
2024-07-01 14:40:21 +01:00
Emmanuele Bassi
9b6af495cf Merge branch 'backport-4122-gir-deps-glib-2-80' into 'glib-2-80'
Backport !4020 and !4122: fixes to GIR install locations and build race fixes

See merge request GNOME/glib!4124
2024-06-27 09:55:02 +00:00
Philip Withnall
e8d11b0dbd
introspection: Add libgirepository as a dep to all generate_gir() calls
libgirepository is not needed by most of the modules, but it is needed
by the `g-ir-scanner` generated dumper program. If we don’t explicitly
include the local version of it here, Meson will implicitly link against
it anyway, and that might pull in a different version, or try to link
against a half-built local version as the build ordering dependency tree
won’t reflect this relationship.

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

Fixes: #3401
2024-06-27 10:32:05 +01:00
Alexander Kanavin
1402132d63
girepository/introspection: correctly install .gir files into custom locations
There is a meson option (gir_dir_prefix), but without being passed in here
the files would always get installed into the default location (datadir).

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
2024-06-27 10:31:48 +01:00
Michael Catanzaro
5d70340412 Merge branch 'wip/pwithnall/backport-3373-file-load-4gb-glib-2-80' into 'glib-2-80'
Backport !3373 and !4117 “Handle files >4GB in g_file_load_contents()“ to glib-2-80

See merge request GNOME/glib!4118
2024-06-18 22:09:21 +00:00
Philip Withnall
b4085620c6
tests: Improve 4GB file loading test to work on i386
This should test the limits of loading 4GB files on i386 platforms, such
as the Hurd CI runner. On such platforms, `sizeof(size_t) == 4`.

This should fix the compiler warning from
https://gitlab.gnome.org/GNOME/glib/-/jobs/3989442:
```
../gio/tests/file.c:2931:51: error: left shift count >= width of type [-Werror=shift-count-overflow]
 2931 | static const gsize testfile_4gb_size = ((gsize) 1 << 32) + (1 << 16); /* 4GB + a bit */
      |                                                   ^~
cc1: all warnings being treated as errors
```

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-06-18 21:25:12 +01:00
Philip Withnall
724709f022
tests: Skip >4GB file tests unless running tests in slow/thorough mode
They take too long to include in a normal test run. They’ll still be run
in CI once a week as part of our scheduled slow test job.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-06-18 21:25:06 +01:00
Benjamin Otte
7ad4384af1 tests: Add test for >4GB reads with g_file_load_contents()
The tests - one for sync, one for async - create a sparse file for
this purpose, so this should be cheap on the fileystem.

Of course, the test still allocates >4GB of memory for the data that it
returns from g_file_load_contents(), I hope the CI test runners can deal
with that.
2024-06-18 21:24:39 +01:00
Benjamin Otte
84f3b1ab9e tests: Use g_clear_fd() 2024-06-18 21:24:39 +01:00
Benjamin Otte
c2b3a6c557 gfile: Rewrite load_contents() to use realloc()
GByteArray is limited to 4GB in size and the current code silently
overflows when that happens.

Replace both load_contents() and load_contents_async() implementations
with a version that uses realloc() and gsize to maintain the array.
2024-06-18 21:24:39 +01:00
Benjamin Otte
1cf39a3000 array: Abort on overflow
This is a precautionary assert that will probably only trigger on 32bit
OSes. But g_nearest_pow() can overflow.
2024-06-18 21:24:39 +01:00
Michael Catanzaro
e1d1c78fc8 Merge branch 'backport-4111-eaddrnotavail-macos-glib-2-80' into 'glib-2-80'
Backport !4111 “gioerror: Map EADDRNOTAVAIL to G_IO_ERROR_CONNECTION_REFUSED” to glib-2-80

See merge request GNOME/glib!4112
2024-06-13 20:55:47 +00:00
Philip Withnall
a2000e2b36
gioerror: Map EADDRNOTAVAIL to G_IO_ERROR_CONNECTION_REFUSED
Previously it was mapped (as a default) to `G_IO_ERROR_FAILED`.

It’s the error that macOS returns when trying to connect to a socket which
is bound but not listened to. Linux returns `ECONNREFUSED` in this case.
It’s helpful if they both map to the same `GIOError` value.

This should fix the `/socket-client/connection-fail` test on macOS,
which is currently
[failing](https://gitlab.gnome.org/GNOME/glib/-/jobs/3970547) with:
```
 # GLib-GIO-DEBUG: GSocketClient: Starting TCP connection attempt
 # GLib-GIO-DEBUG: GSocketClient: Connection attempt failed: Can't assign requested address
 # GLib-GIO-DEBUG: GSocketClient: Starting new address enumeration
 # GLib-GIO-DEBUG: GSocketClient: Address enumeration completed (out of addresses)
 # GLib-GIO-DEBUG: GSocketClient: Address enumeration failed: (null)
 # GLib-GIO-DEBUG: GSocketClient: Connection failed: Could not connect to localhost: Can't assign requested address
not ok /socket-client/connection-fail - GLib-GIO:ERROR:../gio/tests/gsocketclient-slow.c:231:test_connection_failed: assertion failed (local_error == (g-io-error-quark, 39)): Could not connect to localhost: Can't assign requested address (g-io-error-quark, 0)
Bail out!
```

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

See: #3184
Fixes: #3394
2024-06-13 20:59:43 +01:00
Philip Withnall
8f3ed07701
2.80.3
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2.80.3
2024-06-10 12:22:09 +01:00
Emmanuele Bassi
14a26f969f Merge branch 'backport-4033-girepository-typelib-determinicity-glib-2-80' into 'glib-2-80'
Backport !4033 “girepository: Keep an ordered list of the loaded typelibs” to glib-2-80

See merge request GNOME/glib!4080
2024-06-10 10:27:29 +00:00
Jose Riha
0835b7df97 Update Slovak translation 2024-06-09 09:20:30 +00:00
Michael Catanzaro
c7f556596e Merge branch 'backport-4104-socket-client-leak-glib-2-80' into 'glib-2-80'
Backport !4104 “gsocketclient: Fix a leak of the task data on an error path” to glib-2-80

See merge request GNOME/glib!4105
2024-06-05 12:47:12 +00:00
Johan Sternerup
9fccda086a gsocketclient: Add unit test for leak of task data in error path
The unit test cover the error path that causes the leak described in
https://gitlab.gnome.org/GNOME/glib/-/issues/3184.
2024-06-05 12:57:59 +01:00
Philip Withnall
1942dd5b5c
gsocketclient: Fix a leak of the task data on an error path
Once the task is completed (and `g_task_return_*()` has been called),
the task is no longer needed. It would make more sense to unref it in
`complete_connection_with_error()`, where `g_task_return_*()` is called,
but that complicates other call sites significantly, so I didn’t do it.

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

Fixes: #3184
2024-06-05 12:57:49 +01:00
Jordi Mas i Hernandez
0043895879 Update Catalan translation 2024-05-27 14:56:31 +00:00
Michael Catanzaro
197e2690ef Merge branch 'backport-4078-clang-discarded-qualifiers-glib-2-80' into 'glib-2-80'
Backport !4078 “tests: Fix clang compilation failure due to unrecognised option in pragma” to glib-2-80

See merge request GNOME/glib!4079
2024-05-16 23:59:09 +00:00
Philip Withnall
3858b8b815
girepository: Make gi_repository_get_loaded_namespaces() deterministic
As with the previous two commits, the results of calling
`gi_repository_get_loaded_namespaces()` were previously
non-deterministic due to being generated by iterating over a hash table,
which has a non-deterministic iteration order.

Fix that by using the new `ordered_typelibs` and `ordered_lazy_typelibs`
arrays to provide deterministic ordering.

At the same time, significantly reduce the number of allocations needed
to build the return value — previously the results would be built as a
linked list before being turned into an array. The linked list is now
banished to history.

Add some more unit tests to maximise test coverage of this method.

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

Fixes: #3303
2024-05-16 23:32:15 +01:00
Philip Withnall
400fac7c4a
girepository: Make gi_repository_find_by_error_domain() deterministic
As with the previous commit, finding a `GIBaseInfo` matching the given
error domain was non-deterministic because it iterated through a hash
table of typelibs. Hash table iteration is non-deterministic.

Change the method to instead use the `ordered_typelibs` and
`ordered_lazy_typelibs` arrays to give deterministic iteration order.

Add a unit test, although it can’t test the interesting case of an error
domain which is present in both `GioUnix`/`GioWin32` and `Gio`, because
no such error domain exists.

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

Helps: #3303
2024-05-16 23:32:09 +01:00
Philip Withnall
48988a4098
girepository: Make gi_repository_find_by_gtype() deterministic
When faced with a `GType` which is present in multiple typelibs, the old
implementation was not deterministic, as it iterated over a hash table
of typelibs. The iteration order of a hash table is not deterministic.

Use the new `ordered_typelibs` and `ordered_lazy_typelibs` arrays to
iterate instead, making the order deterministic.

Add a unit test to check this. In particular, to check that symbols
which are present in both `Gio` and `GioUnix` are correctly resolved as
being from `GioUnix`.

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

Helps: #3303
2024-05-16 23:32:02 +01:00
Philip Withnall
25b7ecf895
gitypelib: Fix iterating through typelib prefixes
The iteration code used `g_string_overwrite_len()` to try and simplify
buffer allocation and growth, but seemingly forgot to handle the fact
that it doesn’t nul-terminate what it overwrites: the method is intended
to be used to splice bits into longer strings, not to overwrite an
entire nul-terminated string.

This meant that when iterating over a comma-separated `c_prefix` like
`GUnix,G`, on the second iteration `g_string_overwrite_len()` would be
used to write `G` into index 0 of the already-set `GUnix` string in the
buffer, leading to the first iteration happening all over again and the
`G` prefix being ignored.

This led to symbols failing to be matched to the `GioUnix` typelib, even
though they should have been.

This will be checked by a test in the following commit.

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

Helps: #3303
2024-05-16 23:31:56 +01:00
Philip Withnall
04bdf50c68
girepository: Fix a typo in a code comment
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-05-16 23:31:49 +01:00
Philip Withnall
7e3ec9a8ae
girepository: Keep an ordered list of the loaded typelibs
There are various places where the set of typelibs is iterated over or
returned in an ordered way. In order to keep results deterministic and
reproducible, we need to keep this set ordered.

Keep a `GPtrArray` of the typelibs (one for fully-loaded ones and one
for lazy ones) alongside the existing hash tables. This will be used for
iteration in the next few commits.

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

Helps: #3303
2024-05-16 23:31:43 +01:00
Philip Withnall
c98805e5a1
ci: Temporarily run the FreeBSD on a schedule rather than every commit
The runner is currently offline and we can’t have that blocking
development.

See: https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/1503

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-05-16 22:42:16 +01:00
Philip Withnall
7548b4865f
tests: Fix clang compilation failure due to unrecognised option in pragma
Sigh.

```
../glib/tests/atomic.c:139:32: error: unknown warning group '-Wdiscarded-qualifiers', ignored [-Werror,-Wunknown-warning-option]
\#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
                               ^
1 error generated.
```

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-05-16 22:42:02 +01:00