Commit Graph

30704 Commits

Author SHA1 Message Date
AsciiWolf
18f8588d4f Update Czech translation 2024-08-30 12:18:33 +02:00
Philip Withnall
58844c7919 Merge branch 'catalan' into 'main'
Update Catalan translation

See merge request GNOME/glib!4224
2024-08-30 08:00:29 +00:00
Philip Withnall
cc4673d791 Merge branch '20240830-update-ko' into 'main'
Update Korean translation

See merge request GNOME/glib!4223
2024-08-30 07:59:30 +00:00
Jordi Mas
cb7b650205 Update Catalan translation 2024-08-30 06:09:59 +02:00
Changwoo Ryu
4205d1b9f4 Update Korean translation 2024-08-30 09:00:00 +09:00
Emmanuele Bassi
14ed56fde8 Merge branch '3460-readme-link' into 'main'
docs: Clarify link in README.md

Closes #3460

See merge request GNOME/glib!4222
2024-08-29 08:35:46 +00:00
Philip Withnall
0df6e9d684
docs: Clarify link in README.md
The new merge request link only works when logged in to a GitLab
account, unfortunately. Make that clear in the readme.

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

Fixes: #3460
2024-08-29 08:58:36 +01:00
Philip Withnall
6c41e77913 Merge branch 'bash' into 'main'
tests: Run lint tests with detected bash

See merge request GNOME/glib!4219
2024-08-28 09:49:35 +00:00
Michael Catanzaro
42802d32de Merge branch '3456-mountinfo-files-in-tests' into 'main'
tests: Test against a sample mtab file in unix-mounts for getmntent()

Closes #3456

See merge request GNOME/glib!4217
2024-08-27 18:46:02 +00:00
Benjamin Gilbert
ca77a1625d 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-27 11:40:18 -07:00
Philip Withnall
43940d88f4 Merge branch 'persian-l10n' into 'main'
Persian l10n

See merge request GNOME/glib!4218
2024-08-27 15:26:55 +00:00
Danial Behzadi
687b8fac1b Persian l10n 2024-08-27 15:26:55 +00:00
Philip Withnall
2135a2419d Merge branch 'wip/chergert/g_ref_string_equal' into 'main'
refstring: add GEqualFunc for ref-counted strings

See merge request GNOME/glib!4196
2024-08-27 13:51:06 +00:00
Philip Withnall
27c02a0be4
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-27 12:13:35 +01:00
Christian Hergert
6ad7bcfc36 refstring: add GEqualFunc for ref-counted strings
This is the same as g_str_equal() except that it will first check the
string length for equality before dereferencing string contents.
2024-08-27 11:36:21 +01:00
Philip Withnall
c242972043 Merge branch 'ewlsh/gi-async-function-annotations' into 'main'
girepository: Add APIs for sync, async, and finish function annotations

See merge request GNOME/glib!3746
2024-08-26 16:40:54 +00:00
Philip Withnall
bfd1d73841 Merge branch 'version-bump' into 'main'
build: Post-release version bump

See merge request GNOME/glib!4216
2024-08-26 11:22:30 +00:00
Philip Withnall
e6c26caf44
ci: Also build gobject-introspection in test-msys2.sh
The build instructions for msys2 builds are stored outwith
`.gitlab-ci.yml`.

We need to build a specific (recent) version of gobject-introspection so
we can get support for async annotations in `g-ir-scanner`. See !3746.

Fixes commit 93271385f9.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-26 12:08:44 +01:00
Philip Withnall
39671c196d
girepository: Fix hole in GIFunctionInfoFlags
It’s unclear why there was a hole in this. Let’s keep things less
confusing by eliminating it.

Fixes commit 453dd4be9e.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-26 12:08:28 +01:00
Philip Withnall
0a60b57fd4
girepository: Fix API version ‘since’ numbers
Fixes commit 453dd4be9e.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-26 12:08:13 +01:00
Philip Withnall
10177cf3ea
girepository: Coding style fixes
Fixes commit 453dd4be9e.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-26 12:07:49 +01:00
Evan Welsh
453dd4be9e girepository: Add APIs for sync, async, and finish function annotations 2024-08-26 12:07:25 +01:00
Evan Welsh
93271385f9 ci: Set gobject-introspection version and build gobject-introspection in tests
The minimum version is now 1.80.0
2024-08-26 12:07:25 +01:00
Philip Withnall
b0ac7acb8e Merge branch 'wip/pwithnall/3415-freebsd-gmodule' into 'main'
Revert "gmodule-dl: Use RTLD_DEFAULT on FreeBSD too"

Closes #3415

See merge request GNOME/glib!4199
2024-08-26 10:36:20 +00:00
Philip Withnall
ea44c0e4e0
build: Post-release version bump
This opens up the development cycle for 2.84.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-26 10:42:32 +01:00
Philip Withnall
593b88bf1f Merge branch '3417-mutex-speedup' into 'main'
gthread: Move thread _impl functions to static inlines for speed

Closes #3417

See merge request GNOME/glib!4214
2024-08-26 07:35:58 +00:00
Philip Withnall
aec5785e7b
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-25 21:56:14 +01:00
Philip Withnall
f92da0cb49 Merge branch '3421-glib_debug-docs' into 'main'
docs: Set -Dglib_debug=enabled by default and document it for distros

Closes #3421

See merge request GNOME/glib!4212
2024-08-25 18:51:13 +00:00
Philip Withnall
b02e29558f
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:34:05 +01:00
Philip Withnall
94078c9f96
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:25:51 +01:00
Michael Catanzaro
e5997f1eac Merge branch '3451-ui-example' into 'main'
gmenumodel: Acknowledge in docs that the UI used in the example is old

Closes #3451

See merge request GNOME/glib!4210
2024-08-25 17:21:20 +00:00
Michael Catanzaro
36eed2042d Merge branch '3450-epoll-create' into 'main'
build: Check for epoll_create1 rather than epoll_create in meson.build

Closes #3450

See merge request GNOME/glib!4209
2024-08-25 17:21:06 +00: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
dfed38ef03
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 15:34:32 +01: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
fd8ede0b66
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 15:28:21 +01: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
82295998ac
Revert "gmodule-dl: Use RTLD_DEFAULT on FreeBSD too"
This reverts commit bb2ab2647d.

It appears to break the use of `G_MODULE_BIND_LOCAL`, as evidenced by
the `test_local_binding()` test in `module-test.c` failing on FreeBSD
ever since that test was added. See #3415.

Looking back at the merge request (!3656), I should have pressed for
detail on why this change was needed.

Fixes: #3415
2024-08-20 14:47:23 +01: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