Commit Graph

32320 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
41a5228ee6 ci: Actually use token file when starting the issue bot
The issue bot has an entry-point, so it launches the tool by default and
that would fail as per the missing env variable:

  2025/10/30 17:57:43 unable to create GitLab client(s): please configure
  ISSUE_BOT_API_TOKEN environment variable (unable to find environment
  variable: ISSUE_BOT_API_TOKEN)

So, go manual instead for real for now.

See: https://gitlab.com/gitlab-org/distribution/issue-bot/-/issues/26
Related: https://gitlab.com/gitlab-org/distribution/issue-bot/-/merge_requests/27
2025-10-31 00:50:54 +01:00
Michael Catanzaro
6e05ef5e0a Merge branch 'ci-file-tokens' into 'main'
ci: Use CI/CD file variable tokens for secrets

See merge request GNOME/glib!4893
2025-10-30 10:33:53 -05:00
Marco Trevisan
9144ee6df5 Merge branch 'wip/chergert/RFC-1123' into 'main'
glib/gconvert: allow domain names starting with digit

Closes #3523 and chergert/ptyxis#490

See merge request GNOME/glib!4892
2025-10-30 04:48:11 +01:00
Marco Trevisan (Treviño)
bba1f8ac03 ci: Use CI/CD file variable tokens for secrets
We were leaking some tokens in artifacts, those tokens have been
invalidated and re-generated, but starting from now let's use file
tokens instead
2025-10-30 03:12:29 +01:00
Christian Hergert
de45be2674 glib/gconvert: allow hostnames with . in it
Continues on the fix for #3523 which allows for . to be used in a domain
label.

Fixes: chergert/ptyxis#490
Related: #3523

Signed-off-by: Christian Hergert <chergert@redhat.com>
2025-10-29 14:45:47 -07:00
Christian Hergert
bb2b668db6 glib/gconvert: allow domain names starting with digit
This previous behavior violates RFC-1123 which updated the original
RFC-952.

Patch originally from Ulrich Drepper.

Fixes: #3523

Signed-off-by: Christian Hergert <chergert@redhat.com>
2025-10-29 14:37:57 -07:00
Philip Withnall
a4962ca460 Merge branch 'g_unix_fd_query_path' into 'main'
glib-unix: Add Solaris implementation of g_unix_fd_query_path

See merge request GNOME/glib!4887
2025-10-28 00:09:52 +00:00
Philip Withnall
9249c40d77 Merge branch 'scan-build-fixes' into 'main'
Various scan-build fixes

Closes #3805

See merge request GNOME/glib!4875
2025-10-27 23:17:25 +00:00
Philip Withnall
85e4c53a8c Merge branch 'home_trailing_slash' into 'main'
gutils: Strip all trailing slashes

Closes #3811

See merge request GNOME/glib!4886
2025-10-27 22:55:39 +00:00
Philip Withnall
bfc7acbc88 Merge branch 'sysinfo' into 'main'
Fix `g_memory_monitor_base_query_mem_ratio` on Solaris

See merge request GNOME/glib!4860
2025-10-27 22:09:19 +00:00
Tobias Stoeckmann
cb3e9fe740 gutils: Strip all trailing slashes
The code stripped all but the first trailing slash in order to handle
the absolute root path "/". This breaks the removal of trailing slashes
for paths starting with $HOME, though.

Fix the logic to remove all trailing slashes if $HOME is encountered.

Closes #3811
2025-10-27 21:36:59 +00:00
Philip Withnall
4481a217c4 gdump: Handle feof() and ferror() separately
The return value from `fread()` doesn’t actually indicate whether the
read failed due to EOF or due to a read error.

Rework the code so that errors are reported correctly, EOF is handled
silently, and as a byproduct, blank lines in the input file are ignored
and skipped over.

Spotted by scan-build.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-27 21:34:08 +00:00
Philip Withnall
73514ed284 grand: Port /dev/urandom code from fread() to read()
Error handling in `fread()` is too complex, and the code explicitly
disables the buffering feature of `FILE`, so there’s little point in
using it.

Instead, use `open()`/`read()` directly. This avoids any buffering
issues, and gives us use of `errno` to check errors. `ferror()` doesn’t
give us any more information than “there was an error”.

This fixes an issue flagged by scan-build: that a failure in the first
`fread()` loop iteration would leave the `FILE` in an undefined state
(in particular, an undefined seek position) which would mess up the next
iteration. Since `ferror()` couldn’t actually tell us what the error was
(was it `EINTR`?) and `errno` is not guaranteed to be set by `fread()`,
the whole approach was doomed.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-27 21:34:01 +00:00
Philip Withnall
4937534257 glocalfileoutputstream: Fix error handling for a corner case
If asked to replace a file (i.e. effectively delete and re-create it)
which is a symlink, in a read-only directory, the code would end up
trying to do operations on an invalid `fd`. This was masked when asked
to create a backup, as creating the backup in the read-only
directory would error out just in time.

Make the code a bit more robust in this situation, and add some unit
tests.

Spotted by scan-build.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-27 21:33:54 +00:00
Philip Withnall
f1eeef3777 gspawn: Error out early if a target FD is invalid
Rather than passing it to `dup2()`, which scan-build thinks could cause
problems (I would have thought `dup2()` would just return `EBADF`, but
perhaps some implementations are buggy?).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-27 21:33:34 +00:00
Alan Coopersmith
ccb0954336 glib-unix: Add Solaris implementation of g_unix_fd_query_path
Provide implementation of !4876 for Solaris & illumos systems

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2025-10-27 21:31:33 +00:00
Alan Coopersmith
db165063f0 gio: add fallback implementation of g_memory_monitor_base_query_mem_ratio
Fallback for non-Linux systems that support the _SC_PHYS_PAGES and
_SC_AVPHYS_PAGES sysconf selectors, such as Solaris & OpenBSD.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2025-10-27 21:28:59 +00:00
Alan Coopersmith
80b1e3843f build: avoid sysinfo() on Solaris
Solaris inherited the SVR4 sysinfo() function, which takes a different
number of arguments from Linux, and provides information such as host
name and OS version, but not information on free or total memory.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2025-10-27 21:28:59 +00:00
Philip Withnall
afdf386580 Merge branch 'handle-regex-missing-number-terminator' into 'main'
gregex: Handle PCRE2_ERROR_MISSING_NUMBER_TERMINATOR if defined

Closes #3809

See merge request GNOME/glib!4884
2025-10-27 21:20:40 +00:00
Marco Trevisan (Treviño)
404aa57553 gregex: Add translatable message for PCRE2_ERROR_MISSING_NUMBER_TERMINATOR 2025-10-27 16:49:48 +01:00
Marco Trevisan (Treviño)
3bfe253c51 tests/regex: Add the error messages to tests
It can be useful for debugging purposes
2025-10-27 16:49:48 +01:00
Marco Trevisan (Treviño)
79f883aafb gregex: Handle PCRE2_ERROR_MISSING_NUMBER_TERMINATOR if defined
When the error is defined in a new enough PCRE2 we should handle it.

However let's not define an error message for this in this commit (just
let's use the old one that is generic enough), so that it can be backported
to stable versions without having to require new translations.

Closes: #3809
2025-10-27 16:49:48 +01:00
Nick Wilson
ec80449b1a glib/tests/regex: Add a future-proof test case for missing back reference
This test applies to both old and newer versions of PCRE2 where
back reference error has now increased the granularity and is referred
as PCRE2_ERROR_MISSING_NUMBER_TERMINATOR instead.

Co-Authored-By: Marco Trevisan <mail@3v1n0.net>
2025-10-27 16:48:46 +01:00
Philip Withnall
e0818cd12c Merge branch 'markup-byte-pos' into 'main'
Add g_markup_parse_context_get_offset

See merge request GNOME/glib!4879
2025-10-23 06:19:52 +00:00
Matthias Clasen
ea848032c2 Add g_markup_parse_context_get_offset
This is a small, helpful api that helps for finding error
locations in xml files, along the same lines as
g_markup_parse_context_get_position.
2025-10-22 15:24:10 -04:00
Philip Withnall
29e9549e2a Merge branch 'ug-translation' into 'main'
Update Uyghur translation

Closes #3808

See merge request GNOME/glib!4882
2025-10-22 13:45:26 +00:00
Philip Withnall
3b20cc978b Merge branch 'wip/3v1n0/fd-query-path' into 'main'
glib-unix: Add API to lookup file path from FD

Closes #3806

See merge request GNOME/glib!4876
2025-10-22 12:44:34 +00:00
Abduqadir Abliz
cf4fdeb01c Uyghur language translation updated. 2025-10-22 13:36:22 +01:00
Michael Catanzaro
921d3ac2de Merge branch 'pgriffis/localhost-only-ipv6' into 'main'
gresolver: Fix loopback detection of IPv6 addresses

See merge request GNOME/glib!4877
2025-10-21 16:16:27 -05:00
Patrick Griffis
549ed21ea1 gresolver: Fix loopback detection of IPv6 addresses
Previously the len passed to g_socket_address_new_from_native() was only
for IPv4 addresses and the constructor would fail.

This was reported and discussed here:
fe0139ee98 (note_2581394)
2025-10-21 15:43:21 -05:00
Philip Withnall
6ed80113f9 Merge branch 'wraps' into 'main'
subprojects: Update libffi, pcre2, proxy-libintl

See merge request GNOME/glib!4764
2025-10-21 20:23:30 +00:00
Philip Withnall
1e323b12b5 ci: Disable libffi subproject test suite on macos-arm64 CI runner
Currently two of the tests from libffi 3.5.2 fail on macos-arm64, and
this is not something I have any chance of debugging:
```
 481/1066 libffi:closures / closure_loc_fn0 -O0                           FAIL              0.54s   killed by signal 6 SIGABRT
――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
Check failed:
memcmp(pcl, FFI_CL(codeloc), sizeof(*pcl)) == 0
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

 485/1066 libffi:closures / cls_1_1byte -O0                               RUNNING
>>> ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_CHECK_=2 G_DEBUG=gc-friendly G_ENABLE_DIAGNOSTIC=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=147 LINT_WARNINGS_ARE_ERRORS=1 /Users/Shared/work/bgilbert/glib/_build/subprojects/libffi-3.5.2/testsuite/cls_1_1byte_O0

 482/1066 libffi:closures / closure_loc_fn0 -O2                           FAIL              0.55s   killed by signal 6 SIGABRT
――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
Check failed:
memcmp(pcl, FFI_CL(codeloc), sizeof(*pcl)) == 0
```

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-21 19:58:33 +01:00
Philip Withnall
49baef41a7 build: Disable --werror for libffi subproject
Version 3.5.2 emits some deprecation warnings on macOS, and those are
out of our control to fix, and also not relevant to the GLib build.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-21 19:28:13 +01:00
Philip Withnall
9bcce3ae49 ci: Update CI images to use latest subproject versions
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-21 19:09:55 +01:00
Benjamin Gilbert
c462700752 subprojects: Switch libffi from gstreamer's pre-3.3 fork to WrapDB's 3.5.2
WrapDB now maintains a Meson port of current libffi.  Stop shipping a
fallback that diverged from libffi upstream in 2018.
2025-10-21 18:51:39 +01:00
Benjamin Gilbert
60492abfe7 subprojects: Update proxy-libintl to 0.5
This is the same commit we were already pinning to, but now that there's
a release, we can switch to the WrapDB wrap so `meson wrap update` will
pick up future releases.
2025-10-21 18:51:39 +01:00
Benjamin Gilbert
e31cbb09b3 subprojects: Update pcre2 to 10.46 2025-10-21 18:51:39 +01:00
Marco Trevisan (Treviño)
dda9b9cc79 gio/tests/fake-document-portal: Use g_unix_fd_query_path()
Fixes: bc35a149
Closes: #3806
2025-10-21 19:17:46 +02:00
Marco Trevisan (Treviño)
10e9072634 gio/fake-desktop-portal: Use g_unix_fd_query_path 2025-10-21 19:17:46 +02:00
Marco Trevisan (Treviño)
d44c0f2ff7 glib-unix: Add API to lookup file path from FD
We have various APIs that return FDs (such as g_mkstemp) but we do not
have a generic way to get the file name from it.

As per this, provide a simple and cross-platform way to lookup the file
path for an open FD.

This is marked as an unix-only API, although it could be technically be
implemented for windows too
2025-10-21 19:17:44 +02:00
Philip Withnall
f4980cfdf0 Merge branch 'macos-ntime' into 'main'
glocalfileinfo: implement _g_stat_{a,c,m}_nsec for macOS

Closes #3070 and #2608

See merge request GNOME/glib!4869
2025-10-21 17:08:24 +00:00
Philip Withnall
c703f8a561 Merge branch 'macos-ci-apfs-tmpdir' into 'main'
ci: use APFS for macOS TMPDIR

See merge request GNOME/glib!4874
2025-10-21 14:15:55 +00:00
André Barnabá Silva
9222f71753 glocalfileinfo: implement _g_stat_{a,c,m}_nsec for macOS
add implementations for these functions using st_{a,c,m}timespec when
__APPLE__ is defined. Also re-enable the g-file-info test for darwin.

Fixes #3070, #2608
2025-10-20 23:37:42 -03:00
André Barnabá Silva
07736dc3d2 ci: use APFS for macOS TMPDIR 2025-10-20 22:38:12 -03:00
Philip Withnall
e6c5288196 Merge branch 'dbus-interface-get-info-nullable' into 'main'
Mark return value of g_dbus_interface_get_info() as `nullable`

See merge request GNOME/glib!4856
2025-10-20 21:48:41 +00:00
Sebastian Dröge
bdd51aa8ca Mark return value of g_dbus_interface_get_info() as nullable
`GDBusProxy` implements this interface but allows construction with a
`NULL` interface info and also marks its getter/setter for the interface
info accordingly.

Callers of `g_dbus_interface_get_info()` need to assume that it can
return `NULL` unless they constructed the `GDBusInterface` in a way that
guarantees that the interface info is available.
2025-10-20 20:47:38 +00:00
Philip Withnall
e7a6f4664d Merge branch '3803-netlink-notify-connectivity' into 'main'
gnetworkmonitorbase: Add missing notify::connectivity signal

Closes #3803

See merge request GNOME/glib!4871
2025-10-20 20:42:17 +00:00
Philip Withnall
4b085a6853 Merge branch 'macos_ci' into 'main'
Fix macOS CI by providing working temp directory

Closes Infrastructure/Infrastructure#2091

See merge request GNOME/glib!4868
2025-10-20 15:32:57 +00:00
Philip Withnall
bbc508b78f gnetworkmonitorbase: Add missing notify::connectivity signal
The connectivity is directly derived from the `is_available` variable,
so if that changes, we need to notify of a change in `connectivity` too.

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

Fixes: #3803
2025-10-20 16:15:45 +01:00
Marco Trevisan
0c89c8532f Merge branch 'reenable-msys2-ci' into 'main'
Reenable MSYS2 CI

See merge request GNOME/glib!4870
2025-10-20 15:31:27 +02:00