629 Commits

Author SHA1 Message Date
Philip Withnall
e33be08bda 2.86.0
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-09-05 13:42:14 +01:00
Tobias Stoeckmann
48bf508bc1 docs: Fix typos
Typos found with codespell
2025-09-03 21:47:11 +02:00
Philip Withnall
354344fe59 2.85.4
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-08-22 13:29:34 +01:00
Philip Withnall
435dace60d Merge branch 'stp_devel' into 'main'
build: Fix stp files for development versions

See merge request GNOME/glib!4735
2025-08-09 19:44:05 +00:00
Philip Withnall
6812587543 2.85.3
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-08-08 17:09:19 +01:00
Parth Patel
483373a370 tests: Remove undefined symbols not present on AIX platform
`getpwnam_r()` and `getpwuid_r()` are not defined on AIX, so don’t
define wrappers for them in the `getpwuid-preload.c` test helper.

Fixes: #3755
2025-08-08 11:52:22 +01:00
Tobias Stoeckmann
20e145da59 build: Fix stp files for development versions
Development versions of glib like 2.85.2 produce library files with
names like "libglib-2.0.so.0.8502.0" whereas stable version names
are like "libglib-2.0.so.0.8400.2".

The produced stp files for SystemTap work for stable versions but not
for development versions.

Fix this by passing the correct variables into LT_CURRENT and
LT_REVISION.
2025-08-07 22:38:29 +02:00
Philip Withnall
131fe2b483 2.85.2
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-07-21 18:47:53 +01:00
Kate Hsuan
94e6da0fca gio: gmemorymonitorbase: parent class of GMemoryMonitor backends
This class provides the shared functions, such as sending a signal and
string and value conversion. The backend classes should inherit this
class to get the shared functions.

It adds a configure time check for `sysinfo()`, as some systems don’t
have it.
2025-07-21 16:09:46 +01:00
Philip Withnall
c1e8174992 2.85.1
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-06-13 12:28:00 +01:00
Kleis Auke Wolthuizen
0cbb5fb378 meson: Use the appropriate localedir option 2025-06-11 15:56:27 +02:00
Philip Withnall
b2f0bb9592 tests: Expand PATH for Python tests on Windows
This works around a Meson bug
(https://github.com/mesonbuild/meson/issues/4668).

If we have a Python test which spawns a built native binary, that binary is
listed in the `depends` argument of the `test()`. On Linux, this results in
the directories containing the built libraries which the binary depends on
being added to the `LD_LIBRARY_PATH` of the test invocation. On Windows,
however, Meson currently doesn’t add those directories to `PATH` (which is
the equivalent of `LD_LIBRARY_PATH`), so we have to do it manually.

This takes the same approach as Christoph Reiter did in
gobject-introspection
(13e8c7ff80/tests/meson.build (L2)).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-05-28 16:10:55 +01:00
Philip Withnall
4ddea1f6c0 gobject: Enable -Wsign-conversion for gobject subdirectory
Fixing #3405 is going to take a lot of work, so let’s split it up into
pieces and work on them separately. The `gobject/` and `gobject/tests/`
directories now compile cleanly with `-Wsign-conversion` (see the
previous commits), so let’s enable the warning for those directories to
prevent regressions while we continue to work on the other directories.

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

Helps: #3405
2025-04-11 23:48:19 +01:00
Philip Withnall
3779508a69 Merge branch '3617-date-week-of-year' into 'main'
gdate: Add week-of-year APIs for weeks starting on any day

Closes #3617

See merge request GNOME/glib!4506
2025-04-03 16:07:25 +00:00
Philip Withnall
f31c072005 Merge branch 'pgriffis/gresolver-onlyloopback' into 'main'
threadedresolver: Return valid addresses when only having loopback interfaces

Closes #3641

See merge request GNOME/glib!4566
2025-04-03 15:09:58 +00:00
Philip Withnall
8b3c34a523 build: Post-release version bump
This opens up the development cycle for 2.86.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-04-03 15:56:40 +01:00
Philip Withnall
eaa7e5bdfd 2.84.1
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-04-03 15:38:51 +01:00
Patrick Griffis
fe0139ee98 threadedresolver: Return valid addresses when only having loopback interfaces
The AI_ADDRCONFIG flag filters out addresses for invalid interfaces. This causes it to resolve nothing when only having loopback interfaces.

So we can detect if you only have loopback interfaces, request all addresses, and filter out non-loopback results.

Closes #3641
2025-03-24 09:44:55 -05:00
Bilal Elmoussaoui
5e50167da5 gi: Dynamically set doc-format 2025-03-15 10:27:13 +01:00
Philip Withnall
31546be3f8 build: Check for <netlink/netlink_route.h> for GNetworkMonitorNetlink
Apparently it’s possible for `netlink/netlink.h` to be available on
Linux, when we expected it to only be available on FreeBSD, but for
`netlink/netlink_route.h` to not exist. So add a check for the latter.

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

Fixes: #3630
2025-03-10 12:01:52 +00:00
Philip Withnall
05da47c2d0 2.84.0
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-03-06 13:09:13 +00:00
Philip Withnall
84f555a3aa 2.83.5
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-02-28 14:02:50 +00:00
Simon McVittie
66bca5f78b build: If pcre2 is a subproject, disable its unit tests by default
Debugging pcre2's test suite is out-of-scope for GLib, or for any larger
project that embeds GLib as a subproject.

Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/3626
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-02-28 12:17:29 +00:00
Marvin W
040b05649f Meson: Disable lint+no-valgrind tests when tests option is set to false 2025-02-26 13:12:28 +01:00
Simon McVittie
9f18bb6258 tests: Search the appropriate directories for our GIR XML inputs
During "as-installed" testing, we should search the GIR_DIR for GIR XML,
instead of hard-coding that it is `${prefix}/share/gir-1.0`. This is
not the case on at least Debian, in order to make it possible to
install more than one architecture's flavour of `GLib-2.0.gir`,
which contains some architecture-specific `#define`s.

Also search GOBJECT_INTROSPECTION_DATADIR/GIR_SUFFIX (in practice
something like `/usr/share/gir-1.0` in all cases) to accommodate
distributions like Debian that move the architecture-independent
majority of GIR XML into /usr/share to avoid duplication, leaving
only the architecture-specific minority of files like `GLib-2.0.gir`
in the GIR_DIR.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-02-21 16:40:47 +00:00
Philip Withnall
e35c796e62 2.83.4
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-02-20 12:37:13 +00:00
Philip Withnall
3c03076ac5 Merge branch 'unify-tests-launcher-scripts' into 'main'
tests: Cleanup python tests and add tests for gi-compile-repository and gi-inspect-typelib

See merge request GNOME/glib!4476
2025-02-12 17:00:15 +00:00
Marco Trevisan (Treviño)
4bcd99de43 tests: Avoid reusing and installing multiple files the taptestrunner
Add some basic support for having glib-tests-only python libraries that
can be shared across the various projects, so that we don't have to
maintain multiple copies of them.
2025-02-11 18:51:15 +01:00
Nirbheek Chauhan
8d07ae7ef1 meson: Fix typo in comment about python shebang 2025-02-11 21:37:49 +05:30
Dan Yeaw
160e55575e Windows: fix Python path cannot contain spaces
Move the shebang line from the full Python path of the build
machine to the first Python on the path during runtime. Set
the shebang in the main meson.build file so that it can be
overridden in one place if needed.

Fixes: #3331
2025-02-11 11:57:30 +00:00
Philip Withnall
445eea668a build: Add a soft dependency on C11
This will warn if GLib is configured with a toolchain which doesn’t
support C11. We currently require C99. If nobody complains (as directed
by this warning) we will start to require C11 in the next unstable
release series (2.85).

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3574#note_1859924

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-02-04 15:59:51 +00:00
Felix Xing
e99e27848e Add checking for <sys/ucred.h>
A new header check is added for non-standard <sys/ucred.h>. Some platforms, like Linux, might support <sys/param.h>, <sys/mount.h>, and <fstab.h> but not this. Which can cause compilation to fail for gio/gunixmounts.c
2025-02-03 09:19:17 -05:00
Felix Xing
a177c46b19 Add support for QNX8.0
This request brings support to the latest version of QNX software. _g_get_unix_mount_points (void) for getfsent() system also works on QNX. To avoid duplicating codes, it will be reused.
2025-01-31 09:18:02 -05:00
Philip Withnall
884925d02e 2.83.3
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-01-23 13:20:40 +00:00
Matthias Clasen
547edc4c3c Don't mark test setups as default in subprojects
This is problematic since meson is defective when it comes to
default test setups. It only allows a single such across all
(sub)projects.

See https://github.com/mesonbuild/meson/issues/12700
2024-12-17 08:18:29 -05:00
Chun-wei Fan
5642331603 GLib tests: Add test for g_win32_clear_com()
This mimicks the test for g_clear_object() in gobject/tests/reference.c.

We use the system's wincodec library for our sample here.
2024-12-13 10:45:09 +08:00
Philip Withnall
67b5a37f2b 2.83.2
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-11 17:19:24 +00:00
Philip Withnall
322d74b141 2.83.1
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-12-11 14:51:36 +00:00
John Ralls
9bbb1acd7d Raise minimum supported macOS version to 10.13 (High Sierra).
Allows removing all macOS version ifdefs.

Closes https://gitlab.gnome.org/GNOME/glib/-/issues/3441
2024-11-20 18:15:34 -08:00
Gleb Popov
02172bda73 Enable GNetworkMonitorNetlink on FreeBSD 2024-10-29 21:18:36 +03:00
Sebastian Dröge
f221864d6e glib: Don't require GLIB_DOMAIN to be a NUL-terminated string
The length might be passed explicitly in the field instead, and the
string might not have a NUL-terminator as happens for example when
passed from the Rust bindings.

This might lead to out of bounds reads.

Thanks to Sebastian Wiesner for noticing this.
2024-10-22 19:08:25 +03:00
Alan Coopersmith
5aabd288ad build: update _XOPEN_SOURCE setting for modern Solaris & illumos
Previously the build was requesting interfaces matching SUSv1/Unix95,
as implemented in Solaris 2.6 and later.  This changes it to try the
most recent version supported, and limits to the versions supported
by OS versions that meson supports.  This includes these _XOPEN_SOURCE
versions:

800 (2024): supported by illumos starting in July 2024
700 (2008): supported by Solaris 11.4 & illumos from 2014-2024
600 (2001): supported by Solaris 10-11.3 & illumos prior to 2014

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-10-14 17:41:32 -07:00
Alan Coopersmith
ef7b2c9a34 build: define __EXTENSIONS__ when building on Solaris & illumos
Like _GNU_SOURCE on glibc, this tells the header to define functions
not included in the requested standards versions.  This is needed to
build glib/tests/utils-c-89 with -std=c89 and utils-c-89 with -std=c99
and still be able to call functions like isnan() and realpath().

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-10-13 16:45:34 -07:00
Philip Withnall
4416d9dcce Merge branch '3488-introspection-checks' into 'main'
build: Check for gobject-introspection-1.0 as well as g-ir-scanner

Closes #3488

See merge request GNOME/glib!4329
2024-10-07 13:46:04 +00:00
Carlo Bramini
2986cd3793 Meson: fix support for aarch64-w64-mingw32 (Windows on ARM64)
This patch fixes a build error when compiling with GCC cross compiler for Windows on ARM64.
See issue #3490 for details.

Signed-off-by: Carlo Bramini carlo_bramini@users.sourceforge.net
Fixes: #3490
Closes #3490
2024-10-04 11:43:45 +02:00
Philip Withnall
04abc6b6c1 build: Check for gobject-introspection-1.0 as well as g-ir-scanner
Both are needed in practice to build the GIR files.

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

Fixes: #3488
2024-10-03 13:39:30 +01:00
Philip Withnall
f6d7878a54 Merge branch 'speed-up-query-exists' into 'main'
gio: Add a query_exists vfunc to GFile

See merge request GNOME/glib!4272
2024-10-01 15:45:04 +00:00
Matthias Clasen
65ad41d8a4 gio: Implement query_exists for local files
We can’t quite use `access()` for this, like `g_file_test()` does, as
`g_file_query_info()` considers a broken symlink to exist, so we need to
match that by passing `AT_SYMLINK_NOFOLLOW`.

We also use the `AT_EACCESS` flag, which makes the `faccessat()` call
cheaper on Hurd.

Systems without `faccessat()` will continue to use the
`g_file_query_info()`-based implementation of `g_file_query_exists()`.

(Commit message rewritten by Philip Withnall.)
2024-10-01 16:27:29 +01:00
Benjamin Gilbert
23009aadc6 build: switch back to c_std=gnu99 pending ObjC fix
It's better to warn by default on MSVC (which we were already doing before
we bumped to 1.4.0) than to fail by default on macOS.

Fixes: 51e3e7d9ae ("build: Bump Meson dependency to 1.4.0")
2024-09-25 07:45:06 -07:00
Gleb Popov
dae3b8bd15 Introduce a special mode of operating for the inotify GFileMonitor backend
libinotify-kqueue is a library that implements inotify interface in terms of
kqueue/kevent API available on Mac OS and *BSD systems. The original kqueue
backend seems to be a predecessor version of the code that is currently present
in libinotify-kqueue. Under the hood the library implements a sophisticated
filesystem changes detection algorithm that is derived from the glib backend
code.

Updating the native glib kqueue backend requires substantial work, because code
bases have diverged greatly. Another approach is taken, instead. libinotify-kqueue
can serve as a drop-in replacement for Linux inotify API, thus allowing to
reuse the inotify backend code. The compatibility, however, comes at cost, since
the library has to emulate the inotify descriptor via an unix domain socket.
This means that delivering an event involves copying the data into the kernel
and then pulling it back.

The recent libinotify-kqueue release adds a new mode of operation called "direct".
In this mode the socket pipe is replaced with another kqueue that is used to
deliver events via a kevent(EVFILT_USER) call.
Employing the direct mode requires minor changes to the client code compared
to using plain inotify API, but in return it allows for reusing libinotify's
algorithms without a performance penalty. Luckily, all required changes are
consolidated in one file called inotify-kernel.c

This puts us in the best of possible worlds. On one hand we share a lot of code
with glib inotify backend, which is far more thoroughly tested and widely used.
On the other we support a range of non-Linux systems and consolidate the business
logic in one library. I plan to do the same trick for QFileSystemWatcher which
will give us the same behaviour between Gtk and Qt applications.

The glib test suite passes for both old kqueue backend and new libinotify-kqueue
one. However, the AppStream FileMonitor tests are failing with the old backend,
but pass with the new one, so this is still an observable improvement.

Relevant libinotify-kqueue PR: https://github.com/libinotify-kqueue/libinotify-kqueue/pull/19
2024-09-19 09:54:56 +03:00