Commit Graph

30695 Commits

Author SHA1 Message Date
Rafael Fontenelle
3a184c0059 Update Brazilian Portuguese translation 2024-09-02 16:02:14 +00:00
Philip Withnall
e12ffff43c Merge branch 'glib-2-82' into 'glib-2-82'
Update fa.po

See merge request GNOME/glib!4233
2024-09-02 15:10:33 +00:00
Danial Behzadi
93679f9d4a Update fa.po 2024-09-02 14:30:50 +00:00
Philip Withnall
0771249575 Merge branch 'patch-2-pt' into 'glib-2-82'
Update Portuguese translation

See merge request GNOME/glib!4231
2024-09-02 09:34:21 +00:00
Hugo Carvalho
73ac8840f8 Replace pt.po
Update Portuguese translation
2024-09-01 21:54:43 +00:00
Philip Withnall
5eeae58de7 Merge branch 'cs-update-2-82' into 'glib-2-82'
Update Czech translation [glib-2-82]

See merge request GNOME/glib!4230
2024-09-01 21:47:29 +00:00
AsciiWolf
6e1d35c643 Update Czech translation 2024-09-01 21:36:24 +02:00
Philip Withnall
1f502b00eb Merge branch 'piotrdrag/pl-translation-240831' into 'glib-2-82'
Update Polish translation for glib-2-82

See merge request GNOME/glib!4229
2024-09-01 17:23:01 +00:00
Piotr Drąg
b9f45f109b Update Polish translation 2024-08-31 15:09:15 +02:00
Michael Catanzaro
43c71b27e4 Merge branch 'backport-4219-bash-glib-2-82' into 'glib-2-82'
Backport !4219 “tests: Run lint tests with detected bash” to glib-2-82

See merge request GNOME/glib!4221
2024-08-28 13:24:09 +00:00
Michael Catanzaro
fbc65c1d12 Merge branch 'backport-4217-mtab-fixes-glib-2-82' into 'glib-2-82'
Backport !4217 “tests: Test against a sample mtab file in unix-mounts for getmntent()” to glib-2-82

See merge request GNOME/glib!4220
2024-08-28 13:18:42 +00:00
Benjamin Gilbert
8ed025769e tests: Run lint tests with detected bash
When we invoke a shell script directly, the system selects a bash binary
that might be different from the one detected by find_program('bash').
Explicitly use the one detected by Meson, matching the behavior of our
other test() invocations on shell scripts.

Fixes test failure on Windows in GitHub Actions CI:

    stdout: 1: UNKNOWN: Windows Subsystem for Linux has no installed distributions.
    stdout: 2: UNKNOWN: Distributions can be installed by visiting the Microsoft Store:
    stdout: 3: UNKNOWN: https://aka.ms/wslstore

Found-by: Benoit Pierre <benoit.pierre@gmail.com>
Fixes: d7601f7eed ("Incorporate some lint checks into `meson test`")
2024-08-28 11:02:53 +01:00
Philip Withnall
729b932d0b
tests: Test against a sample mtab file in unix-mounts for getmntent()
The test in `unix-mounts` to see whether `g_unix_mounts_get_from_file()`
can parse an example file was working fine when GLib is built with
libmount, but not when built without it (and hence typically using
`getmntent()`).

This is because libmount supports mountinfo files (like
`/proc/self/mountinfo`), but `getmntent()` only supports mount files
(like `/proc/mounts`). The test was written only with the former.

So, change the test to use mount files when GLib is built without
libmount support.

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

Fixes: #3456
2024-08-28 10:59:38 +01:00
Philip Withnall
8200545ece
2.82.0
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-26 10:17:20 +01:00
Philip Withnall
d7795da6ab Merge branch 'backports-to-glib-2-82' into 'glib-2-82'
Various small backports to glib-2-82

See merge request GNOME/glib!4213
2024-08-26 09:03:42 +00:00
Philip Withnall
27e5e4d4a2 Merge branch 'backport-4214-mutex-speedup-glib-2-82' into 'glib-2-82'
Backport !4214 “gthread: Move thread _impl functions to static inlines for speed” to glib-2-82

See merge request GNOME/glib!4215
2024-08-26 08:27:42 +00:00
Philip Withnall
e2875a9fca
gthread: Move thread _impl functions to static inlines for speed
The changes made in commit bc59e28bf6
(issue #3399) fixed introspection of the GThread API. However, they
introduced a trampoline in every threading function. So with those
changes applied, the disassembly of `g_mutex_lock()` (for example) was:
```
0x7ffff7f038b0 <g_mutex_lock>    jmp 0x7ffff7f2f440 <g_mutex_lock_impl>
0x7ffff7f038b5                   data16 cs nopw 0x0(%rax,%rax,1)
```

i.e. It jumps straight to the `_impl` function, even with an optimised
build. Since `g_mutex_lock()` (and various other GThread functions) are
frequently run hot paths, this additional `jmp` to a function which has
ended up in a different code page is a slowdown which we’d rather avoid.

So, this commit reworks things to define all the `_impl` functions as
`G_ALWAYS_INLINE static inline` (which typically expands to
`__attribute__((__always_inline__)) static inline`), and to move them
into the same compilation unit as `gthread.c` so that they can be
inlined without the need for link-time optimisation to be enabled.

It makes the code a little less readable, but not much worse than what
commit bc59e28bf6 already did. And perhaps
the addition of the `inline` decorations to all the `_impl` functions
will make it a bit clearer what their intended purpose is
(platform-specific implementations).

After applying this commit, the disassembly of `g_mutex_lock()`
successfully contains the inlining for me:
```
=> 0x00007ffff7f03d80 <+0>:	xor    %eax,%eax
   0x00007ffff7f03d82 <+2>:	mov    $0x1,%edx
   0x00007ffff7f03d87 <+7>:	lock cmpxchg %edx,(%rdi)
   0x00007ffff7f03d8b <+11>:	jne    0x7ffff7f03d8e <g_mutex_lock+14>
   0x00007ffff7f03d8d <+13>:	ret
   0x00007ffff7f03d8e <+14>:	jmp    0x7ffff7f03610 <g_mutex_lock_slowpath>
```

I considered making a similar change to the other APIs touched in #3399
(GContentType, GAppInfo, GSpawn), but they are all much less performance
critical, so it’s probably not worth making their code more complex for
that sake.

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

Fixes: #3417
2024-08-26 08:38:58 +01:00
Philip Withnall
635b033a2b
docs: Set -Dglib_debug=enabled by default and document it for distros
As per https://gitlab.gnome.org/GNOME/glib/-/issues/3421#note_2206315:

It seems like there’s agreement that glib_debug should be enabled for
developers and disabled for distros; and it also seems like there’s no
reliable way to figure this out magically (because not everyone ties
things to `-Dbuildtype=*`). So, we’re left with forcing some group of
people to manually set the value of `glib_debug`. There are more
developers/contributors than there are distros, and distros are more
likely to notice an accidentally-slow GLib package than developers are
likely to notice an accidentally-not-asserting-hard-enough local build,
so let’s say:

The default should be `-Dglib_debug=enabled`, and distros should probably
all override that to `-Dglib_debug=disabled`.

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

Fixes: #3421
2024-08-25 18:45:58 +01:00
Philip Withnall
4f85dfe34b
meson: Fix reference to docs/macros.md in meson.options
It was renamed from `macros.txt` a while ago.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-25 18:45:51 +01:00
Philip Withnall
9a0b1498e0
gmenumodel: Acknowledge in docs that the UI used in the example is old
This kind of deeply nested menu is definitely no longer good UI practice
for most apps (deeply nested menus make things hard to find, and require
good mouse control to navigate). However, it does serve as a good
demonstration of the concepts in `GMenuModel`, so keep it, with a
sentence to acknowledge that it’s not a good UI.

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

Fixes: #3451
2024-08-25 18:44:13 +01:00
Philip Withnall
d0a49ddcb3
build: Check for epoll_create1 rather than epoll_create in meson.build
Because `epoll_create1()` is what the code in `giounix-private.c`
actually uses.

Spotted by Xuntao Chi.

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

Fixes: #3450
2024-08-25 18:44:06 +01:00
Michael Catanzaro
7de17e64f6 Merge branch '3448-revert-cancellable-locking-changes' into 'glib-2-82'
Revert !2765 “GCancellable: Use per-instance mutex logic instead of global critical sections” for glib-2-82

See merge request GNOME/glib!4211
2024-08-25 17:33:32 +00:00
Philip Withnall
f9668b92e4
Revert "gio/tests: Ensure that a GCancellableSource can be used muliple times"
This reverts commit 0a8cb10f22.

Merge request !2765 has caused a thread safety regression in
`GCancellableSource` disposal. It landed too late in the cycle to fix
with any confidence before the 2.82 release, so the changes are being
reverted for the `glib-2-82` branch and 2.82.0 release.

Fixes: #3448
Re-opens: #774, #2309, #2313
2024-08-25 17:39:50 +01:00
Philip Withnall
5d66cf7cee
Revert "GCancellable: Use per-instance mutex logic instead of global critical sections"
This reverts commit 3a07b2abd4.

Merge request !2765 has caused a thread safety regression in
`GCancellableSource` disposal. It landed too late in the cycle to fix
with any confidence before the 2.82 release, so the changes are being
reverted for the `glib-2-82` branch and 2.82.0 release.

Fixes: #3448
Re-opens: #774, #2309, #2313
2024-08-25 17:39:40 +01:00
Philip Withnall
36f08c0495
Revert "gcancellable: Reference the object before locking when doing signal emission"
This reverts commit 54d9c26b34.

Merge request !2765 has caused a thread safety regression in
`GCancellableSource` disposal. It landed too late in the cycle to fix
with any confidence before the 2.82 release, so the changes are being
reverted for the `glib-2-82` branch and 2.82.0 release.

Fixes: #3448
Re-opens: #774, #2309, #2313
2024-08-25 17:39:30 +01:00
Philip Withnall
266e892a5e
Revert "gcancellable: Mark assert-only variable as unused"
This reverts commit 6c679fb37a.

Merge request !2765 has caused a thread safety regression in
`GCancellableSource` disposal. It landed too late in the cycle to fix
with any confidence before the 2.82 release, so the changes are being
reverted for the `glib-2-82` branch and 2.82.0 release.

This commit is not problematic, but is built entirely on top of the
problematic MR, so has to be reverted.

Fixes: #3448
Re-opens: #774, #2309, #2313
2024-08-25 17:39:04 +01:00
Philip Withnall
282545565a Merge branch 'ci-msys2-mingw32-catch-access-violation' into 'main'
CI/msys2-mingw32: Set the G_DEBUGGER environment variable

See merge request GNOME/glib!4205
2024-08-25 15:36:08 +00:00
Philip Withnall
87ebb444a5 Merge branch 'translation' into 'main'
Update Chinese translation

See merge request GNOME/glib!4207
2024-08-25 14:31:03 +00:00
Philip Withnall
626ab87d16 Merge branch 'update-sv-translation' into 'main'
Update Swedish translation

See merge request GNOME/glib!4208
2024-08-25 14:27:30 +00:00
Anders Jonsson
052b295ac2 Update Swedish translation 2024-08-25 14:06:59 +02:00
lumingzh
f2007e0cfd update Chinese translation 2024-08-24 13:14:03 +00:00
Luca Bacci
84c2d64436 docs: Don't reference Unix-only method GLib.Source.add_unix_fd
gi-docgen won't find the method on Windows
2024-08-23 15:57:13 +02:00
Luca Bacci
1265b456d1 CI/msys2-mingw32: Set G_DEBUGGER environment variable
This enables us to catch access violation errors in CI and
get meaningful stacktraces with gdb.

Helps #3042

See https://docs.gtk.org/glib/running.html#environment-variables
2024-08-23 15:41:34 +02:00
Philip Withnall
3d53902fc3 Merge branch 'fix_typo_in_comment' into 'main'
issue 3428: fix comment in escape_string

Closes #3428

See merge request GNOME/glib!4200
2024-08-21 10:03:55 +00:00
LI Daobing
0ad7709c22 issue 3428: fix comment in escape_string 2024-08-20 18:24:33 -07:00
Michael Catanzaro
255ffe09d4 Merge branch 'unixmounts-fixes' into 'main'
gunixmounts: Fix use of uninitialised variable

See merge request GNOME/glib!4197
2024-08-20 16:21:24 +00:00
Philip Withnall
23a7b4bf17 Merge branch 'wip/pwithnall/cancellable-test-fixes' into 'main'
tests: Run expected-to-hang cancellable tests in subprocesses

See merge request GNOME/glib!4198
2024-08-20 13:40:34 +00:00
Philip Withnall
ce71da63ba
Revert "gio/tests/cancellable: Explain failure on GCancellableSource tests on valgrind"
This reverts commit 365411ea32.

Since commit 3a07b2abd4, issue 2309 has
been fixed, so we should no longer have failures from valgrind here.
2024-08-20 13:02:43 +01:00
Philip Withnall
71cd903118
tests: Run expected-to-hang cancellable tests in subprocesses
These tests are expected to cause a thread to deadlock. That seems to be
fine with glibc on Linux, but the glibc version on FreeBSD can detect
the deadlock, and aborts the whole test process with:
```
GLib (gthread-posix.c): Unexpected error from C library during 'pthread_mutex_lock': Resource deadlock avoided.  Aborting.
```

This is fair enough.

To avoid this causing the test suite to fail, run those two tests in
subprocesses. This also means we’re not carrying a deadlocked thread
around for the rest of the test suite.

Improves on commit 62192925b6.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-20 13:02:36 +01:00
Philip Withnall
4235c11757
gunixmounts: Fix use of uninitialised variable
And drop a load of unused variables.

Fixes commit 5040cf1943.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-20 12:39:15 +01:00
Philip Withnall
fe5b9b41b7 Merge branch 'main' into 'main'
Replace hi.po with updated translations.

See merge request GNOME/glib!4195
2024-08-19 11:46:09 +00:00
Karunakar Guntupalli
f67081e118 Replace hi.po with updated translations.
Please refer for veritimus submission -  https://l10n.gnome.org/vertimus/400/390/62/
2024-08-17 18:38:04 +00:00
Philip Withnall
73f5ca5763
2.81.2
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-16 19:37:20 +01:00
Marco Trevisan
e113052558 Merge branch 'wip/pwithnall/3315-sigaltstack-again' into 'main'
tests: Move alternate stack onto the heap rather than the main stack

Closes #3315

See merge request GNOME/glib!4194
2024-08-16 14:47:13 +00:00
Philip Withnall
84728d4e01
tests: Move alternate stack onto the heap rather than the main stack
And size it to `sysconf (_SC_MINSIGSTKSZ)`, if defined.

This might fix the sigaltstack test on muslc, as suggested by Markus
Wichmann (https://www.openwall.com/lists/musl/2024/05/30/2) and Rich Felker
(https://www.openwall.com/lists/musl/2024/05/29/7) on the musl mailing
list.

The thinking is that the CI machine might have a huge register file
(AVX512 or some other large extension) which doesn’t fit in `MINSIGSTKSZ`.
By sizing the alternate stack to `sysconf (_SC_MINSIGSTKSZ)` we should
be able to avoid that.

Moving it onto the heap should avoid any potential complications or bugs
from having one stack embedded within another.

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

Fixes: #3315
2024-08-16 14:27:25 +01:00
Philip Withnall
f4aceb0e91 Merge branch 'wip/pwithnall/unix-mount-tests' into 'main'
gunixmounts: Add mount point/entry getters from files and add tests based on them

See merge request GNOME/glib!4163
2024-08-15 14:25:52 +00:00
Emmanuele Bassi
b540bdd961 Merge branch 'volume-docs' into 'main'
docs: Clarify distinction between GDrive, GVolume and GMount

See merge request GNOME/glib!4193
2024-08-15 11:06:36 +00:00
Philip Withnall
b4332b0056
docs: Clarify distinction between GDrive, GVolume and GMount
Provide examples of what they all represent, and expand on the
descriptions of them in a few places.

Move references to their equivalents from `GnomeVFS` to lower down in
the documentation, since `GnomeVFS` has been deprecated for many years
now, and is unlikely to be pertinent to most readers.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-15 11:32:37 +01:00
Philip Withnall
67b4a27569 Merge branch 'ghrfunc-doc' into 'main'
ghash: Fix the documentation of GHRFunc

See merge request GNOME/glib!4192
2024-08-15 10:22:07 +00:00
Adrien Plazas
46ec058d2a ghash: Fix the documentation of GHRFunc
This function type isn't only used by g_hash_table_foreach_remove(), and
what happens to the data when we return TRUE depends on the calling
function.

Includes a port to modern gi-docgen syntax by Emmanuele Bassi.

Signed-off-by: Adrien Plazas <adrien.plazas@codethink.co.uk>
2024-08-15 10:22:07 +00:00