Commit Graph

27767 Commits

Author SHA1 Message Date
Luca Bacci
337912072a Windows: Compile with the UNICODE / _UNICODE macros
It's the recommended way to build C/C++ projects on Windows, see
https://learn.microsoft.com/en-us/windows/win32/intl/conventions-for-function-prototypes
2023-10-12 11:32:03 +02:00
Philip Withnall
9c81ff46a2 Merge branch 'fix-z-format-tests' into 'main'
tests: Fix gdatetime test on non-UTC systems

See merge request GNOME/glib!3613
2023-10-04 12:41:30 +00:00
Emmanuele Bassi
ab83d965e8 Merge branch 'version-bump' into 'main'
build: Post-release version bump

See merge request GNOME/glib!3605
2023-10-04 09:33:58 +00:00
Philip Withnall
62c33e653f tests: Fix gdatetime test on non-UTC systems
Commit 0b114b2687 accidentally made the
tests only pass on systems running in a UTC timezone, as it checked the
local timezone `%Z` format against `UTC`.

This happens to pass on all the GLib CI runners except the macOS one,
which is running under CET.

Make the formatting tests timezone-independent by running them with UTC
datetimes. There’s already a separate test for checking that `%Z` works
correctly in a non-UTC timezone (`test_z`).

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

See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3611#note_1859208
2023-10-04 10:14:20 +01:00
Philip Withnall
2046a1b9d2 Merge branch 'mcatanzaro/security' into 'main'
Expand security policy to cover previous stable branch

See merge request GNOME/glib!3597
2023-10-04 08:33:52 +00:00
Philip Withnall
31e96edbdd Merge branch 'glib-2.78.0-g_assert_cmpint' into 'main'
gtestutils.h: Fix warning with -Wsign-conversion caused by g_assert_cmpint

See merge request GNOME/glib!3590
2023-10-04 08:30:43 +00:00
Philip Withnall
9f6b42af6e Merge branch 'vectored-exception-handlers' into 'main'
Small fixes and cleanups for Vectored Exception Handlers

See merge request GNOME/glib!3569
2023-10-04 08:19:57 +00:00
Philip Withnall
fdfaa993e6 Merge branch 'fix-unaligned-dirent64' into 'main'
Buffer needs to be aligned correctly to receive linux_dirent64.

See merge request GNOME/glib!3582
2023-10-03 17:43:13 +00:00
Sebastian Wilhelmi
9a48cbf27b Buffer needs to be aligned correctly to receive linux_dirent64. 2023-10-03 17:43:12 +00:00
Philip Withnall
199fa27321 Merge branch 'update-strv-annotations' into 'main'
Update GStrv annotations

See merge request GNOME/glib!3612
2023-10-03 17:29:28 +00:00
Philip Withnall
f3469858f3 Merge branch 'uncomment' into 'main'
gdesktopappinfo: Do not search Comment field

See merge request GNOME/glib!3610
2023-10-03 17:12:59 +00:00
badcel
85d2a7549d
Update GStrv annotations 2023-10-03 16:09:03 +02:00
Florian Müllner
794b18df34 gdesktopappinfo: Do not search Comment field
The Comment field provides a user-visible description of the app,
which usually contains generic words ("and", "or", "not", "is", ...)
that add noise when used for search.

It made some sense to match against the field as a fallback for
Keywords, before that key was well established. However that key
has been around for years now, so hopefully every app where additional
terms are helpful uses it by now.

With that, the downside of added noise outweighs the benefit, so
it's time to stop matching on comments.
2023-10-03 14:05:27 +02:00
Philip Withnall
2f1f97d58d Merge branch 'wip/paveloom/tcp-connection-leak' into 'main'
Make sure the `GTask` is freed on a graceful disconnect

See merge request GNOME/glib!3607
2023-10-03 10:41:16 +00:00
Philip Withnall
c1528778e6 Merge branch 'fix_3116' into 'main'
glocalfileinfo: Preserve microseconds for access/modify times

Closes #3116

See merge request GNOME/glib!3587
2023-10-03 10:00:55 +00:00
Philip Withnall
b4e6a834a2 Merge branch 'tls-callbacks' into 'main'
Make use of TLS callbacks for static builds on Windows

Closes #3087

See merge request GNOME/glib!3560
2023-10-03 10:00:44 +00:00
Philip Withnall
3d99d02112 Merge branch 'wip/chergert/make-gtype-create-instance-fast' into 'main'
gobject: cache flags needed for g_type_create_instance()

See merge request GNOME/glib!3595
2023-10-03 09:45:27 +00:00
Philip Withnall
d8be7a9a41 Merge branch 'update-grand-annotations' into 'main'
Update GRand annotations

See merge request GNOME/glib!3572
2023-10-03 09:27:37 +00:00
Philip Withnall
83218add7d Merge branch 'upate-gstringchunk-annotations' into 'main'
Update GStringChunk annotations

See merge request GNOME/glib!3571
2023-10-03 09:26:30 +00:00
Philip Withnall
3a1e53b80d docs: Add 2.80 release series documentation pages to the build
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-10-03 10:24:19 +01:00
Philip Withnall
260b5003c6 build: Post-release version bump
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-10-03 10:21:56 +01:00
Philip Withnall
2f7b20538f Merge branch 'update-hmac-annotations' into 'main'
Update annotations for GHmac

See merge request GNOME/glib!3567
2023-10-03 09:16:54 +00:00
Philip Withnall
ee56c7697b Merge branch 'update-annotations' into 'main'
Update annotations for GAsyncQueue and GDir

See merge request GNOME/glib!3566
2023-10-03 09:11:42 +00:00
Luca Bacci
c4c39ea52a tests/constructor: Support systems where dlclose is a no-op
POSIX allows dlclose() implementations that are no-ops,
and in such case library destructors run at application
exit rather than dlclose().

That's the case, for example, of UNIX systems with the
Musl LibC.
2023-10-03 11:07:16 +02:00
Luca Bacci
85e21ff757 tests/constructor: Test all destructors
Previously we were only testing destructors that run on
dlclose, now we also test destructors running at application
exit.
2023-10-03 11:07:11 +02:00
Philip Withnall
57169dd92f Merge branch 'update-gtimer-annotations' into 'main'
Update GTimer annotations

See merge request GNOME/glib!3573
2023-10-03 08:46:20 +00:00
Christian Hergert
ab2fe494a4 gobject: inline G_TYPE_IS() macros within gtype.c
If you take a release build (--buildtype=release) previously of GLib,
functions such as g_type_create_instance() would call out to
g_type_test_flags() which you can see by disassembling and looking for the
call instruction to <g_type_test_flags> via the library ABI.

Now that the previous commit allows checking abstract and deprecated flags
it makes sense to let the compiler optimize those checks into a single
pass. This is only possible if the functions themselves are inlined.

Additionally, any time we have the same TypeNode we would want to be able
to reuse that node rather than re-locate it.
2023-10-03 09:44:32 +01:00
Christian Hergert
5de7dd5a4b gobject: cache flags needed for g_type_create_instance()
Every call to g_type_create_instance() currently will incur a RWLock at
least once, but usually twice to test for both G_TYPE_FLAG_ABSTRACT and
G_TYPE_FLAG_DEPRECATED.

Additionally, each call to g_type_instance_free() also checks for these.
That results in a synchronization of GTypeInstance creation across all
threads as well as being a huge amount of overhead when creating instances
like GskRenderNode.

With this patch in place, the next two biggest issues are
g_type_class_ref() and g_type_test_flags() not getting inlined within
gtype.c in release builds. We can address that separately though.

Sysprof shows that the RWLock, with this patch in place, falls off the
profiles.
2023-10-03 09:44:32 +01:00
Philip Withnall
8adc39a870 Merge branch 'update-goption-annotations' into 'main'
Update GOptionContext annotations

See merge request GNOME/glib!3568
2023-10-03 08:43:54 +00:00
Philip Withnall
83eb8fc359 Merge branch 'wip/chergert/separate-gweakref-from-gweaknotify-gdata' into 'main'
gobject: Separate GWeakRef from GWeakNotify

See merge request GNOME/glib!3316
2023-10-03 08:43:37 +00:00
Luca Bacci
f23a31ee26 Use helper shared library for the constructor test 2023-10-03 10:43:34 +02:00
Philip Withnall
a9f2ffe788 Merge branch 'new_datetime_mods' into 'main'
Add support for case modifiers to DateTime

Closes #3115

See merge request GNOME/glib!3584
2023-10-03 08:43:03 +00:00
Rick Calixte
0b114b2687 Add support for case modifiers to DateTime 2023-10-03 08:43:03 +00:00
Philip Withnall
74d2586d7c Merge branch 'prefix_match_more_prominence' into 'main'
GDesktopAppInfo: prioritize match_type over match_category when searching apps

Closes #3082

See merge request GNOME/glib!3592
2023-10-03 08:40:14 +00:00
Luca Bacci
683991d836 Add test for module constructors, destructors and TLS callbacks 2023-10-03 10:33:42 +02:00
Lukáš Tyrychtr
0e8e941e95 glocalfileinfo: Preserve microseconds for access/modify times
When setting the file time using utimensat, don't ignore
microseconds for access/modify times. By doing that, they're preserved
when using g_file_info_set_modification_date_time and then setting the file's
attributes from it.

Fixes #3116
2023-10-03 09:32:44 +01:00
Luca Bacci
af0a9489e7 Docs: Static builds on MSVC are supported 2023-10-03 10:26:10 +02:00
Luca Bacci
0bbe3c8447 gconstructorprivate.h: Add seamless support for C++
G_DEFINE_TLS_CALLBACK could be made public in the future
2023-10-03 10:26:10 +02:00
Luca Bacci
f916621d72 gthread-win32: Clean up GPrivate data in all cases 2023-10-03 10:26:10 +02:00
Luca Bacci
8436785a5f Make use of TLS callbacks for static builds on Windows
Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/3087
2023-10-03 10:26:10 +02:00
Luca Bacci
51cbb63cd5 Add support for TLS callbacks on Windows 2023-10-03 10:25:06 +02:00
Philip Withnall
ec8c62d765 Merge branch 'gresources-msvc-prototypes' into 'main'
gconstructor.h: Ensure [c|d]tor prototypes are present for MSVC

See merge request GNOME/glib!3589
2023-10-03 08:15:43 +00:00
Michael Catanzaro
61075ef0bd Expand security policy to cover previous stable branch
The goal here is to reconcile the difference between GLib's 6-month
security policy and GNOME's 12-month policy (which may soon be expanded
to 13 months, gnome-build-meta#731). It's strange for GLib to be an
exception when the rest of GNOME supports two stable branches at a time.
I'm not aware of any other GNOME project with a shorter release lifetime
than GNOME itself, and it results in a situation where the previous
stable version of the GNOME runtime never receives any GLib updates,
since we stick with the same GLib version for the entire release and do
not do security backports.

But I also want to avoid creating an expectation that GLib maintainers
will do a bunch of additional backporting work, so most commits should
be out of scope. We can say maintainer discretion will be used to
determine whether a backport to the previous stable branch is warranted.
And normally, it won't be, so the goal should be no previous stable
branch releases. But occasionally we might feel a CVE is important
enough that a release really is warranted.
2023-10-03 09:12:37 +01:00
Nelson Benítez León
40f567aa2a GDesktopAppInfo: prioritize match_type over match_category when searching apps
Commit 9e2ad88455 improved app search results by allowing to differentiate
their match_type: prefix match or substring match; while giving more priority
to prefix matches over substring matches, but only when they are in the same
match_category[1].

This was a step forward but, as outlined in #3082, still not enough to get
most relevant results first to the user, because apparently (and for the
specific case of desktop app searching) a prefix match in a lower category
is more relevant to the user than a substring match in a higher category.

So that's what this commit implements, i.e. it makes sure prefix matches
are still preferred over substring matches but this time not only when
in the same category but also across different categories.

[1] Match category is the Desktop file key where the match happened.
    They are shown below from top to lesser priority.
      DESKTOP_KEY_Name
      DESKTOP_KEY_Exec
      DESKTOP_KEY_Keywords
      DESKTOP_KEY_GenericName
      DESKTOP_KEY_X_GNOME_FullName
      DESKTOP_KEY_Comment

Fixes #3082
2023-10-03 09:10:21 +01:00
Nelson Benítez León
3c22e2745c test: improvements for GAppInfo test
· Add a usage output that is printed when called with no argument
   or with '--help' argument. This is helpful as it avoids having
   to read the source code to know how to run the different options.

 · Adds new '--should-show-only' option to 'search' command, to
   better mimick the gnome-shell app search, by not returning
   apps with NoDisplay=true.

  Example for running a desktop app search with the new option from
  inside the GLib build dir:
    $ gio/tests/apps search --should-show-only settings
2023-10-03 09:10:21 +01:00
Emmanuele Bassi
1cd0dfa55b Merge branch '3107-use-portal' into 'main'
gio: Rename GTK_USE_PORTAL to GIO_USE_PORTALS

Closes #3107

See merge request GNOME/glib!3602
2023-10-02 17:27:36 +00:00
Chun-wei Fan
b60d97f428 gconstructor.h: Ensure [c|d]tor prototypes are present for MSVC
This way, the generated GResource code won't choke if no prototypes are found
when being built by clang-cl, which also goes the _MSC_VER >= 1500 route.

Fixes clang-cl build of generated GResources code when building the appstream
git checkout, which supported Windows recently, as the build there demands
'-Werror,-Wmissing-prototypes'.

Part-of: <https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3589>
2023-10-02 18:26:19 +01:00
Philip Withnall
86fdb4c7bf Merge branch 'ebassi/issue-3130' into 'main'
Check for empty property name in GPropertyAction

Closes #3130

See merge request GNOME/glib!3599
2023-10-02 17:09:55 +00:00
Arjan Molenaar
e9f0259e5d tests: Add a test for initialising GPropertyAction with no name
Helps: #3130
2023-10-02 17:17:24 +01:00
Emmanuele Bassi
3a2af81ced Check for empty property name in GPropertyAction
Make sure to fail consistently in case people created a GPropertyAction
with g_object_new() without passing a property name.

Bindings that construct objects with g_object_new() have no idea if a
property is mandatory.

See: #3130
2023-10-02 17:17:24 +01:00