Commit Graph

29054 Commits

Author SHA1 Message Date
Jordan Williams
9cd7cccdd3
Increase required Python version to 3.7
This version of Python supports the packaging module.
2023-12-01 09:51:15 -06:00
Michael Catanzaro
438f59b071 Merge branch 'style-check-fix' into 'main'
ci: Fix printing info message at end of run-style-check-diff.sh

See merge request GNOME/glib!3735
2023-11-30 00:38:13 +00:00
Michael Catanzaro
6c46afbf48 Merge branch 'wip/pwithnall/791-disable-nagle' into 'main'
gsocket: Enable TCP_NODELAY by default for stream GSockets

Closes #791

See merge request GNOME/glib!3738
2023-11-30 00:27:38 +00:00
Philip Withnall
039876e6d9 gsocket: Enable TCP_NODELAY by default for stream GSockets
`TCP_NODELAY` disables Nagle’s algorithm, which is generally a better
default for modern networks than having it enabled. Nagle’s algorithm
delays sending small data blobs until they fill an entire TCP segment,
so as to amortise the cost of sending the segment.

This improves bandwidth at the cost of latency. Given the large
bandwidth capabilities of most modern networks, most streams are
constrained by latency rather than bandwidth, so disabling Nagle’s
algorithm makes sense.

Various other major bits of software (such as libcurl) already disable
Nagle’s algorithm by default.

Specific applications which need it can turn it back on by calling
`g_socket_set_option()`.

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

Fixes: #791
2023-11-29 17:08:10 +00:00
Philip Withnall
641bea17f2 Merge branch '3037-capitalisation' into 'main'
docs: Consistently capitalise page titles

Closes #3037

See merge request GNOME/glib!3737
2023-11-29 15:48:02 +00:00
Philip Withnall
48963118b2 Merge branch 'wip/sophie-h/remove-nick-blurb' into 'main'
Remove all nicks and blurbs from param specs

Closes #2991

See merge request GNOME/glib!3411
2023-11-29 13:54:41 +00:00
Philip Withnall
c4b47c708d gwin32appinfo: Use correct gettext macro
`P_()` is for pspec strings — it gave us the option to split them out to
a separate translation domain. `_()` is for normal strings.

Spotted by Sophie Herold: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3411#note_1733329

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-29 13:41:34 +00:00
Sophie Herold
0d268c4825 Remove all nicks and blurbs from param specs
Nicks and blurbs don't have any practical use for gio/gobject libraries.
Leaving tests untouched since this features is still used by other libraries.

Closes #2991
2023-11-29 13:41:34 +00:00
Philip Withnall
f3aebf0c15 gio: Add various missing property documentation comments
Previously these properties would have been documented using the strings
from the pspec, but those will be removed in the following commit. Re-add
the documentation using those strings, but as gi-docgen documentation
comments.

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

Helps: #2991
2023-11-29 13:41:12 +00:00
Philip Withnall
7b2ac3c82e docs: Consistently capitalise page titles
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:13:13 +00:00
Philip Withnall
f6a1599e3c Merge branch '3183-arg0-paths' into 'main'
gdbusconnection: Support matching object paths with arg0 matching

Closes #3183

See merge request GNOME/glib!3720
2023-11-29 10:09:45 +00:00
Philip Withnall
93eeed4023 Merge branch 'wip/pwithnall/3119-Ey-years' into 'main'
gdatetime: Disable ERA support on platforms which don’t support this

See merge request GNOME/glib!3734
2023-11-29 00:14:18 +00:00
Philip Withnall
4b8bbd6f33 meson: Fail configure if nl_langinfo() supports a weird set of options
The `#include <langinfo.h>` in `gdatetime.c` is currently predicated on
`HAVE_LANGINFO_TIME`, but it’s needed for all the `HAVE_LANGINFO_*`
features.

It seems the code implicitly assumes that `HAVE_LANGINFO_TIME` will be
true if any other `HAVE_LANGINFO_*` macros are true. While I haven’t
seen this assumption be broken in practice, it seems prudent to
explicitly encode that in the configure tests. It’s easy enough to do.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-28 23:56:22 +00:00
Philip Withnall
8ee00cbad8 gdatetime: Disable ERA support on platforms which don’t support this
So far, that’s BSD: it supports `nl_langinfo()`, but not `ERA`.

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

Helps: #3119
2023-11-28 23:56:22 +00:00
Philip Withnall
26f70e7605 ci: Remove unused variable from run-style-check-diff.sh
This was forgotten in commit c2e21a8164.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-28 23:45:22 +00:00
Philip Withnall
bfa2f9091f ci: Fix printing info message at end of run-style-check-diff.sh
The changes in commit 95479256df didn’t
completely work (or some other change has broken them since): the
informational message at the end of the script is now not printed.

Fix that by stopping bash exiting immediately if the subshell exits, by
using it in a boolean expression.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-28 23:43:33 +00:00
Philip Withnall
9eda0b2fcd gdatetime: Fix typo in comment
This was pointed out in the review for !3696 but owing to a mistake by
me, the fix was not included in the version of the MR which was merged.

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

Helps: #3119
2023-11-28 23:14:40 +00:00
Philip Withnall
c8e3302007 gdatetime: Fix copyright/author information on recent GDateTime changes
I wrote the changes before clarifying the copyright status of my
contract with the GNOME Foundation, and forgot to update them.

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

Helps: #3119
2023-11-28 23:13:27 +00:00
Philip Withnall
2ada5ba0f1 Merge branch '3119-Ey-years' into 'main'
gdatetime: Add support for %E modifier to g_date_time_format()

Closes #3119

See merge request GNOME/glib!3696
2023-11-28 20:08:10 +00:00
Philip Withnall
517a3ac861 tests: Set locale to C.UTF-8 in datetime tests
It was previously set (by default) to `C`, so this commit doesn’t change
the locale behaviour of the tests, but does ensure that messages printed
by the tests are correctly formatted in UTF-8 rather than transliterated
to ASCII.

That makes interpreting test output easier.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-11-28 19:32:03 +00:00
Philip Withnall
09fe2aa78d gdatetime: Fix a minor leak on changing locale
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-11-28 19:32:03 +00:00
Philip Withnall
454064f82d gdate: Fix some typos in a documentation comment
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-11-28 19:32:03 +00:00
Philip Withnall
df4aea7620 gdatetime: Add support for %E modifier to g_date_time_format()
The `%E` modifier causes dates to be formatted using an alternative era
representation for years. This doesn’t do anything for most dates, but
in locales such as Thai and Japanese it causes years to be printed using
era names.

In Thai, this means the Thai solar calendar
(https://en.wikipedia.org/wiki/Thai_solar_calendar). In Japanese, this
means Japanese era names
(https://en.wikipedia.org/wiki/Japanese_era_name).

The `%E` modifier syntax follows what’s supported in glibc — see
nl_langinfo(3).

Supporting this is quite involved, as it means loading the `ERA`
description from libc and parsing it.

Unit tests are included.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Fixes: #3119
2023-11-28 19:32:02 +00:00
Philip Withnall
96c317418a gdbusconnection: Support matching object paths with arg0 matching
GDBus has always supported matching strings with arg0 matching
(`G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH`). In D-Bus 1.5, support was added
to the spec for also matching object paths. This got forgotten about and
was never added to GDBus, meaning that
`G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH` won’t match against a signal arg0
of type `o`.

Fix that, and add a unit test.

To do so, we need to add a new `g_dbus_message_get_arg0_path()` API to
complement the existing `g_dbus_message_get_arg0()` API. The approach of
letting `g_dbus_message_get_arg0()` return an object-path *or* a string
would not work, as it’s also called in the implementation of
`G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE`, which must only match
string-typed arg0 values and not object-path-typed ones.

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

Fixes: #3183
2023-11-28 14:42:41 +00:00
Philip Withnall
10e9a917be gdbusmessage: Cache the arg0 value
Technically we can’t rely on it being kept alive by the `message->body`
pointer, unless we can guarantee that the `GVariant` is always
serialised. That’s not necessarily the case, so keep a separate ref on
the arg0 value at all times.

This avoids a potential use-after-free.

Spotted by Thomas Haller in
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3720#note_1924707.

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

Helps: #3183
2023-11-28 14:09:42 +00:00
Philip Withnall
ded4976337 Merge branch 'migrate-to-gi-docgen14' into 'main'
Switch to using gi-docgen for docs (batch 14)

Closes #3037

See merge request GNOME/glib!3724
2023-11-28 14:06:23 +00:00
Michael Catanzaro
6ecf380f22 Merge branch 'alpine-ci-name' into 'main'
ci: Make the Alpine CI name more consistent

See merge request GNOME/glib!3733
2023-11-28 13:57:20 +00:00
Matthias Clasen
6ca2934928 build: Remove all remaining gtk-doc build infrastructure
It’s no longer needed: the documentation is built by gi-docgen now.

Fixes: #3037
2023-11-28 13:52:35 +00:00
Philip Withnall
0fe3a9d1df docs: Drop the tools tutorial page
It’s completely out of date.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
54eb9b8900 docs: Convert the resources page to Markdown
And change mentions of ‘mailing lists’ to ‘support’ while I’m there.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
2c4a0c83e1 docs: Drop the regex-syntax page
Point people to the official PCRE documentation instead, which is going
to be more up to date. This saves us periodically having to copy in and
reformat the PCRE documentation.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
ed5c17018f docs: Convert the programming page to Markdown
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
59a4a239a1 docs: Remove the ‘changes to GLib’ page
We haven’t made any backwards-incompatible changes since GLib 2.2 in
2002. It’s probably not very useful to tell people about those any more.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
94d2265429 docs: Convert the migrating-posix page to Markdown
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
e2efafb857 docs: Delete the generated gdbus-object-manager-example docs
They were previously `xi:include`d into some of the GDBus documentation,
but since the GDBus documentation was ported to Markdown that’s no
longer possible, so the object manager example docs now serve no
purpose.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
6a22d58f6b docs: Move the types SECTION
Move it to a mega separate file.

This has been a journey.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
33c10e8711 docs: Move the windows SECTION
Move it to a separate file.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
3532e3ca1c docs: Move the warnings SECTION
Move it to a separate file.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
877b0affb6 docs: Move the numerical SECTION
Move it to a separate Markdown file.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
3957b47e59 docs: Move the checkedmath SECTION
Move it to a separate Markdown file.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
b93e35dc17 docs: Move the datalist and dataset SECTIONs
Move them to a separate page as they don’t really have a ‘class’ struct
each to hang docs off.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
790131687c docs: Move the unix SECTION
Move it to a separate page.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
244721baf9 docs: Move the misc_utils SECTION
Move it to a separate page, with a massive great list of all the misc
utils. Not a great documentation page, but equivalent to what we had
before, and it can be improved in future.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
74de872bb9 docs: Move the spawn SECTION
Move it to a separate page.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
6dca578f9d docs: Move the memory SECTION
Move it to a separate page.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
cbbd06fee7 docs: Drop the SECTION for tracing
All this API is internal to GLib, so the section was never actually
exposed in the public API documentation. Keep the documentation, just
don’t tag it as a SECTION.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
25a4205d9d docs: Move the ghostutils SECTION
Sadly, this is about hostnames rather than ghosts. 😞

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
425731f766 docs: Move the string_utils SECTION
Move it to a mega separate file.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
cf52727f03 docs: Move the shell SECTION
Move it to a separate file.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
214853d6df docs: Move the GVariant SECTION
Move it to the struct docs.

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

Helps: #3037
2023-11-28 13:52:05 +00:00